function block_menu in Drupal 4
Same name and namespace in other branches
- 5 modules/block/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.module, line 63 - 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/block',
'title' => t('blocks'),
'access' => user_access('administer blocks'),
'callback' => 'block_admin_display',
);
$items[] = array(
'path' => 'admin/block/list',
'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items[] = array(
'path' => 'admin/block/configure',
'title' => t('configure block'),
'access' => user_access('administer blocks'),
'callback' => 'block_admin_configure',
'type' => MENU_CALLBACK,
);
$items[] = array(
'path' => 'admin/block/delete',
'title' => t('delete block'),
'access' => user_access('administer blocks'),
'callback' => 'block_box_delete',
'type' => MENU_CALLBACK,
);
$items[] = array(
'path' => 'admin/block/add',
'title' => t('add block'),
'access' => user_access('administer blocks'),
'callback' => 'block_box_add',
'type' => MENU_LOCAL_TASK,
);
foreach (list_themes() as $key => $theme) {
if ($theme->status) {
if ($key == variable_get('theme_default', 'bluemarine')) {
$items[] = array(
'path' => 'admin/block/list/' . $key,
'title' => t('%key settings', array(
'%key' => $key,
)),
'access' => user_access('administer blocks'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
}
else {
$items[] = array(
'path' => 'admin/block/list/' . $key,
'title' => t('%key settings', array(
'%key' => $key,
)),
'access' => user_access('administer blocks'),
'type' => MENU_LOCAL_TASK,
);
}
}
}
}
return $items;
}