You are here

function command_buttons_menu in Command Buttons 7

Implements hook_menu().

File

./command_buttons.module, line 12

Code

function command_buttons_menu() {
  $base = array(
    'access arguments' => array(
      'administer command buttons',
    ),
    'file' => 'command_buttons.admin.inc',
  );
  $items['admin/structure/command-buttons'] = array(
    'title' => 'Command Buttons',
    'description' => 'Manage command button types.',
    'page callback' => 'command_buttons_entities_page',
  ) + $base;
  $items['admin/structure/command-buttons/list'] = array(
    'title' => 'List',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  ) + $base;
  $items['admin/structure/command-buttons/manage/%command_buttons_type'] = array(
    'title callback' => 'command_buttons_entities_title',
    'title arguments' => array(
      4,
    ),
    'page callback' => 'command_buttons_entities_list_page',
    'page arguments' => array(
      4,
    ),
  ) + $base;
  $items['admin/structure/command-buttons/manage/%command_buttons_type/add'] = array(
    'title' => 'Add a command button',
    'page callback' => 'command_buttons_entities_add_page',
    'page arguments' => array(
      4,
    ),
    'type' => MENU_NORMAL_ITEM,
  ) + $base;
  $items['admin/structure/command-buttons/view/%command_buttons'] = array(
    'title callback' => 'command_buttons_entity_title',
    'title arguments' => array(
      4,
    ),
    'page callback' => 'command_buttons_view',
    'page arguments' => array(
      4,
    ),
    'access callback' => 'command_buttons_access',
    'access arguments' => array(
      'view',
      4,
    ),
  ) + $base;
  $items['admin/structure/command-buttons/view/%command_buttons/view'] = array(
    'title' => 'View',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'page callback' => 'command_buttons_view',
    'page arguments' => array(
      4,
    ),
    'access callback' => 'command_buttons_access',
    'access arguments' => array(
      'view',
      4,
    ),
    'weight' => -10,
  ) + $base;
  $items['admin/structure/command-buttons/view/%command_buttons/edit'] = array(
    'title' => 'Edit',
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
    'page callback' => 'command_buttons_entity_edit_page',
    'page arguments' => array(
      4,
    ),
    'access callback' => 'command_buttons_access',
    'access arguments' => array(
      'update',
      4,
    ),
    'weight' => -9,
  ) + $base;
  $items['admin/structure/command-buttons/view/%command_buttons/delete'] = array(
    'title' => 'Delete',
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'command_buttons_entity_delete_form',
      4,
    ),
    'access callback' => 'command_buttons_access',
    'access arguments' => array(
      'delete',
      4,
    ),
    'weight' => -8,
  ) + $base;
  if (module_exists('devel')) {
    $items['admin/structure/command-buttons/view/%command_buttons/devel'] = array(
      'title' => 'Devel',
      'page callback' => 'devel_load_object',
      'page arguments' => array(
        'command_button',
        4,
      ),
      'access arguments' => array(
        'access devel information',
      ),
      'type' => MENU_LOCAL_TASK,
      'weight' => 100,
      'file' => 'devel.pages.inc',
      'file path' => drupal_get_path('module', 'devel'),
    );
    $items['admin/structure/command-buttons/view/%command_buttons/devel/load'] = array(
      'title' => 'Load',
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items['admin/structure/command-buttons/view/%command_buttons/devel/render'] = array(
      'title' => 'Render',
      'page callback' => 'devel_render_object',
      // Normally this would be the name of the entity type, but slightly
      // modified in order to call the right function.
      'page arguments' => array(
        'command_buttons',
        4,
      ),
      'access arguments' => array(
        'access devel information',
      ),
      'file' => 'devel.pages.inc',
      'file path' => drupal_get_path('module', 'devel'),
      'type' => MENU_LOCAL_TASK,
      'weight' => 100,
    );
  }
  return $items;
}