function role_theme_switcher_admin_settings in Role Theme Switcher 6
Same name and namespace in other branches
- 5.2 role_theme_switcher.module \role_theme_switcher_admin_settings()
- 7 role_theme_switcher.module \role_theme_switcher_admin_settings()
Implementation of hook_settings()
1 string reference to 'role_theme_switcher_admin_settings'
- role_theme_switcher_menu in ./
role_theme_switcher.module - Implementation of hook_menu()
File
- ./
role_theme_switcher.module, line 46
Code
function role_theme_switcher_admin_settings() {
$roles = user_roles();
// Get all themes
$themes = list_themes();
$themes_list = array_merge(array(
'Default',
), array_keys($themes));
foreach ($roles as $id => $role) {
$form['role_theme_switcher_' . $id . '_theme'] = array(
'#type' => 'select',
'#title' => ucfirst(strtolower($role)),
'#options' => drupal_map_assoc($themes_list),
'#default_value' => variable_get('role_theme_switcher_' . $id . '_theme', ''),
);
}
return system_settings_form($form);
}