function custom_block_menu

Implements hook_menu().

File

drupal/core/modules/block/custom_block/custom_block.module, line 33
Allows the creaation of custom blocks through the user interface.

Code

function custom_block_menu() {
  $items['admin/structure/custom-blocks'] = array(
    'title' => 'Custom block types',
    'description' => 'Manage custom block types.',
    'route_name' => 'custom_block_type_list',
  );
  $items['admin/structure/custom-blocks/add'] = array(
    'title' => 'Add custom block type',
    'page callback' => 'custom_block_type_add',
    'access arguments' => array(
      'administer blocks',
    ),
    'type' => MENU_LOCAL_ACTION,
    'weight' => 1,
    'file' => 'custom_block.admin.inc',
  );
  $items['admin/structure/custom-blocks/manage/%custom_block_type'] = array(
    'title' => 'Edit custom block type',
    'title callback' => 'entity_page_label',
    'title arguments' => array(
      4,
    ),
    'page callback' => 'custom_block_type_edit',
    'page arguments' => array(
      4,
    ),
    'access arguments' => array(
      'administer blocks',
    ),
    'file' => 'custom_block.admin.inc',
  );
  $items['admin/structure/custom-blocks/manage/%custom_block_type/edit'] = array(
    'title' => 'Edit',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/structure/custom-blocks/manage/%custom_block_type/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'custom_block_type_delete_form',
      4,
    ),
    'access arguments' => array(
      'administer blocks',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 10,
    'file' => 'custom_block.admin.inc',
  );
  $items['block/add'] = array(
    'title' => 'Add custom block',
    'route_name' => 'custom_block_add_page',
  );
  $items['block/add/%custom_block_type'] = array(
    'title callback' => 'entity_page_label',
    'title arguments' => array(
      2,
    ),
    'page callback' => 'custom_block_add',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'administer blocks',
    ),
    'description' => 'Add custom block',
    'file' => 'custom_block.pages.inc',
  );

  // There has to be a base-item in order for contextual links to work.
  $items['block/%custom_block'] = array(
    'title' => 'Edit',
    'page callback' => 'custom_block_edit',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'entity_page_access',
    'access arguments' => array(
      1,
      'update',
    ),
    'file' => 'custom_block.pages.inc',
  );
  $items['block/%custom_block/edit'] = array(
    'title' => 'Edit',
    'weight' => 0,
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
  );
  $items['block/%custom_block/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'custom_block_delete_form',
      1,
    ),
    'access callback' => 'entity_page_access',
    'access arguments' => array(
      1,
      'delete',
    ),
    'weight' => 1,
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
    'file' => 'custom_block.pages.inc',
  );
  return $items;
}