You are here

public function views_plugin_exposed_form::option_definition in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_exposed_form.inc \views_plugin_exposed_form::option_definition()

Information about options for all kinds of purposes will be held here.

@code 'option_name' => array(

  • 'default' => default value,
  • 'translatable' => (optional) TRUE/FALSE (wrap in t() on export if true),
  • 'contains' => (optional) array of items this contains, with its own defaults, etc. If contains is set, the default will be ignored and assumed to be array().
  • 'bool' => (optional) TRUE/FALSE Is the value a boolean value. This will change the export format to TRUE/FALSE instead of 1/0.
  • 'export' => (optional) FALSE or a callback for special export handling if necessary.
  • 'unpack_translatable' => (optional) callback for special handling for translating data within the option, if necessary.

),

Return value

array Returns the options of this handler/plugin.

Overrides views_object::option_definition

See also

views_object::export_option()

views_object::export_option_always()

views_object::unpack_translatable()

1 call to views_plugin_exposed_form::option_definition()
views_plugin_exposed_form_input_required::option_definition in plugins/views_plugin_exposed_form_input_required.inc
Information about options for all kinds of purposes will be held here.
1 method overrides views_plugin_exposed_form::option_definition()
views_plugin_exposed_form_input_required::option_definition in plugins/views_plugin_exposed_form_input_required.inc
Information about options for all kinds of purposes will be held here.

File

plugins/views_plugin_exposed_form.inc, line 43
Definition of views_plugin_exposed_form.

Class

views_plugin_exposed_form
The base plugin to handle exposed filter forms.

Code

public function option_definition() {
  $options = parent::option_definition();
  $options['submit_button'] = array(
    'default' => 'Apply',
    'translatable' => TRUE,
  );
  $options['reset_button'] = array(
    'default' => FALSE,
    'bool' => TRUE,
  );
  $options['reset_button_label'] = array(
    'default' => 'Reset',
    'translatable' => TRUE,
  );
  $options['exposed_sorts_label'] = array(
    'default' => 'Sort by',
    'translatable' => TRUE,
  );
  $options['expose_sort_order'] = array(
    'default' => TRUE,
    'bool' => TRUE,
  );
  $options['sort_asc_label'] = array(
    'default' => 'Asc',
    'translatable' => TRUE,
  );
  $options['sort_desc_label'] = array(
    'default' => 'Desc',
    'translatable' => TRUE,
  );
  $options['autosubmit'] = array(
    'default' => FALSE,
    'bool' => TRUE,
  );
  $options['autosubmit_hide'] = array(
    'default' => TRUE,
    'bool' => TRUE,
  );
  return $options;
}