You are here

function views_plugin_style_fieldset::options_form in Views fieldset style plugin 7

Overrides views_plugin_style::options_form().

Overrides views_plugin_style_default::options_form

File

./views_plugin_style_fieldset.inc, line 33
Contains views_plugin_style_fieldset.

Class

views_plugin_style_fieldset
Defines a style plugin that renders the full view as fieldset.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['collapsible'] = array(
    '#title' => t('Collapsible fieldset'),
    '#type' => 'checkbox',
    '#description' => t('Check to make fieldset collapsible.'),
    '#default_value' => $this->options['collapsible'],
    '#weight' => -50,
  );
  $form['collapsed'] = array(
    '#title' => t('Collapsed by default'),
    '#type' => 'checkbox',
    '#description' => t('Check to show fieldset collapsed.'),
    '#default_value' => $this->options['collapsed'],
    '#weight' => -49,
  );
  $form['open_first'] = array(
    '#title' => t('Leave first fieldset open'),
    '#type' => 'checkbox',
    '#description' => t('Check to leave first fieldset open.'),
    '#default_value' => $this->options['open_first'],
    '#weight' => -48,
    '#states' => array(
      'invisible' => array(
        ':input[name="style_options[collapsed]"]' => array(
          'checked' => FALSE,
        ),
      ),
    ),
  );
  $options = array(
    '' => t('- None -'),
  );
  $field_labels = $this->display->handler
    ->get_field_labels(TRUE);
  $options += $field_labels;
  $form['title'] = array(
    '#type' => 'select',
    '#title' => t('Fieldset Title'),
    '#options' => $options,
    '#default_value' => $this->options['title'],
    '#description' => t('Choose the title of fieldset.'),
    '#weight' => -47,
  );
  $form['description'] = array(
    '#type' => 'select',
    '#title' => t('Fieldset Description'),
    '#options' => $options,
    '#default_value' => $this->options['description'],
    '#description' => t('Optional fieldset description.'),
    '#weight' => -46,
  );
}