1.12.x admin_bar.inc admin_bar_theme_settings()
1.10.x admin_bar.inc admin_bar_theme_settings()
1.11.x admin_bar.inc admin_bar_theme_settings()
1.7.x admin_bar.inc admin_bar_theme_settings()

Form builder function for module settings.

File

modules/admin_bar/admin_bar.inc, line 704
Menu builder functions for Administration bar.

Code

function admin_bar_theme_settings() {
  $config = config('admin_bar.settings');
  $form['#config'] = 'admin_bar.settings';
  $form['margin_top'] = array(
    '#type' => 'checkbox',
    '#title' => t('Adjust top margin'),
    '#default_value' => $config->get('margin_top'),
    '#description' => t('Shifts the entire site content down to make room for the administration bar. If disabled, absolute- or fixed-positioned page elements may be covered by the administration bar.'),
  );
  $form['position_fixed'] = array(
    '#type' => 'checkbox',
    '#title' => t('Keep bar at top of page'),
    '#default_value' => $config->get('position_fixed'),
    '#description' => t('Displays the administration bar always at the top of the browser viewport, even when scrolling the page.'),
  );

  $form['components'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Enabled components'),
    '#options' => array(
      'admin_bar.icon' => t('Icon menu'),
      'admin_bar.menu' => t('Management menu'),
      'admin_bar.search' => t('Search bar'),
      'admin_bar.users' => t('User counts'),
      'admin_bar.account' => t('Account links'),
    ),
    '#default_value' => $config->get('components'),
    '#description' => t('These features will be enabled/visible in the administration bar. Untick the boxes to disable/hide them.'),
  );

  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );

  $form['#submit'] = array('admin_bar_theme_settings_submit');
  return system_settings_form($form);
}