function styleguide_menu in Style Guide 6
Same name and namespace in other branches
- 7 styleguide.module \styleguide_menu()
Implements hook_menu().
File
- ./
styleguide.module, line 6
Code
function styleguide_menu() {
$default = variable_get('theme_default', 'garland');
$items['admin/build/themes/styleguide'] = array(
'title' => 'Style guide',
'page callback' => 'styleguide_page',
'weight' => 40,
'access arguments' => array(
'view style guides',
),
'theme callback' => '_styleguide_page_theme',
'theme arguments' => array(
$default,
),
);
foreach (list_themes() as $theme) {
$is_default = $theme->name == $default;
$items['admin/build/themes/styleguide/' . $theme->name] = array(
'title' => $theme->info['name'],
'page callback' => 'styleguide_page',
'page arguments' => array(
$theme->name,
),
'type' => $is_default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
'access callback' => 'styleguide_access_check',
'access arguments' => array(
$theme,
),
'weight' => $is_default ? -10 : 0,
);
}
return $items;
}