function styleguide_menu in Style Guide 7
Same name and namespace in other branches
- 6 styleguide.module \styleguide_menu()
Implements hook_menu().
File
- ./
styleguide.module, line 26
Code
function styleguide_menu() {
$default = variable_get('theme_default', 'bartik');
$items['admin/appearance/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/appearance/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,
'theme callback' => '_styleguide_page_theme',
'theme arguments' => array(
$theme->name,
),
);
}
return $items;
}