You are here

function panels_node_menu in Panels 6.3

Same name and namespace in other branches
  1. 5.2 panels_node/panels_node.module \panels_node_menu()
  2. 6.2 panels_node/panels_node.module \panels_node_menu()
  3. 7.3 panels_node/panels_node.module \panels_node_menu()

Implementation of hook_menu().

File

panels_node/panels_node.module, line 25
panels_node.module

Code

function panels_node_menu() {

  // Safety: go away if CTools is not at an appropriate version.
  if (!defined('PANELS_REQUIRED_CTOOLS_API') || !module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
    return array();
  }
  $items['admin/build/panels/settings/panel-node'] = array(
    'title' => 'Panel nodes',
    'description' => 'Configure which content is available to add to panel node displays.',
    'access arguments' => array(
      'administer panel-nodes',
    ),
    'page callback' => 'panels_node_settings',
    'type' => MENU_LOCAL_TASK,
  );

  // Avoid some repetition on these:
  $base = array(
    'access callback' => 'panels_node_edit_node',
    'access arguments' => array(
      1,
    ),
    'page arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%node/panel_layout'] = array(
    'title' => 'Panel layout',
    'page callback' => 'panels_node_edit_layout',
    'weight' => 2,
  ) + $base;
  $items['node/%node/panel_content'] = array(
    'title' => 'Panel content',
    'page callback' => 'panels_node_edit_content',
    'weight' => 3,
  ) + $base;
  $items['node/add/panel/choose-layout'] = array(
    'title' => 'Choose layout',
    'access arguments' => array(
      'create panel-nodes',
    ),
    'page callback' => 'panels_node_add',
    'type' => MENU_CALLBACK,
  );
  return $items;
}