function block_menu in Drupal 5
Same name and namespace in other branches
- 4 modules/block.module \block_menu()
- 6 modules/block/block.module \block_menu()
- 7 modules/block/block.module \block_menu()
Implementation of hook_menu().
File
- modules/
block/ block.module, line 60 - Controls the boxes that are displayed around the main content.
Code
function block_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'admin/build/block',
'title' => t('Blocks'),
'access' => user_access('administer blocks'),
'description' => t('Configure what block content appears in your site\'s sidebars and other regions.'),
'callback' => 'drupal_get_form',
'callback arguments' => array(
'block_admin_display',
),
);
$items[] = array(
'path' => 'admin/build/block/list',
'title' => t('List'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items[] = array(
'path' => 'admin/build/block/configure',
'title' => t('Configure block'),
'access' => user_access('administer blocks'),
'callback' => 'drupal_get_form',
'callback arguments' => array(
'block_admin_configure',
),
'type' => MENU_CALLBACK,
);
$items[] = array(
'path' => 'admin/build/block/delete',
'title' => t('Delete block'),
'access' => user_access('administer blocks'),
'callback' => 'drupal_get_form',
'callback arguments' => array(
'block_box_delete',
),
'type' => MENU_CALLBACK,
);
$items[] = array(
'path' => 'admin/build/block/add',
'title' => t('Add block'),
'access' => user_access('administer blocks'),
'callback' => 'drupal_get_form',
'callback arguments' => array(
'block_box_form',
),
'type' => MENU_LOCAL_TASK,
);
$default = variable_get('theme_default', 'garland');
foreach (list_themes() as $key => $theme) {
$items[] = array(
'path' => 'admin/build/block/list/' . $key,
'title' => t('!key settings', array(
'!key' => $key,
)),
'callback' => 'drupal_get_form',
'callback arguments' => array(
'block_admin_display',
$key,
),
'access' => user_access('administer blocks'),
'type' => $key == $default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
'weight' => $key == $default ? -10 : 0,
);
}
}
return $items;
}