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); }
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); }
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); }
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); }
/** * 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']); }
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); }
/** * 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']); }
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; }
/** * 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'; }
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; } } } }
/** * 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; }
/** * 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; }
/** * 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; }
/** * Override menu items. */ function hook_menu(&$items) { $stored_items = $this->plugin['menu']['items']; parent::hook_menu($items); $this->plugin['menu']['items'] = $stored_items; }
function hook_menu(&$items) { if (empty($this->plugin['schema'])) { return; } parent::hook_menu($items); $prefix = ctools_export_ui_plugin_base_path($this->plugin); }
/** * Implements CTools pseudo hook_menu_alter(). * * @todo * Can we do this in $plugin instead? */ function hook_menu(&$items) { parent::hook_menu($items); $items['admin/structure/deploy/endpoints']['type'] = MENU_LOCAL_TASK; }