You are here

function bigmenu_menu in Big Menu 6

Same name and namespace in other branches
  1. 7 bigmenu.module \bigmenu_menu()

Declare admin links and AJAX callbacks

hook_menu()

File

./bigmenu.module, line 31
alternative to core menu management

Code

function bigmenu_menu() {
  $items['admin/build/bigmenu-customize/%menu'] = array(
    'title' => 'Customize menu',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'bigmenu_overview_form',
      3,
    ),
    'title callback' => 'menu_overview_title',
    'title arguments' => array(
      3,
    ),
    'access arguments' => array(
      'administer menu',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'bigmenu.admin.inc',
  );

  // Edit just a part of a menu. Arg 5 is the parent menu link id
  $items['admin/build/bigmenu-customize/%menu/subform/%menu_link'] = array(
    'title' => 'Edit a slice of a menu',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'bigmenu_slice_form',
      3,
      5,
    ),
    'title callback' => 'bigmenu_parent_title',
    'title arguments' => array(
      5,
    ),
    'access arguments' => array(
      'administer menu',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'bigmenu.admin.inc',
  );

  // Same as above, but triggers an equivalent json response
  // This also expects arg 7,8 to be a form ID and form cache id
  $items['admin/build/bigmenu-customize/%menu/subform/%menu_link/js'] = array(
    'page callback' => 'bigmenu_slice_form_js',
    'page arguments' => array(
      3,
      5,
    ),
    'access arguments' => array(
      'administer menu',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'bigmenu.admin.inc',
  );
  $items['admin/build/bigmenu/alias_autocomplete'] = array(
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer menu',
    ),
    'page callback' => 'bigmenu_alias_autocomplete',
    'file' => 'bigmenu.admin.inc',
  );
  return $items;
}