class views_plugin_exposed_form_input_required

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  1. cis7 sites/all/modules/ulmus/views/plugins/views_plugin_exposed_form_input_required.inc views_plugin_exposed_form_input_required
  2. cle7 sites/all/modules/ulmus/views/plugins/views_plugin_exposed_form_input_required.inc views_plugin_exposed_form_input_required
  3. elmsmedia7 sites/all/modules/ulmus/views/plugins/views_plugin_exposed_form_input_required.inc views_plugin_exposed_form_input_required
  4. icor7 sites/all/modules/ulmus/views/plugins/views_plugin_exposed_form_input_required.inc views_plugin_exposed_form_input_required
  5. meedjum_blog7 sites/all/modules/ulmus/views/plugins/views_plugin_exposed_form_input_required.inc views_plugin_exposed_form_input_required
  6. mooc7 sites/all/modules/ulmus/views/plugins/views_plugin_exposed_form_input_required.inc views_plugin_exposed_form_input_required

Exposed form plugin that provides an exposed form with required input.

Hierarchy

Expanded class hierarchy of views_plugin_exposed_form_input_required

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
views_object::construct function Views handlers use a special construct function so that we can more easily construct them with variable arguments.
views_object::destroy function
views_object::export_option function
views_object::export_options function
views_object::export_option_always function Always exports the option, regardless of the default value.
views_object::options Deprecated function Set default options on this object. Called by the constructor in a complex chain to deal with backward compatibility.
views_object::set_default_options function Set default options. For backward compatibility, it sends the options array; this is a feature that will likely disappear at some point.
views_object::set_definition function Let the handler know what its full definition is.
views_object::unpack_options function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away.
views_object::unpack_translatable function Unpack a single option definition.
views_object::unpack_translatables function Unpacks each handler to store translatable texts.
views_object::_set_option_defaults function
views_plugin::additional_theme_functions function Provide a list of additional theme functions for the theme information page
views_plugin::options_validate function Validate the options form.
views_plugin::plugin_title function Return the human readable name of the display.
views_plugin::summary_title function Returns the summary of the settings in the display.
views_plugin::theme_functions function Provide a full list of possible theme templates used by this style.
views_plugin::validate function Validate that the plugin is correct and can be saved.
views_plugin_exposed_form::exposed_form_alter function
views_plugin_exposed_form::exposed_form_submit function This function is executed when exposed form is submited.
views_plugin_exposed_form::exposed_form_validate function
views_plugin_exposed_form::init function Initialize the plugin.
views_plugin_exposed_form::post_execute function
views_plugin_exposed_form::post_render function
views_plugin_exposed_form::pre_execute function
views_plugin_exposed_form::render_exposed_form function Render the exposed filter form.
views_plugin_exposed_form::reset_form function
views_plugin_exposed_form_input_required::exposed_filter_applied function
views_plugin_exposed_form_input_required::options_form function
views_plugin_exposed_form_input_required::options_submit function
views_plugin_exposed_form_input_required::option_definition function
views_plugin_exposed_form_input_required::pre_render function
views_plugin_exposed_form_input_required::query function

File

sites/all/modules/ulmus/views/plugins/views_plugin_exposed_form_input_required.inc, line 13
Definition of views_plugin_exposed_form_input_required.

View source
class views_plugin_exposed_form_input_required extends views_plugin_exposed_form {

  function option_definition() {
    $options = parent::option_definition();

    $options['text_input_required'] = array(
      'default' => 'Select any filter and click on Apply to see results',
      'translatable' => TRUE,
    );
    $options['text_input_required_format'] = array('default' => NULL);
    return $options;
  }

  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);

    $form['text_input_required'] = array(
      '#type' => 'text_format',
      '#title' => t('Text on demand'),
      '#description' => t('Text to display instead of results until the user selects and applies an exposed filter.'),
      '#default_value' => $this->options['text_input_required'],
      '#format' => isset($this->options['text_input_required_format']) ? $this->options['text_input_required_format'] : filter_default_format(),
      '#wysiwyg' => FALSE,
    );
  }

  function options_submit(&$form, &$form_state) {
    $form_state['values']['exposed_form_options']['text_input_required_format'] = $form_state['values']['exposed_form_options']['text_input_required']['format'];
    $form_state['values']['exposed_form_options']['text_input_required'] = $form_state['values']['exposed_form_options']['text_input_required']['value'];
    parent::options_submit($form, $form_state);
  }

  function exposed_filter_applied() {
    static $cache = NULL;
    if (!isset($cache)) {
      $view = $this->view;
      if (is_array($view->filter) && count($view->filter)) {
        foreach ($view->filter as $filter_id => $filter) {
          if ($filter->is_exposed()) {
            $identifier = $filter->options['expose']['identifier'];
            if (isset($view->exposed_input[$identifier])) {
              $cache = TRUE;
              return $cache;
            }
          }
        }
      }
      $cache = FALSE;
    }

    return $cache;
  }

  function pre_render($values) {
    if (!$this->exposed_filter_applied()) {
      $options = array(
        'id' => 'area',
        'table' => 'views',
        'field' => 'area',
        'label' => '',
        'relationship' => 'none',
        'group_type' => 'group',
        'content' => $this->options['text_input_required'],
        'format' => $this->options['text_input_required_format'],
      );
      $handler = views_get_handler('views', 'area', 'area');
      $handler->init($this->view, $options);
      $this->display->handler->handlers['empty'] = array(
        'area' => $handler,
      );
      $this->display->handler->set_option('empty', array('text' => $options));
    }
  }

  function query() {
    if (!$this->exposed_filter_applied()) {
      // We return with no query; this will force the empty text.
      $this->view->built = TRUE;
      $this->view->executed = TRUE;
      $this->view->result = array();
    }
    else {
      parent::query();
    }
  }

}

Related topics

1 string reference to 'views_plugin_exposed_form_input_required'
views_views_plugins in sites/all/modules/ulmus/views/includes/plugins.inc
Implements hook_views_plugins().
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.