You are here

function bootstrap_tour_settings_form in Bootstrap Tour 7

Allows to administer the basic settings for guided tours

Return value

type

File

./bootstrap_tour.admin.inc, line 492

Code

function bootstrap_tour_settings_form() {
  $options = array(
    0 => t('None'),
  );
  $tours = _bootstrap_tour_get_data();
  if (count($tours) > 0) {
    foreach ($tours as $tour) {
      $options[$tour->tour_id] = $tour->title;
    }
  }
  return array(
    'behaviour' => array(
      '#type' => 'fieldset',
      '#title' => t('Behaviour on user login'),
      '#collapsible' => true,
      '#collapsed' => true,
      'obligatory' => array(
        '#type' => 'select',
        '#title' => t('Obligatory guided tour'),
        '#options' => $options,
        '#default_value' => (int) variable_get('bootstrap_tour obligatory_tour', 0),
        '#description' => t('Please choose the tour that shall be obligatory for all users that log in and haven\'t seen that tour so far!'),
      ),
      'description' => array(
        '#type' => 'textarea',
        '#title' => t('Description'),
        '#default_value' => variable_get('bootstrap_tour obligatory_tour description', ''),
        '#description' => t('Short text that explains the user why this specific tour has been started automatically for him.'),
      ),
      'intrusive' => array(
        '#type' => 'radios',
        '#title' => t('Kind of behaviour?'),
        '#description' => t('Wether or not the guided tour shall be intrusively obgligatory or simply informatively.'),
        '#default_value' => (int) variable_get('bootstrap_tour obligatory_tour intrusive', false),
        '#options' => array(
          1 => t('Intrusive'),
          0 => t('Informative'),
        ),
      ),
    ),
    'additional classes' => array(
      '#type' => 'fieldset',
      '#title' => t('Additional classes'),
      '#collapsible' => true,
      '#collapsed' => true,
      'tour_additional_classes' => array(
        '#type' => 'textarea',
        '#title' => t('Additional classes for tour tooltips'),
        '#default_value' => variable_get('bootstrap_tour tour_additional_classes', ''),
        '#description' => t('A list of additional classes that shall be applied to tooltips of guided tours.'),
      ),
      'dialog_additional_classes' => array(
        '#type' => 'textarea',
        '#title' => t('Additional classes for dialogs'),
        '#default_value' => variable_get('bootstrap_tour dialog_additional_classes', ''),
        '#description' => t('A list of additional classes that shall be applied to dialogs.'),
      ),
      'button_additional_classes' => array(
        '#type' => 'textarea',
        '#title' => t('Additional classes for buttons in dialogs'),
        '#default_value' => variable_get('bootstrap_tour button_additional_classes', ''),
        '#description' => t('A list of additional classes that shall be applied to buttons in dialogs.'),
      ),
    ),
    'submit' => array(
      '#type' => 'submit',
      '#value' => t('save'),
    ),
  );
}