function styleswitcher_menu in Style Switcher 7.2
Same name and namespace in other branches
- 6.2 styleswitcher.module \styleswitcher_menu()
- 7 styleswitcher.module \styleswitcher_menu()
Implements hook_menu().
File
- ./
styleswitcher.module, line 150 - Module's hooks implementations and helper functions.
Code
function styleswitcher_menu() {
$items['admin/config/user-interface/styleswitcher'] = array(
'title' => 'Styleswitcher',
'description' => 'Configure Styleswitcher module.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'styleswitcher_admin',
),
'access arguments' => array(
'administer styleswitcher',
),
'file' => 'styleswitcher.admin.inc',
);
$items['admin/config/user-interface/styleswitcher/global'] = array(
'title' => 'Global settings',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -1,
);
foreach (list_themes() as $theme) {
$items['admin/config/user-interface/styleswitcher/settings/' . $theme->name] = array(
'title' => $theme->info['name'],
'description' => 'Configure theme-specific styles settings.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'styleswitcher_config_theme',
5,
),
'access callback' => '_styleswitcher_config_theme_access',
'access arguments' => array(
$theme,
),
'type' => MENU_LOCAL_TASK,
'file' => 'styleswitcher.admin.inc',
);
}
$items['admin/config/user-interface/styleswitcher/add'] = array(
'title' => 'Add style',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'styleswitcher_style_form',
),
'access arguments' => array(
'administer styleswitcher',
),
'type' => MENU_LOCAL_ACTION,
'file' => 'styleswitcher.admin.inc',
);
$items['admin/config/user-interface/styleswitcher/custom/%styleswitcher_style'] = array(
'title' => 'Edit',
'title callback' => 'styleswitcher_style_title',
'title arguments' => array(
5,
),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'styleswitcher_style_form',
5,
),
'load arguments' => array(
'',
'custom',
),
'access arguments' => array(
'administer styleswitcher',
),
'file' => 'styleswitcher.admin.inc',
);
$items['admin/config/user-interface/styleswitcher/custom/%styleswitcher_style/edit'] = array(
'title' => 'Edit',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/config/user-interface/styleswitcher/custom/%styleswitcher_style/delete'] = array(
'title' => 'Delete',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'styleswitcher_style_delete_form',
5,
),
'load arguments' => array(
'',
'custom',
),
'access arguments' => array(
'administer styleswitcher',
),
'file' => 'styleswitcher.admin.inc',
);
// The theme argument must be set for next routes to know what the page user
// came from and what theme was used there.
$items['styleswitcher/switch/%/%/%styleswitcher_style'] = array(
'title' => 'Styleswitcher',
'page callback' => 'styleswitcher_switch',
'page arguments' => array(
4,
),
'load arguments' => array(
2,
3,
),
'access callback' => 'drupal_theme_access',
'access arguments' => array(
2,
),
'type' => MENU_CALLBACK,
);
$items['styleswitcher/css/%'] = array(
'title' => 'Styleswitcher',
'page callback' => 'styleswitcher_css',
'page arguments' => array(
2,
),
'access callback' => 'drupal_theme_access',
'access arguments' => array(
2,
),
'type' => MENU_CALLBACK,
);
return $items;
}