function views_plugin_exposed_form::query

cis7 views_plugin_exposed_form.inc views_plugin_exposed_form::query()
cle7 views_plugin_exposed_form.inc views_plugin_exposed_form::query()
elmsmedia7 views_plugin_exposed_form.inc views_plugin_exposed_form::query()
icor7 views_plugin_exposed_form.inc views_plugin_exposed_form::query()
meedjum_blog7 views_plugin_exposed_form.inc views_plugin_exposed_form::query()
mooc7 views_plugin_exposed_form.inc views_plugin_exposed_form::query()

File

sites/all/modules/ulmus/views/plugins/views_plugin_exposed_form.inc, line 172
Definition of views_plugin_exposed_form.

Class

views_plugin_exposed_form
The base plugin to handle exposed filter forms.

Code

function query() {
  $view = $this->view;
  $exposed_data = isset($view->exposed_data) ? $view->exposed_data : array();
  $sort_by = isset($exposed_data['sort_by']) ? $exposed_data['sort_by'] : NULL;
  if (!empty($sort_by)) {
    // Make sure the original order of sorts is preserved
    // (e.g. a sticky sort is often first)
    if (isset($view->sort[$sort_by])) {
      $view->query->orderby = array();
      foreach ($view->sort as $key => $sort) {
        if (!$sort->is_exposed()) {
          $sort->query();
        }
        else if ($key == $sort_by) {
          if (isset($exposed_data['sort_order']) && in_array($exposed_data['sort_order'], array('ASC', 'DESC'))) {
            $sort->options['order'] = $exposed_data['sort_order'];
          }
          $sort->set_relationship();
          $sort->query();
        }
      }
    }
  }
}
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.