本文整理汇总了PHP中ctools_export_ui::hook_menu方法的典型用法代码示例。如果您正苦于以下问题:PHP ctools_export_ui::hook_menu方法的具体用法?PHP ctools_export_ui::hook_menu怎么用?PHP ctools_export_ui::hook_menu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ctools_export_ui
的用法示例。
在下文中一共展示了ctools_export_ui::hook_menu方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
function hook_menu(&$items)
{
// Change the item to a tab.
$this->plugin['menu']['items']['list']['type'] = MENU_LOCAL_TASK;
$this->plugin['menu']['items']['list']['weight'] = -6;
$this->plugin['menu']['items']['list']['title'] = 'List defaults';
// menu local actions are weird.
$this->plugin['menu']['items']['add']['path'] = 'list/add';
$this->plugin['menu']['items']['import']['path'] = 'list/import';
// Edit is being handled elsewhere.
unset($this->plugin['menu']['items']['edit callback']);
unset($this->plugin['menu']['items']['access']);
foreach (panelizer_operations() as $path => $operation) {
$location = isset($operation['ui path']) ? $operation['ui path'] : $path;
if (isset($this->plugin['menu']['items'][$location])) {
unset($this->plugin['menu']['items'][$location]);
}
}
// Change the callbacks for everything.
foreach ($this->plugin['menu']['items'] as $key => $item) {
// The item has already been set; continue to next item to avoid shifting
// items onto the page arguments array more than once.
if ($this->plugin['menu']['items'][$key]['access callback'] == 'panelizer_has_choice_callback') {
continue;
}
$this->plugin['menu']['items'][$key]['access callback'] = 'panelizer_has_choice_callback';
$this->plugin['menu']['items'][$key]['access arguments'] = array(3, 4, '');
$this->plugin['menu']['items'][$key]['page callback'] = 'panelizer_export_ui_switcher_page';
array_unshift($this->plugin['menu']['items'][$key]['page arguments'], 4);
array_unshift($this->plugin['menu']['items'][$key]['page arguments'], 3);
}
parent::hook_menu($items);
}
示例2: unset
function hook_menu(&$items)
{
// Change the item to a tab.
$this->plugin['menu']['items']['list']['type'] = MENU_LOCAL_TASK;
$this->plugin['menu']['items']['list']['weight'] = -6;
$this->plugin['menu']['items']['list']['title'] = 'List defaults';
// menu local actions are weird.
$this->plugin['menu']['items']['add']['path'] = 'list/add';
$this->plugin['menu']['items']['import']['path'] = 'list/import';
// Edit is being handled elsewhere:
unset($this->plugin['menu']['items']['edit']);
unset($this->plugin['menu']['items']['edit callback']);
unset($this->plugin['menu']['items']['context']);
unset($this->plugin['menu']['items']['content']);
unset($this->plugin['menu']['items']['layout']);
unset($this->plugin['menu']['items']['access']);
// Change the callbacks for everything:
foreach ($this->plugin['menu']['items'] as $key => $item) {
$this->plugin['menu']['items'][$key]['access callback'] = 'panelizer_has_choice_callback';
$this->plugin['menu']['items'][$key]['access arguments'] = array(4, 5, '');
$this->plugin['menu']['items'][$key]['page callback'] = 'panelizer_export_ui_switcher_page';
array_unshift($this->plugin['menu']['items'][$key]['page arguments'], 5);
array_unshift($this->plugin['menu']['items'][$key]['page arguments'], 4);
}
parent::hook_menu($items);
}
示例3: unset
function hook_menu(&$items)
{
// During updates, this can run before our schema is set up, so our
// plugin can be empty.
if (empty($this->plugin['menu']['items']['add'])) {
return;
}
// Change the item to a tab on the Panels page.
$this->plugin['menu']['items']['list callback']['type'] = MENU_LOCAL_TASK;
// Establish a base for adding plugins
$base = $this->plugin['menu']['items']['add'];
// Remove the default 'add' menu item.
unset($this->plugin['menu']['items']['add']);
ctools_include('plugins', 'panels');
$this->builders = panels_get_layout_builders();
asort($this->builders);
foreach ($this->builders as $name => $builder) {
// Create a new menu item for the builder
$item = $base;
$item['title'] = !empty($builder['builder tab title']) ? $builder['builder tab title'] : 'Add ' . $builder['title'];
$item['page arguments'][] = $name;
$item['path'] = 'add-' . $name;
$this->plugin['menu']['items']['add ' . $name] = $item;
}
parent::hook_menu($items);
}
示例4:
function hook_menu(&$items)
{
// Change the item to a tab on the fb_social configuration page.
$this->plugin['menu']['items']['list callback']['type'] = MENU_LOCAL_TASK;
$this->plugin['menu']['items']['list callback']['weight'] = 10;
parent::hook_menu($items);
}
示例5: hook_menu
/**
* Ensure we cannot add, import, delete or clone.
*/
public function hook_menu(&$items)
{
parent::hook_menu($items);
unset($items['admin/config/system/cron/jobs/add']);
// unset($items['admin/config/system/cron/jobs/import']);
unset($items['admin/config/system/cron/jobs/list/%ctools_export_ui/delete']);
unset($items['admin/config/system/cron/jobs/list/%ctools_export_ui/clone']);
}
示例6: unset
function hook_menu(&$items)
{
// We are using our own 'edit' still, rather than having edit on this
// object (maybe in the future) so unset the edit callbacks:
// We leave these to make sure the operations still exist in the plugin so
// that the path finder.
unset($this->plugin['menu']['items']['edit']);
unset($this->plugin['menu']['items']['add']);
unset($this->plugin['menu']['items']['import']);
unset($this->plugin['menu']['items']['edit callback']);
parent::hook_menu($items);
}
示例7: foreach
/**
* hook_menu() entry point.
*/
function hook_menu(&$items)
{
parent::hook_menu($items);
$bundles = ms_products_get_bundles();
foreach ($bundles as $bundle => $bundle_info) {
$items['admin/structure/ms_products/' . $bundle . '/add'] = $items['admin/structure/ms_products/add'];
$items['admin/structure/ms_products/' . $bundle . '/add']['access callback'] = 'user_access';
$items['admin/structure/ms_products/' . $bundle . '/add']['access arguments'] = array('administer ' . $bundle . ' plans');
$items['admin/structure/ms_products/' . $bundle . '/import'] = $items['admin/structure/ms_products/import'];
$items['admin/structure/ms_products/' . $bundle . '/import']['access callback'] = 'user_access';
$items['admin/structure/ms_products/' . $bundle . '/import']['access arguments'] = array('administer ' . $bundle . ' plans');
}
unset($items['admin/structure/ms_products/add']);
}
示例8: unset
function hook_menu(&$items)
{
// We are using our own 'edit' still, rather than having edit on this
// object (maybe in the future) so unset the edit callbacks:
// Store this so we can put them back as sometimes they're needed
// again laster:
$stored_items = $this->plugin['menu']['items'];
// We leave these to make sure the operations still exist in the plugin so
// that the path finder.
unset($this->plugin['menu']['items']['edit']);
unset($this->plugin['menu']['items']['add']);
unset($this->plugin['menu']['items']['import']);
unset($this->plugin['menu']['items']['edit callback']);
parent::hook_menu($items);
$this->plugin['menu']['items'] = $stored_items;
}
示例9: unset
/**
* Modify the default ctools export-ui hook_menu implementation.
*/
function hook_menu(&$items)
{
parent::hook_menu($items);
// Ensure the profiles tab is displayed correctly in the contexts of Ting
// field search tabs.
unset($items['admin/config/ting/ting-field-search/profiles/list']);
$items['admin/config/ting/ting-field-search/profiles']['type'] = MENU_LOCAL_TASK;
// Try to fix the display of the nested profile editing tabs.
unset($items['admin/config/ting/ting-field-search/profiles/list/%ctools_export_ui/edit']['page callback']);
unset($items['admin/config/ting/ting-field-search/profiles/list/%ctools_export_ui/edit']['page arguments']);
unset($items['admin/config/ting/ting-field-search/profiles/list/%ctools_export_ui/edit']['load arguments']);
unset($items['admin/config/ting/ting-field-search/profiles/list/%ctools_export_ui/edit']['access callback']);
unset($items['admin/config/ting/ting-field-search/profiles/list/%ctools_export_ui/edit']['access arguments']);
$items['admin/config/ting/ting-field-search/profiles/list/%ctools_export_ui']['type'] = MENU_NORMAL_ITEM;
$items['admin/config/ting/ting-field-search/profiles/list/%ctools_export_ui']['title'] = 'Edit';
}
示例10: strlen
function hook_menu(&$items)
{
parent::hook_menu($items);
// For added convienience, allow additional operation links to be available
// as local tasks.
$prefix = $this->plugin['menu']['menu prefix'] . '/' . $this->plugin['menu']['menu item'] . '/list/%ctools_export_ui/';
$prefix_length = strlen($prefix);
$ops = array('delete', 'revert', 'clone');
foreach ($items as $path => &$item) {
if (substr($path, 0, $prefix_length) === $prefix) {
$str[$path] = $item;
if (in_array(substr($path, $prefix_length), $ops)) {
$item['type'] = MENU_LOCAL_TASK;
}
}
}
}
示例11:
/**
* Implementats CTools psuedo hook_menu_alter().
*
* @todo
* Can we do this in $plugin instead?
*/
function hook_menu(&$items)
{
parent::hook_menu($items);
$items['admin/structure/deploy/plans']['type'] = MENU_LOCAL_TASK;
$items['admin/structure/deploy/plans']['weight'] = -10;
}
示例12:
/**
* hook_menu() entry point.
*
* Child implementations that need to add or modify menu items should
* probably call parent::hook_menu($items) and then modify as needed.
*/
function hook_menu(&$items)
{
parent::hook_menu($items);
$items['admin/structure/openlayers/layers']['type'] = MENU_LOCAL_TASK;
}
示例13:
/**
* hook_menu() entry point.
*
* Child implementations that need to add or modify menu items should
* probably call parent::hook_menu($items) and then modify as needed.
*/
function hook_menu(&$items)
{
parent::hook_menu($items);
$items['admin/structure/openlayers/maps']['type'] = MENU_LOCAL_TASK;
$items['admin/structure/openlayers/maps/list/%ctools_export_ui/clone']['context'] = MENU_CONTEXT_INLINE;
$items['admin/structure/openlayers/maps/list/%ctools_export_ui/edit']['context'] = MENU_CONTEXT_INLINE;
$items['admin/structure/openlayers/maps/list/%ctools_export_ui/export']['context'] = MENU_CONTEXT_INLINE;
$items['admin/structure/openlayers/maps/list/%ctools_export_ui/revert']['context'] = MENU_CONTEXT_INLINE;
$items['admin/structure/openlayers/maps/list/%ctools_export_ui/clone']['type'] = MENU_LOCAL_TASK;
$items['admin/structure/openlayers/maps/list/%ctools_export_ui/edit']['type'] = MENU_LOCAL_TASK;
$items['admin/structure/openlayers/maps/list/%ctools_export_ui/export']['type'] = MENU_LOCAL_TASK;
$items['admin/structure/openlayers/maps/list/%ctools_export_ui/revert']['type'] = MENU_LOCAL_TASK;
}
示例14:
/**
* Override menu items.
*/
function hook_menu(&$items)
{
$stored_items = $this->plugin['menu']['items'];
parent::hook_menu($items);
$this->plugin['menu']['items'] = $stored_items;
}
示例15:
function hook_menu(&$items)
{
if (empty($this->plugin['schema'])) {
return;
}
parent::hook_menu($items);
$prefix = ctools_export_ui_plugin_base_path($this->plugin);
}