You are here

function panels_page_admin_dynamic_menu_items in Panels 6.2

1 call to panels_page_admin_dynamic_menu_items()
panels_page_menu in panels_page/panels_page.module

File

panels_page/panels_page.menu.inc, line 52
panels_page.menu.inc

Code

function panels_page_admin_dynamic_menu_items($items = array(), $path_prefix = NULL) {

  // TODO allowing a dynamic path prefix may be superfluous
  if (is_null($path_prefix)) {
    $path_prefix = 'admin/panels/panel-page/';
  }
  $loader_arg = count(explode('/', $path_prefix)) - 1;
  $admin = array(
    'access arguments' => array(
      'create panel-pages',
    ),
    'file' => 'panels_page.admin.inc',
    'page arguments' => array(
      $loader_arg,
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items[$path_prefix . '%panels_page_admin/edit'] = array(
    'title' => 'Settings',
    'page callback' => 'panels_page_edit',
    'weight' => -10,
    'type' => MENU_CALLBACK,
  ) + $admin;
  $items[$path_prefix . '%panels_page_admin/edit/settings'] = array(
    'title' => 'Settings',
    'weight' => -10,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  ) + $admin;

  // Alternate method for organizing the settings/advanced tabs. I think this is
  // ultimately more sensible/intuitive. We'll see...

  /*
    $items[$path_prefix . '%panels_page_admin/edit/settings/general'] = array(
      'title' => 'General',
      'weight' => -10,
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[$path_prefix . '%panels_page_admin/edit/settings/advanced'] = array(
      'title' => 'Advanced',
      'page callback' => 'panels_page_edit_advanced',
      'weight' => -8,
    ) + $admin;*/
  $items[$path_prefix . '%panels_page_admin/edit/advanced'] = array(
    'title' => 'Advanced',
    'page callback' => 'panels_page_edit_advanced',
    'weight' => -8,
  ) + $admin;
  $items[$path_prefix . '%panels_page_admin/edit/context'] = array(
    'title' => 'Context',
    'page callback' => 'panels_page_edit_context',
    'load arguments' => array(
      'panels_page_admin_cache_load',
    ),
    'weight' => -6,
  ) + $admin;
  $items[$path_prefix . '%panels_page_admin/edit/layout'] = array(
    'title' => 'Layout',
    'page callback' => 'panels_page_edit_layout',
    'load arguments' => array(
      'panels_page_admin_cache_load',
      $loader_arg + 3,
    ),
    'weight' => -4,
  ) + $admin;
  $items[$path_prefix . '%panels_page_admin/edit/layout/default'] = array(
    'title' => 'Default',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -20,
  );
  $items[$path_prefix . '%panels_page_admin/edit/layout-settings'] = array(
    'title' => 'Layout settings',
    'page callback' => 'panels_page_edit_layout_settings',
    'load arguments' => array(
      'panels_page_admin_cache_load',
      $loader_arg + 3,
    ),
    'weight' => -2,
  ) + $admin;
  $items[$path_prefix . '%panels_page_admin/edit/layout-settings/default'] = array(
    'title' => 'Default',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -20,
  );
  $items[$path_prefix . '%panels_page_admin/edit/content'] = array(
    'title' => 'Content',
    'page callback' => 'panels_page_edit_content',
    'load arguments' => array(
      'panels_page_admin_cache_load',
      $loader_arg + 3,
    ),
    'weight' => 0,
  ) + $admin;
  $items[$path_prefix . '%panels_page_admin/edit/content/default'] = array(
    'title' => 'Default',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -20,
  );

  /*  $items[$path_prefix . '%panels_page_admin/edit/preview'] = array(
      'title' => 'Preview',
      'page callback' => 'panels_page_preview',
      'weight' => 2,
    ) + $admin;*/
  $items[$path_prefix . '%panels_page_admin/edit/preview'] = array(
    'title' => 'Preview',
    'page callback' => 'panels_page_preview_page',
    'page arguments' => array(
      $loader_arg,
    ),
    'weight' => 2,
  ) + $admin;
  $items[$path_prefix . '%panels_page_admin/edit/export'] = array(
    'title' => 'Export',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'panels_page_export_page',
      $loader_arg,
    ),
    'weight' => 4,
  ) + $admin;
  $items[$path_prefix . '%panels_page_admin/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'panels_page_delete_confirm',
      $loader_arg,
    ),
    'type' => MENU_CALLBACK,
  ) + $admin;
  return $items;
}