You are here

function quickbar_configure_form in Quickbar 7.2

Same name and namespace in other branches
  1. 6 quickbar.admin.inc \quickbar_configure_form()
  2. 7 quickbar.admin.inc \quickbar_configure_form()

Page to configure a toolbar

Configures the settings for a toolbar.

Return value

A form setting the settings for a toolbar.

3 string references to 'quickbar_configure_form'
quickbar_extras_form_alter in modules/quickbar_extras/quickbar_extras.module
Implements hook_form_alter().
quickbar_help_form_alter in modules/quickbar_help/quickbar_help.module
Implements hook_form_alter().
_quickbar_configure_page in ./quickbar.admin.inc

File

./quickbar.admin.inc, line 252
Handles quickbar administration

Code

function quickbar_configure_form($form_state, $info) {
  $iconset_info = module_invoke_all('quickbar_iconset_info');
  $iconsets = array(
    '_none' => 'None',
  );
  foreach ($iconset_info as $iconset_id => $iconset_data) {
    $iconsets[$iconset_id] = $iconset_data['title'];
  }
  $settings = variable_get('quickbar_settings_' . arg(4), _quickbar_default_settings());
  $form = array(
    'settings' => array(
      '#type' => 'fieldset',
      '#title' => t('General Settings'),
      'iconset' => array(
        '#type' => 'select',
        '#title' => 'Iconset',
        '#description' => 'Choose the iconset for the toolbar.',
        '#default_value' => $settings['iconset'],
        '#options' => $iconsets,
      ),
      'sticky' => array(
        '#type' => 'checkbox',
        '#title' => 'Make the toolbar sticky at the top',
        '#description' => 'If checked, the toolbar will always be visible as the user scrolls down the page.',
        '#default_value' => $settings['sticky'],
      ),
      'float' => array(
        '#type' => 'checkbox',
        '#title' => "Make the toolbar 'float' over page",
        '#description' => 'If checked, the toolbar will overlay the top portion of the webpage.',
        '#default_value' => $settings['float'],
        '#states' => array(
          'visible' => array(
            ':input#edit-settings-sticky' => array(
              'checked' => FALSE,
            ),
          ),
        ),
      ),
      'secondary_menu_visibility' => array(
        '#type' => 'checkbox',
        '#title' => 'Keep secondary menu open',
        '#description' => 'If checked, the secondary menu will display on page load for relevant pages instead of being collapsed.',
        '#default_value' => $settings['secondary_menu_visibility'],
      ),
      'nofollow' => array(
        '#title' => 'Do not follow top-level links',
        '#description' => 'If checked, top-level links of toolbar will only open secondary menus.',
        '#type' => 'checkbox',
        '#default_value' => $settings['nofollow'],
      ),
      'expanded_items' => array(
        '#type' => 'fieldset',
        '#title' => t('Expanded Items'),
        '#collapsible' => 1,
        '#collapsed' => 0,
        'expand_node_add' => array(
          '#title' => 'Expand node add',
          '#description' => 'To show add content type links.',
          '#type' => 'checkbox',
          '#default_value' => !empty($settings['expanded_items']['expand_node_add']) ? 1 : 0,
        ),
        'expand_structure_menu' => array(
          '#title' => 'Expand structure menu links',
          '#description' => 'To show structure menu links.',
          '#type' => 'checkbox',
          '#default_value' => !empty($settings['expanded_items']['expand_structure_menu']) ? 1 : 0,
        ),
      ),
    ),
    'submit' => array(
      '#type' => 'submit',
      '#value' => t('Save configuration'),
    ),
    '#tree' => TRUE,
  );
  return $form;
}