You are here

public function FacetapiEmptyBehaviorText::settingsForm in Facet API 6.3

Same name and namespace in other branches
  1. 7.2 plugins/facetapi/empty_behavior_text.inc \FacetapiEmptyBehaviorText::settingsForm()
  2. 7 plugins/facetapi/empty_behavior_text.inc \FacetapiEmptyBehaviorText::settingsForm()

Adds setting for the empty behavior.

Overrides FacetapiEmptyBehavior::settingsForm

File

plugins/facetapi/empty_behavior_text.inc, line 41
Empty behavior that returns text.

Class

FacetapiEmptyBehaviorText
Returns text.

Code

public function settingsForm(&$form, &$form_state) {
  global $user;
  $format_id = filter_resolve_format($this->formatSet ? $this->settings['empty_text_format'] : FILTER_FORMAT_DEFAULT);
  $format = filter_format_load($format_id);

  // NOTE: There is a core bug with form #states and the text_format #type.
  // @see http://drupal.org/node/997826
  $form['widget']['empty']['empty_text'] = array(
    '#type' => 'textarea',
    '#access' => $format && filter_access($format, $user),
    '#title' => t('Empty text'),
    '#default_value' => $this->settings['empty_text'],
  );
  $form['widget']['empty']['empty_text_format'] = filter_form($format_id);
}