You are here

function role_theme_switcher_admin_settings in Role Theme Switcher 5.2

Same name and namespace in other branches
  1. 6 role_theme_switcher.module \role_theme_switcher_admin_settings()
  2. 7 role_theme_switcher.module \role_theme_switcher_admin_settings()

Implemntation 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 40

Code

function role_theme_switcher_admin_settings() {
  $roles = user_roles();

  // Get all enabled themes
  $themes = list_themes();
  $list = array_merge(array(
    t('Default'),
  ), array_keys($themes));
  foreach ($roles as $id => $role) {
    $role_name = str_replace(' ', '_', $role);
    $form[strtolower($role_name) . '_theme'] = array(
      '#type' => 'select',
      '#title' => ucfirst(strtolower($role)),
      '#options' => drupal_map_assoc($list),
      '#default_value' => variable_get(strtolower($role_name) . '_theme', ''),
    );
  }
  return system_settings_form($form);
}