You are here

function coffee_admin_settings in Coffee 7.2

Form builder; Configure coffee settings.

See also

system_settings_form()

1 string reference to 'coffee_admin_settings'
coffee_menu in ./coffee.module
Implements hook_menu().

File

./coffee.admin.inc, line 14
Admin page callbacks for the coffee module.

Code

function coffee_admin_settings() {
  $form = array();
  $form['help'] = array(
    '#markup' => '<label>Toggle Coffee</label><p>Toggle Coffee using the keyboard shortcut alt + D (alt + shift + D in Opera, alt + ctrl + D in Windows Internet Explorer). You can also use use the alternative alt + k.</p>',
  );

  // Output the checkboxes to let admins select which menus are
  // featured in coffee.
  $menus = menu_get_menus();
  $menu_options = array();
  foreach ($menus as $name => $title) {
    $menu_options[$name] = check_plain($title);
  }
  if (!empty($menu_options)) {
    $form['coffee_settings_menus'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Menus to include in Coffee'),
      '#options' => $menu_options,
      '#default_value' => variable_get('coffee_settings_menus', array(
        'management',
        'user-menu',
      )),
      '#description' => 'Select the menus to include in Coffee, changes will be active after a cache clear.',
    );
  }
  $form['#submit'][0] = 'coffee_admin_settings_submit';
  return system_settings_form($form);
}