diff --git a/README.txt b/README.txt index 28db89b..4a8548b 100644 --- a/README.txt +++ b/README.txt @@ -17,9 +17,9 @@ It requires Panels and Page Manager. INITIAL CONFIGURATION -Visit Configuration >> Panelizer to enable the module for the entities you -need. You may need to visit Site Building >> Pages and enable the appropriate -pages for supported entities. +Visit Structure >> Panelizer to enable the module for the entities you need. +You may need to visit Site Building >> Pages and enable the appropriate pages +for supported entities. Note that in all cases, modifying Panelizer settings for an entity requires update privileges for that entity. diff --git a/includes/admin.inc b/includes/admin.inc index 8f0c86b..8f394f4 100644 --- a/includes/admin.inc +++ b/includes/admin.inc @@ -17,7 +17,7 @@ function panelizer_admin_hook_menu(&$items) { 'file' => 'includes/admin.inc', ); - $items['admin/config/content/panelizer'] = array( + $items['admin/structure/panelizer'] = array( 'title' => 'Panelizer', 'description' => 'Configure panelizer availability and defaults', 'page callback' => 'drupal_get_form', @@ -25,25 +25,25 @@ function panelizer_admin_hook_menu(&$items) { 'type' => MENU_NORMAL_ITEM, ) + $settings_base; - $items['admin/config/content/panelizer/%panelizer_handler/%/allowed'] = array( + $items['admin/structure/panelizer/%panelizer_handler/%/allowed'] = array( 'title' => 'Allowed content', 'page callback' => 'panelizer_allowed_content_page', - 'page arguments' => array(4, 5), + 'page arguments' => array(3, 4), 'type' => MENU_CALLBACK, 'weight' => -10, ) + $settings_base; $tabs_base = array( 'access callback' => 'panelizer_has_no_choice_callback', - 'access arguments' => array(4, 5), - 'page arguments' => array(4, 5, 'default', ''), + 'access arguments' => array(3, 4), + 'page arguments' => array(3, 4, 'default', ''), 'type' => MENU_LOCAL_TASK, 'file' => 'includes/admin.inc', ); - $items['admin/config/content/panelizer/%panelizer_handler/%'] = array( + $items['admin/structure/panelizer/%panelizer_handler/%'] = array( 'title callback' => 'panelizer_default_title_callback', - 'title arguments' => array(4, 5), + 'title arguments' => array(3, 4), 'title' => 'Settings', 'page callback' => 'panelizer_default_settings_page', 'weight' => -5, @@ -52,30 +52,30 @@ function panelizer_admin_hook_menu(&$items) { $index = 0; foreach (panelizer_operations() as $path => $operation) { - $items['admin/config/content/panelizer/%panelizer_handler/%/' . $path] = array( + $items['admin/structure/panelizer/%panelizer_handler/%/' . $path] = array( 'title' => $operation['menu title'], 'page callback' => $operation['admin callback'], 'weight' => $index - 5, 'type' => ($index === 0) ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, ) + $tabs_base; if (isset($operation['file'])) { - $items['admin/config/content/panelizer/%panelizer_handler/%/' . $path]['file'] = $operation['file']; + $items['admin/structure/panelizer/%panelizer_handler/%/' . $path]['file'] = $operation['file']; } if (isset($operation['file path'])) { - $items['admin/config/content/panelizer/%panelizer_handler/%/' . $path]['file path'] = $operation['file path']; + $items['admin/structure/panelizer/%panelizer_handler/%/' . $path]['file path'] = $operation['file path']; } $index++; } $subtabs_base = array( 'access callback' => 'panelizer_administer_panelizer_default', - 'access arguments' => array(4, 5, 7), - 'page arguments' => array(4, 5, 7, ''), + 'access arguments' => array(3, 4, 6), + 'page arguments' => array(3, 4, 6, ''), 'type' => MENU_LOCAL_TASK, 'file' => 'includes/admin.inc', ); - $items['admin/config/content/panelizer/%panelizer_handler/%/list/%'] = array( + $items['admin/structure/panelizer/%panelizer_handler/%/list/%'] = array( 'title' => 'Settings', 'page callback' => 'panelizer_default_settings_page', 'title callback' => 'panelizer_default_name_title_callback', @@ -84,21 +84,21 @@ function panelizer_admin_hook_menu(&$items) { $index = 0; foreach (panelizer_operations() as $path => $operation) { - $items['admin/config/content/panelizer/%panelizer_handler/%/list/%/' . $path] = array( + $items['admin/structure/panelizer/%panelizer_handler/%/list/%/' . $path] = array( 'title' => $operation['menu title'], 'page callback' => $operation['admin callback'], 'weight' => $index - 5, ) + $subtabs_base; if (isset($operation['file'])) { - $items['admin/config/content/panelizer/%panelizer_handler/%/list/%/' . $path]['file'] = $operation['file']; + $items['admin/structure/panelizer/%panelizer_handler/%/list/%/' . $path]['file'] = $operation['file']; } if (isset($operation['file path'])) { - $items['admin/config/content/panelizer/%panelizer_handler/%/list/%/' . $path]['file path'] = $operation['file path']; + $items['admin/structure/panelizer/%panelizer_handler/%/list/%/' . $path]['file path'] = $operation['file path']; } $index++; } - $items['admin/config/content/panelizer/%panelizer_handler/%/list/%/access'] = array( + $items['admin/structure/panelizer/%panelizer_handler/%/list/%/access'] = array( 'title' => 'Access', 'page callback' => 'panelizer_default_access_page', 'weight' => -2, @@ -350,10 +350,10 @@ function panelizer_default_layout_page($handler, $bundle, $name, $view_mode, $st $display->context = $handler->get_contexts($panelizer); if ($name == 'default' && $handler->has_default_panel($bundle)) { - $path = 'admin/config/content/panelizer/' . $handler->entity_type . '/' . $bundle; + $path = 'admin/structure/panelizer/' . $handler->entity_type . '/' . $bundle; } else { - $path = 'admin/config/content/panelizer/' . $handler->entity_type . '/' . $bundle . '/list/' . $name ; + $path = 'admin/structure/panelizer/' . $handler->entity_type . '/' . $bundle . '/list/' . $name ; } $form_state = array( diff --git a/panelizer.info b/panelizer.info index 77cfd59..878effd 100644 --- a/panelizer.info +++ b/panelizer.info @@ -5,7 +5,7 @@ dependencies[] = panels dependencies[] = ctools dependencies[] = page_manager core = 7.x -configure = admin/config/content/panelizer +configure = admin/structure/panelizer files[] = plugins/views/panelizer_handler_field_link.inc files[] = plugins/views/panelizer_handler_panelizer_status.inc diff --git a/panelizer.install b/panelizer.install index edb2f6b..3671e4f 100644 --- a/panelizer.install +++ b/panelizer.install @@ -599,3 +599,11 @@ function panelizer_update_7115() { function panelizer_update_7116() { drupal_set_message(t('Note: the "Panelizer" tabs on content, user, term pages, etc have been renamed to "Customize display".')); } + +/** + * Clear the menu cache to pull in the new menu paths. + */ +function panelizer_update_7117() { + variable_set('menu_rebuild_needed', TRUE); + drupal_set_message(t('Note: the main Panelizer configuration page has moved to the "Structure" menu instead of the "Config" menu.')); +} diff --git a/panelizer.module b/panelizer.module index 58bc693..5122582 100644 --- a/panelizer.module +++ b/panelizer.module @@ -15,7 +15,7 @@ define('PANELIZER_VERSION', '3.0'); * Implements hook_help(). */ function panelizer_help($path, $arg) { - if ($path == 'admin/config/content/panelizer') { + if ($path == 'admin/structure/panelizer') { return '

' . t('Other than "Full page override" or "Default" (when applicable), only view modes enabled through the Custom Display Settings section of the Manage Display settings for that entity or bundle will be available for use.') . '

'; } } @@ -789,8 +789,8 @@ function panelizer_export_ui_switcher_page($entity_handler, $bundle, $plugin_nam $handler->entity_bundle = $bundle; $handler->entity_view_mode = $view_mode; - if (empty($entity_handler->entity_admin_root) || substr($_GET['q'], 30) == 'admin/config/content/panelizer') { - $handler->plugin['menu']['menu prefix'] = 'admin/config/content/panelizer/' . $entity_handler->entity_type; + if (empty($entity_handler->entity_admin_root) || substr($_GET['q'], 30) == 'admin/structure/panelizer') { + $handler->plugin['menu']['menu prefix'] = 'admin/structure/panelizer' . $entity_handler->entity_type; $handler->plugin['menu']['menu item'] = $bundle; } else { @@ -877,7 +877,7 @@ function panelizer_has_choice_callback($handler, $bundle, $name = NULL) { $handler = panelizer_entity_plugin_get_handler($handler); } - if (!$handler) { + if (empty($handler)) { return FALSE; } @@ -886,7 +886,7 @@ function panelizer_has_choice_callback($handler, $bundle, $name = NULL) { } // Check to see if $name is valid - if ($name && !$handler->get_default_panelizer_object($bundle, $name)) { + if (!empty($name) && !$handler->get_default_panelizer_object($bundle, $name)) { return FALSE; } @@ -910,11 +910,11 @@ function panelizer_has_no_choice_callback($handler, $bundle, $view_mode = NULL) $handler = panelizer_entity_plugin_get_handler($handler); } - if (!$handler) { + if (empty($handler)) { return FALSE; } - if ($view_mode) { + if (!empty($view_mode)) { $bundle .= '.' . $view_mode; } diff --git a/plugins/entity/PanelizerEntityDefault.class.php b/plugins/entity/PanelizerEntityDefault.class.php index 8516213..c49b01f 100644 --- a/plugins/entity/PanelizerEntityDefault.class.php +++ b/plugins/entity/PanelizerEntityDefault.class.php @@ -2484,7 +2484,7 @@ abstract class PanelizerEntityDefault implements PanelizerEntityInterface { if (!empty($bundle)) { $view_mode_settings = field_view_mode_settings($this->entity_type, $bundle); } - $base_url = 'admin/config/content/panelizer/' . $this->entity_type . '/' . $bundle; + $base_url = 'admin/structure/panelizer/' . $this->entity_type . '/' . $bundle; $bundle_id = str_replace(array('][', '_', ' '), '-', '#edit-entities-' . $this->entity_type . '-' . $bundle . '-0'); // Add the widgets that apply only to the bundle. @@ -2552,7 +2552,7 @@ abstract class PanelizerEntityDefault implements PanelizerEntityInterface { } $base_id = str_replace(array('][', '_', ' '), '-', '#edit-entities-' . $this->entity_type . '-' . $bundle . '-' . $view_mode); - $base_url = 'admin/config/content/panelizer/' . $this->entity_type . '/' . $bundle . '.' . $view_mode; + $base_url = 'admin/structure/panelizer/' . $this->entity_type . '/' . $bundle . '.' . $view_mode; if (!empty($this->plugin['bundles'][$bundle]['view modes'][$view_mode]) && is_array($this->plugin['bundles'][$bundle]['view modes'][$view_mode])) { $settings = $this->plugin['bundles'][$bundle]['view modes'][$view_mode]; diff --git a/plugins/export_ui/panelizer_defaults.inc b/plugins/export_ui/panelizer_defaults.inc index 9237207..cbe2181 100644 --- a/plugins/export_ui/panelizer_defaults.inc +++ b/plugins/export_ui/panelizer_defaults.inc @@ -5,7 +5,7 @@ $plugin = array( 'access' => 'administer panelizer', 'menu' => array( - 'menu prefix' => 'admin/config/content/panelizer/%panelizer_handler', + 'menu prefix' => 'admin/structure/panelizer/%panelizer_handler', 'menu item' => '%', 'menu title' => 'Panelizer', 'menu description' => 'Add, edit or delete custom content layouts.', diff --git a/plugins/export_ui/panelizer_defaults_ui.class.php b/plugins/export_ui/panelizer_defaults_ui.class.php index 44433f8..53d36f5 100644 --- a/plugins/export_ui/panelizer_defaults_ui.class.php +++ b/plugins/export_ui/panelizer_defaults_ui.class.php @@ -42,10 +42,10 @@ class panelizer_defaults_ui extends ctools_export_ui { } $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]['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'], 5); array_unshift($this->plugin['menu']['items'][$key]['page arguments'], 4); + array_unshift($this->plugin['menu']['items'][$key]['page arguments'], 3); } parent::hook_menu($items); diff --git a/plugins/task_handlers/panelizer_node.inc b/plugins/task_handlers/panelizer_node.inc index e6cdc27..2ebcfa1 100644 --- a/plugins/task_handlers/panelizer_node.inc +++ b/plugins/task_handlers/panelizer_node.inc @@ -185,7 +185,7 @@ function panelizer_panelizer_task_contextual_link($handler, $plugin, $contexts, ); } - $template_base_path = 'admin/config/content/panelizer/node/' . $bundle . '.' . $panelizer->view_mode; + $template_base_path = 'admin/structure/panelizer/node/' . $bundle . '.' . $panelizer->view_mode; if ($entity_handler->panelizer_access('settings', $entity, 'page_manager')) { $links['default_settings'] = array( 'title' => t('Edit default display settings'),