You are here

function og_menu_single_menu in OG Menu Single 7

Implements hook_menu().

File

./og_menu_single.module, line 251
Creates a single menu per organic group on a site.

Code

function og_menu_single_menu() {
  $items = array();
  $items['group/%/%/admin/menu'] = array(
    'title callback' => 'og_ui_menu_title_callback',
    'title arguments' => array(
      'Menu for group @group',
      1,
      2,
    ),
    'description' => 'Manage group menu for a group.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'og_menu_single_menu_edit_form',
      1,
      2,
    ),
    'access callback' => 'og_ui_user_access_group',
    'access arguments' => array(
      'manage menu',
      1,
      2,
    ),
    'weight' => -8,
    'file' => 'og_menu_single.admin.inc',
  );
  $items['group/%/%/admin/menu/list'] = array(
    'title' => 'List links',
    'weight' => -10,
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
  );
  $items['group/%/%/admin/menu/add'] = array(
    'title' => 'Add link',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'menu_edit_item',
      'add',
      NULL,
      menu_load(OG_MENU_SINGLE_MENU_NAME),
    ),
    'access callback' => 'og_ui_user_access_group',
    'access arguments' => array(
      'manage menu',
      1,
      2,
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'menu.admin.inc',
    'file path' => drupal_get_path('module', 'menu'),
  );
  $items['group/%/%/admin/menu/item/%menu_link/edit'] = array(
    'title' => 'Edit menu link',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'menu_edit_item',
      'edit',
      6,
      NULL,
    ),
    'access callback' => 'og_ui_user_access_group',
    'access arguments' => array(
      'manage menu',
      1,
      2,
    ),
    'file' => 'menu.admin.inc',
    'file path' => drupal_get_path('module', 'menu'),
  );
  $items['group/%/%/admin/menu/item/%menu_link/delete'] = array(
    'title' => 'Delete menu link',
    'page callback' => 'menu_item_delete_page',
    'page arguments' => array(
      6,
    ),
    'access callback' => 'og_ui_user_access_group',
    'access arguments' => array(
      'manage menu',
      1,
      2,
    ),
    'file' => 'menu.admin.inc',
    'file path' => drupal_get_path('module', 'menu'),
  );
  return $items;
}