You are here

function FacetapiAjaxWidgetCheckboxes::settingsForm in Ajax facets 7

Same name and namespace in other branches
  1. 7.3 plugins/facetapi/ajax_widget_checkboxes.inc \FacetapiAjaxWidgetCheckboxes::settingsForm()
  2. 7.2 plugins/facetapi/ajax_widget_checkboxes.inc \FacetapiAjaxWidgetCheckboxes::settingsForm()

Overrides FacetapiWidget::settingsForm().

File

plugins/facetapi/ajax_widget_checkboxes.inc, line 29
The facetapi_links and facetapi_checkbox_links widget plugin classes.

Class

FacetapiAjaxWidgetCheckboxes
Widget that renders facets as a list of clickable links.

Code

function settingsForm(&$form, &$form_state) {
  $form['widget']['widget_settings']['links'][$this->id]['index_id'] = array(
    '#type' => 'value',
    '#title' => t('Index id'),
    '#default_value' => $form['#facetapi']['facet']['map options']['index id'],
    '#description' => t('Limits the number of displayed facets via JavaScript.'),
    '#states' => array(
      'visible' => array(
        'select[name="widget"]' => array(
          'value' => $this->id,
        ),
      ),
    ),
  );
  $form['widget']['widget_settings']['links'][$this->id]['checkboxes_update_results'] = array(
    '#type' => 'checkbox',
    '#title' => t('Update results by ajax'),
    '#default_value' => !empty($this->settings->settings['checkboxes_update_results']),
    '#description' => t('If active, then search results will be updated by AJAX when facet was changed.
       If not active, then after than facet will be updated, user will see special popup with link for filter results.'),
    '#states' => array(
      'visible' => array(
        'select[name="widget"]' => array(
          'value' => $this->id,
        ),
      ),
    ),
  );
  $form['widget']['widget_settings']['links'][$this->id]['checkboxes_show_reset_link'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display reset link'),
    '#default_value' => !empty($this->settings->settings['checkboxes_show_reset_link']),
    '#description' => t('Display link for reset facet.'),
    '#states' => array(
      'visible' => array(
        'select[name="widget"]' => array(
          'value' => $this->id,
        ),
      ),
    ),
  );
  if ($this->facet['hierarchy callback']) {
    $form['widget']['widget_settings']['links'][$this->id]['show_expanded'] = array(
      '#type' => 'checkbox',
      '#title' => t('Expand hierarchy'),
      '#default_value' => !empty($this->settings->settings['show_expanded']),
      '#description' => t('Show the entire tree regardless of whether the parent items are active.'),
      '#states' => array(
        'visible' => array(
          'select[name="widget"]' => array(
            'value' => $this->id,
          ),
        ),
      ),
    );
  }
}