You are here

public function FacetapiEmptyBehaviorText::settingsForm in Facet API 7.2

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

Overrides FacetapiEmptyBehavior::settingsForm().

Overrides FacetapiEmptyBehavior::settingsForm

File

plugins/facetapi/empty_behavior_text.inc, line 48
The empty_text empty behavior class.

Class

FacetapiEmptyBehaviorText
Empty behavior plugin that displays markup, usually just some text.

Code

public function settingsForm(&$form, &$form_state) {
  global $user;
  $format_id = $this->formatSet ? $this->settings['empty_text']['format'] : filter_default_format($user);
  $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' => 'text_format',
    '#access' => $format && filter_access($format, $user),
    '#title' => t('Empty text'),
    '#default_value' => $this->settings['empty_text']['value'],
    '#format' => $format_id,
    '#states' => array(
      'visible' => array(
        'select[name="empty_behavior"]' => array(
          'value' => 'text',
        ),
      ),
    ),
  );
}