本文整理汇总了PHP中Croogo::hookAdminRowAction方法的典型用法代码示例。如果您正苦于以下问题:PHP Croogo::hookAdminRowAction方法的具体用法?PHP Croogo::hookAdminRowAction怎么用?PHP Croogo::hookAdminRowAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Croogo
的用法示例。
在下文中一共展示了Croogo::hookAdminRowAction方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: translateModels
/**
* Read configured Translate.models and hook the appropriate behaviors
*/
public static function translateModels()
{
$path = 'admin:true/plugin:translate/controller:translate/action:index/:id/';
foreach (Configure::read('Translate.models') as $model => $config) {
Croogo::hookBehavior($model, 'Translate.CroogoTranslate', $config);
Croogo::hookAdminRowAction(Inflector::pluralize($model) . '/admin_index', __d('croogo', 'Translate'), array($path . $model => array('title' => false, 'options' => array('icon' => 'translate', 'data-title' => __d('croogo', 'Translate')))));
}
}
示例2:
*/
Croogo::hookComponent('*', 'Example.Example');
/**
* Helper
*
* This plugin's Example helper will be loaded via NodesController.
*/
Croogo::hookHelper('Nodes', 'Example.Example');
/**
* Admin menu (navigation)
*
* This plugin's admin_menu element will be rendered in admin panel under Extensions menu.
*/
Croogo::hookAdminMenu('Example');
/**
* Admin row action
*
* When browsing the content list in admin panel (Content > List),
* an extra link called 'Example' will be placed under 'Actions' column.
*/
Croogo::hookAdminRowAction('Nodes/admin_index', 'Example', 'plugin:example/controller:example/action:index/:id');
/**
* Admin tab
*
* When adding/editing Content (Nodes),
* an extra tab with title 'Example' will be shown with markup generated from the plugin's admin_tab_node element.
*
* Useful for adding form extra form fields if necessary.
*/
Croogo::hookAdminTab('Nodes/admin_add', 'Example', 'example.admin_tab_node');
Croogo::hookAdminTab('Nodes/admin_edit', 'Example', 'example.admin_tab_node');
示例3: array_merge
<?php
Croogo::hookApiComponent('Users', 'Users.UserApi');
/**
* Failed login attempts
*
* Default is 5 failed login attempts in every 5 minutes
*/
$cacheConfig = array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('users')));
$failedLoginDuration = 300;
Configure::write('User.failed_login_limit', 5);
Configure::write('User.failed_login_duration', $failedLoginDuration);
CroogoCache::config('users_login', array_merge($cacheConfig, array('duration' => '+' . $failedLoginDuration . ' seconds', 'groups' => array('users'))));
Croogo::hookAdminRowAction('Users/admin_index', 'Reset Password', array('admin:true/plugin:users/controller:users/action:reset_password/:id' => array('title' => false, 'options' => array('icon' => 'unlock', 'tooltip' => array('data-title' => __d('croogo', 'Reset password'))))));
示例4: array
*/
Croogo::hookHelper('Nodes', 'Example.Example');
/**
* Admin menu (navigation)
*/
CroogoNav::add('sidebar', 'extensions.children.example', array('title' => 'Example', 'url' => '#', 'children' => array('example1' => array('title' => 'Example 1', 'url' => array('admin' => true, 'plugin' => 'example', 'controller' => 'example', 'action' => 'index')), 'example2' => array('title' => 'Example 2 with a title that won\'t fit in the sidebar', 'url' => '#', 'children' => array('example-2-1' => array('title' => 'Example 2-1', 'url' => '#', 'children' => array('example-2-1-1' => array('title' => 'Example 2-1-1', 'url' => '#', 'children' => array('example-2-1-1-1' => array('title' => 'Example 2-1-1-1'))))))), 'example3' => array('title' => 'Chooser Example', 'url' => array('admin' => true, 'plugin' => 'example', 'controller' => 'example', 'action' => 'chooser')), 'example4' => array('title' => 'RTE Example', 'url' => array('admin' => true, 'plugin' => 'example', 'controller' => 'example', 'action' => 'rte_example')))));
$Localization = new L10n();
Croogo::mergeConfig('Wysiwyg.actions', array('Example/admin_rte_example' => array(array('elements' => 'ExampleBasic', 'preset' => 'basic'), array('elements' => 'ExampleStandard', 'preset' => 'standard', 'language' => 'ja'), array('elements' => 'ExampleFull', 'preset' => 'full', 'language' => $Localization->map(Configure::read('Site.locale'))), array('elements' => 'ExampleCustom', 'toolbar' => array(array('Format', 'Bold', 'Italic'), array('Copy', 'Paste')), 'uiColor' => '#ffe79a', 'language' => 'fr'))));
/**
* Admin row action
*
* When browsing the content list in admin panel (Content > List),
* an extra link called 'Example' will be placed under 'Actions' column.
*/
Croogo::hookAdminRowAction('Nodes/admin_index', 'Example', 'plugin:example/controller:example/action:index/:id');
/* Row action with link options */
Croogo::hookAdminRowAction('Nodes/admin_index', 'Button with Icon', array('plugin:example/controller:example/action:index/:id' => array('options' => array('icon' => 'key', 'button' => 'success'))));
/* Row action with icon */
Croogo::hookAdminRowAction('Nodes/admin_index', 'Icon Only', array('plugin:example/controller:example/action:index/:id' => array('title' => false, 'options' => array('icon' => 'picture', 'tooltip' => array('data-title' => 'A nice and simple action with tooltip', 'data-placement' => 'left')))));
/* Row action with confirm message */
Croogo::hookAdminRowAction('Nodes/admin_index', 'Reload Page', array('admin:true/plugin:nodes/controller:nodes/action:index' => array('title' => false, 'options' => array('icon' => 'refresh', 'tooltip' => 'Reload page'), 'confirmMessage' => 'Reload this page?')));
/**
* Admin tab
*
* When adding/editing Content (Nodes),
* an extra tab with title 'Example' will be shown with markup generated from the plugin's admin_tab_node element.
*
* Useful for adding form extra form fields if necessary.
*/
Croogo::hookAdminTab('Nodes/admin_add', 'Example', 'example.admin_tab_node');
Croogo::hookAdminTab('Nodes/admin_edit', 'Example', 'example.admin_tab_node');
示例5: array
<?php
Croogo::hookAdminRowAction('Users/admin_index', 'Logged As', array('admin:true/plugin:chameleon/controller:chameleon/action:login_as/:id' => array('title' => false, 'options' => array('icon' => 'user-md', 'tooltip' => array('data-title' => __d('croogo', 'Login As'))))));
示例6: array
<?php
/**
* Configuration
*
*/
Configure::write('Translate.models', array('Node' => array('title' => 'titleTranslation', 'excerpt' => 'excerptTranslation', 'body' => 'bodyTranslation'), 'Block' => array('title' => 'titleTranslation', 'body' => 'bodyTranslation'), 'Link' => array('title' => 'titleTranslation', 'description' => 'descriptionTranslation')));
/**
* Do not edit below this line unless you know what you are doing.
*
*/
foreach (Configure::read('Translate.models') as $translateModel => $fields) {
Croogo::hookBehavior($translateModel, 'CroogoTranslate', $fields);
Croogo::hookAdminRowAction(Inflector::pluralize($translateModel) . '/admin_index', 'Translate', 'plugin:translate/controller:translate/action:index/:id/' . $translateModel);
}