You are here

function finder_fieldset_settings in Finder 7.2

Settings callback.

1 string reference to 'finder_fieldset_settings'
fieldset.inc in plugins/element_handler/fieldset.inc
The finder fieldset element handler plugin.

File

plugins/element_handler/fieldset.inc, line 24
The finder fieldset element handler plugin.

Code

function finder_fieldset_settings(&$data, $finder, $finder_element_id) {
  $items =& $data['items'];
  $element =& $finder->elements[$finder_element_id];
  unset($items['title_display']);
  $items['collapsible'] = array(
    '#group' => 'form',
    '#item' => array(
      '#title' => t('Collapse'),
      '#value' => $finder
        ->esetting($element, 'collapsible') ? $finder
        ->esetting($element, 'collapsed') ? t('Collapsed') : t('Collapsible') : t('No'),
    ),
    '#form' => array(
      'settings' => array(
        'collapsible' => array(
          '#type' => 'checkbox',
          '#title' => t('Collapsible'),
          '#default_value' => $finder
            ->esetting($element, 'collapsible'),
          '#description' => t('Indicates whether or not the fieldset can be collapsed with JavaScript.'),
        ),
        'collapsed' => array(
          '#type' => 'checkbox',
          '#title' => t('Collapsed'),
          '#default_value' => $finder
            ->esetting($element, 'collapsed'),
          '#description' => t('Indicates whether or not the fieldset is collapsed by default.'),
          '#states' => array(
            'visible' => array(
              ':input[name="settings[collapsible]"]' => array(
                'checked' => TRUE,
              ),
            ),
          ),
        ),
      ),
    ),
  );
}