You are here

function FacetapiAjaxWidgetSelect::settingsForm in Ajax facets 7

Same name and namespace in other branches
  1. 7.3 plugins/facetapi/ajax_widget_select.inc \FacetapiAjaxWidgetSelect::settingsForm()

Overrides FacetapiWidget::settingsForm().

File

plugins/facetapi/ajax_widget_select.inc, line 33
The facetapi_links and facetapi_checkbox_links widget plugin classes.

Class

FacetapiAjaxWidgetSelect
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]['selectbox_show_reset_link'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display reset link'),
    '#default_value' => !empty($this->settings->settings['selectbox_show_reset_link']),
    '#description' => t('Display link for reset facet.'),
    '#states' => array(
      'visible' => array(
        'select[name="widget"]' => array(
          'value' => $this->id,
        ),
      ),
    ),
  );
  $form['widget']['widget_settings']['links'][$this->id]['selectbox_update_results'] = array(
    '#type' => 'checkbox',
    '#title' => t('Update results by ajax'),
    '#default_value' => $this->settings->settings['selectbox_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,
        ),
      ),
    ),
  );
}