You are here

function toolbar_visibility_settings in Toolbar Visibility 7

Form constructor for the settings

1 string reference to 'toolbar_visibility_settings'
toolbar_visibility_menu in ./toolbar_visibility.module
Implements hook_menu().

File

./toolbar_visibility.module, line 55
Give a way to remove the Drupal Toolbar on selected themes.

Code

function toolbar_visibility_settings() {
  $form = array();
  if (module_exists("overlay")) {
    drupal_set_message(t('To use this module, you must disable the Overlay Module. Go to the <a href="@modules_page_url">modules page</a> to disable it.', array(
      '@modules_page_url' => url('admin/modules'),
    )), 'warning');
  }
  else {

    // Get the themes list from variable if exist!
    $themes = variable_get('toolbar_visibility_theme', NULL);

    // Get the system themes list!
    $list_themes = list_themes();
    foreach ($list_themes as $list) {
      $all_themes[$list->name] = $list->name;
    }
    $form['toolbar_visibility_theme'] = array(
      '#type' => 'select',
      '#title' => t('Select theme(s) where you want to remove Toolbar'),
      '#multiple' => TRUE,
      '#options' => $all_themes,
      '#default_value' => variable_get('toolbar_visibility_theme', NULL),
    );
    return system_settings_form($form);
  }
}