You are here

class views_handler_filter_selective in Views Selective Filters 7

Views filter handler for selective values.

Hierarchy

Expanded class hierarchy of views_handler_filter_selective

1 string reference to 'views_handler_filter_selective'
views_filters_selective_views_data_alter in ./views_filters_selective.views.inc
Implements hook_views_data_alter().

File

./views_handler_filter_selective.inc, line 11
Views Filter Selective Handler Overrides.

View source
class views_handler_filter_selective extends views_handler_filter_in_operator {

  /**
   * The original filter value options, if it's an options list handler.
   *
   * @var array|false
   */
  protected $originalOptions;

  /**
   * Static results set.
   *
   * @var array
   */
  protected static $results;

  /**
   * {@inheritdoc}
   */
  public function set_default_options() {
    parent::set_default_options();

    // This filter should always be exposed!
    $this->options['exposed'] = TRUE;

    // Do not allow to reduce options, makes no sense.
    $this->options['expose']['reduce'] = FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function get_value_options() {
    $this->value_options = array();

    // If $this->view->selective_oids means that the handler is
    // being called inside the cloned view used to obtain
    // the selective values and thus this is to prevent infinite
    // recursive loop.
    if (empty($this->view->selective_oids) && !empty($this->view->inited)) {
      $oids = $this
        ->get_oids();
      $this->value_options = $oids;

      // TODO: Omit null values in result: they are improperly handled.
      // When constructing the query.
      $this->value_options = array_diff_key($this->value_options, array(
        "" => NULL,
      ));

      // Set a flag in the view so we know it is using selective filters.
      $this->view->using_selective = TRUE;
    }
    else {
      if (!empty($this->view->selective_oids)) {
        $this->value_options = array();
      }
      else {

        // This is a special case, if $this->value_options is not an array
        // then parent::value_form() will throw an exception, so,
        // in our custom override no form is generated when $this->value_options
        // is not an array. We only want this to happen in the administrative
        // interface.
        unset($this->value_options);
      }
    }
  }

  /**
   * {@inheritdoc}
   */
  public function value_form(&$form, &$form_state) {
    $this
      ->get_value_options();

    // If you call parent::value_form() and $this->value_options
    // is not an array, an exception is thrown.
    if (isset($this->value_options) && is_array($this->value_options)) {
      parent::value_form($form, $form_state);
    }

    // Avoid the 'illegal values' Form API error.
    $form['value']['#validated'] = TRUE;

    // Add behaviour for ajax block refresh.
    // Don't do this if the view is being executed
    // to obtain selective values.
    if (empty($this->view->selective_oids)) {
      $form['#attached']['js'][] = drupal_get_path('module', 'views_filters_selective') . '/js/attachBehaviours.js';
    }
  }

  /**
   * Tell if two base fields are compatible.
   */
  protected function baseFieldCompatible($base_field1, $base_field2) {

    // Extended condition see https://www.drupal.org/node/2295707
    return preg_match('/^' . $base_field1 . '/', $base_field2);
  }

  /**
   * {@inheritdoc}
   */
  public function options_form(&$form, &$form_state) {
    $base_field = $this->definition['field_base'];
    parent::options_form($form, $form_state);

    // Filter should always be exposed, show warning.
    array_unshift($form['expose_button'], array(
      'warning' => array(
        '#type' => 'markup',
        '#markup' => '<div class="messages warning">' . t('This filter is always exposed to users.') . '</div>',
      ),
    ));

    // Remove option to unexpose filter. Tried to disable, but did not work.
    $form['expose_button']['checkbox']['checkbox']['#type'] = 'hidden';
    unset($form['expose_button']['button']);
    unset($form['expose_button']['markup']);

    // Do not allow to check "all values".
    $form['value']['#attributes']['disabled'] = 'disabled';

    // Cannot group without values.
    unset($form['group_button']);

    // Preload handlers, sorts and filters.
    // This gest cached all along.
    $this->view->display_handler
      ->get_handlers('field');
    $this->view->display_handler
      ->get_handlers('sort');
    $this->view->display_handler
      ->get_handlers('filter');

    // Add combo to pick display field for filter.
    $options = array();
    foreach ($this->view->display_handler->handlers['field'] as $key => $handler) {
      if ($this
        ->baseFieldCompatible($base_field, $handler->field)) {
        $options[$handler->options['id']] = $handler->definition['group'] . ': ' . $handler->definition['title'] . '(' . $handler
          ->label() . ')';
      }
    }
    $form['selective_display_field'] = array(
      '#title' => t('Display field'),
      '#type' => 'select',
      '#description' => t('Field to be used for the selective options.'),
      '#options' => $options,
      '#default_value' => $this->options['selective_display_field'],
    );

    // Add combo to pick sort for display.
    $options = array();
    $options['NONE'] = t('No sorting');

    // Add option for custom sortings.
    if ($this
      ->getOriginalOptions()) {
      $options['ORIG'] = t('As the original filter');
    }
    $options['KASC'] = t('Custom key ascending (ksort)');
    $options['KDESC'] = t('Custom key descending (ksort reverse)');
    $options['ASC'] = t('Custom ascending (asort)');
    $options['DESC'] = t('Custom descending (asort reverse)');

    // TODO: Allow the use of view's sorts!

    //foreach ($this->view->display_handler->handlers['sort'] as $key => $handler) {

    //  $options[$handler->options['id']] = $handler->definition['group'] . ': ' . $handler->definition['title'];

    //}
    $form['selective_display_sort'] = array(
      '#title' => t('Sort field'),
      '#type' => 'select',
      '#description' => t('Choose wich field to use for display'),
      '#options' => $options,
      '#default_value' => $this->options['selective_display_sort'],
    );
    $form['selective_items_limit'] = array(
      '#title' => t('Limit number of select items'),
      '#type' => 'textfield',
      '#description' => t("Don't allow a badly configured selective filter to return thousands of possible values. Enter a limit or remove any value for no limit. We recommend to set a limit no higher than 100."),
      '#default_value' => $this->options['selective_items_limit'],
      '#size' => 10,
      '#element_validate' => array(
        'element_validate_integer_positive',
      ),
    );
    $form['selective_options_ignore_exposed_data'] = array(
      '#title' => t('Always show default set of options, even after exposed filters have been applied'),
      '#type' => 'checkbox',
      '#description' => t("If you don't want the filter options to continue to be filtered as additional exposed filters are applied, check this box"),
      '#default_value' => $this->options['selective_options_ignore_exposed_data'],
    );
  }

  /**
   * {@inheritdoc}
   */
  public function expose_form(&$form, &$form_state) {
    parent::expose_form($form, $form_state);

    // Remove reduce resultset interface.
    unset($form['expose']['reduce']);

    // TODO: Populated somewhere through AJAX, I could not find it....
    // Provide default value for filter name.
    if (empty($form['expose']['identifier']['#default_value'])) {
      $form['expose']['identifier']['#default_value'] = $this->options['field'];
    }
    if (empty($form['expose']['label']['#default_value'])) {
      $form['expose']['label']['#default_value'] = $this->definition['title'];
    }
    if (empty($form['ui_name']['#default_value'])) {
      $form['ui_name']['#default_value'] = $this->definition['title'];
    }
  }

  /**
   * {@inheritdoc}
   */
  public function query() {

    // If this view was constructed to obtain the selective values for this
    // handler, the handler should not add any constraints itself.
    if (isset($this->view->selective_handler_signature) && $this
      ->getSignature() == $this->view->selective_handler_signature) {
      return;
    }

    // Decode the values to restore special chars.
    if (is_array($this->value)) {
      $this->value = array_map('urldecode', $this->value);
    }
    elseif (is_string($this->value)) {
      $this->value = urldecode($this->value);
    }
    parent::query();
  }

  /**
   * {@inheritdoc}
   */
  public function option_definition() {
    $options = parent::option_definition();

    // Storage for field used to display values.
    $options['selective_display_field']['default'] = '';

    // Storage for sort used to sort display values.
    $options['selective_display_sort']['default'] = 'ASC';

    // Storage for aggregated fields.
    $options['selective_aggregated_fields']['default'] = '';

    // Limit aggregated items to prevent a huge number of options in select.
    $options['selective_items_limit']['default'] = 100;

    // Toggle to not continue to filter options after exposed filters are
    // applied.
    $options['selective_options_ignore_exposed_data']['default'] = 0;
    return $options;
  }

  /**
   * Get a signature for current filter handler.
   */
  protected function getSignature() {
    $signature = md5(serialize(array(
      'name' => $this->view->name,
      'args' => $this->view->args,
      'input' => $this->view->exposed_input,
      'base_field' => $this->definition['field_base'],
      'real_field' => $this->real_field,
      'field' => $this->field,
      'table' => $this->table,
      'ui_name' => $this->options['ui_name'],
    )));
    return $signature;
  }

  /**
   * Get list of options for current view, only at runtime.
   */
  protected function get_oids() {

    // Parameters that we will be using during the process.
    $base_field = $this->definition['field_base'];
    $ui_name = $this->options['ui_name'];
    $signature = $this
      ->getSignature();

    // Prevent same filters from being recalculated.
    if (empty(self::$results[$signature])) {

      // We don't want a badly configured selective filter
      // to return thousands of possible values.
      $max_items = (int) $this->options['selective_items_limit'];

      // Clone the view (so it works while editting) and get all results.
      $view_copy = $this->view
        ->clone_view();
      if (!$view_copy) {
        return NULL;
      }

      // Store a flag so that we can know from other places
      // that this view is being used to obtain selective data.
      $view_copy->selective_oids = TRUE;

      // Store information about what filter is this view being used for.
      $view_copy->selective_handler_signature = $signature;

      // If this filter is configured to *not* continue to filter the options
      // list as new exposed values are applied, make sure to explicitly set any
      // exposed input values to null and remove contextual filters (args).
      if (isset($this->options['selective_options_ignore_exposed_data']) && $this->options['selective_options_ignore_exposed_data'] === 1) {
        if (!empty($this->view->exposed_input) && is_array($this->view->exposed_input)) {
          $new_exposed_input = array();
          foreach ($this->view->exposed_input as $key => $val) {
            $new_exposed_input[$key] = NULL;
          }
          $view_copy
            ->set_exposed_input($new_exposed_input);
        }
      }
      else {
        $view_copy
          ->set_exposed_input($this->view->exposed_input);
      }

      // Transfer contextual information to cloned view.
      $view_copy
        ->set_arguments($this->view->args);

      // Mess up with the field used for distinct have thousands of elements.
      // Limit result set to 100: anything above is not user friendly at all.
      $view_copy
        ->set_items_per_page($max_items);

      // Remove paging, and page number from context.
      if (isset($_GET['items_per_page'])) {
        $items_per_page = $_GET['items_per_page'];
        unset($_GET['items_per_page']);
      }
      if (isset($_GET['page'])) {
        $exposed_page = $_GET['page'];
        unset($_GET['page']);
      }

      // Manipulate display + default: don't know if fields are overriden.
      $display = $view_copy->display[$this->view->current_display];
      $display_default = $view_copy->display['default'];

      // Initialize the current display handler.
      $display->handler = views_get_plugin('display', $view_copy->display[$this->view->current_display]->display_plugin);
      $display_default->handler =& $display->handler;

      // Remove any exposed form configuration. This showed up with BEF module!
      unset($display->display_options['exposed_form']);
      unset($display_default->display_options['exposed_form']);

      // Also disable attachments.
      $display->handler->definition['accept attachments'] = FALSE;
      $display_default->handler->definition['accept attachments'] = FALSE;

      // If we are using fields from default or current display.
      if (isset($display->display_options['fields'])) {
        $display_options_fields =& $display->display_options['fields'];
      }
      else {
        $display_options_fields =& $display_default->display_options['fields'];
      }

      // Original implementation based field matching on ui_name matches
      // so we need to preserve backwards compatibility.
      $field_to_keep = $this->options['selective_display_field'];
      if (empty($field_to_keep)) {
        foreach ($display_options_fields as $key => $value) {
          if (isset($value['ui_name']) && $value['ui_name'] == $ui_name) {
            $field_to_keep = $key;
            break;
          }
        }
      }

      // Remove all fields but the one used to display and aggregate.
      foreach ($display_options_fields as $key => $value) {
        if ($key != $field_to_keep) {
          unset($display_options_fields[$key]);
        }
        else {

          // If there is a group column on the field, remove it so
          // Field Collections will work.
          // https://www.drupal.org/node/2333065
          unset($display_options_fields[$key]['group_column']);
        }
      }

      // Check to see if the user remembered to add the field.
      if (empty($display_options_fields)) {
        drupal_set_message(t('Selective query filter must have corresponding field added to view with Administrative Name set to "@name" and Base Type "@type"', array(
          '@name' => $ui_name,
          '@type' => $base_field,
        )), 'error');
        return array();
      }

      // Get ID of field that will be used for rendering.
      $display_field = reset($display_options_fields);

      // Get field Id.
      $display_field_id = $display_field['id'];

      // Check that relationships are coherent between Field and Filter.
      $no_display_field_relationship = empty($display_field['relationship']) || $display_field['relationship'] === 'none';
      $no_filter_relationship = empty($this->options['relationship']) || $this->options['relationship'] === 'none';
      $equal = $no_display_field_relationship === TRUE && $no_filter_relationship === TRUE || $display_field['relationship'] === $this->options['relationship'];
      if (!$equal) {
        drupal_set_message(t('Selective filter "@name": relationship of field and filter must match.', array(
          '@name' => $ui_name,
          '@type' => $base_field,
        )), 'error');
        return array();
      }

      // If main field is excluded from presentation, bring it back.
      // Set group type for handler to populate database relationships in query.
      $display_field['exclude'] = 0;
      $display_field['group_type'] = 'group';

      // Remove all sorting: sorts must be added to aggregate fields.
      unset($display->display_options['sorts']);
      unset($display_default->display_options['sorts']);

      // Turn this into an aggregate query.
      $display->display_options['group_by'] = 1;
      $display->handler->options['group_by'] = 1;
      $display_default->display_options['group_by'] = 1;
      $display_default->handler->options['group_by'] = 1;

      // Aggregate is incompatible with distinct and pure distinct.
      // At least it does not make sense as it is implemented now.
      unset($display_default->display_options['query']['options']['distinct']);
      unset($display_default->display_options['query']['options']['pure_distinct']);
      unset($display->display_options['query']['options']['distinct']);
      unset($display->display_options['query']['options']['pure_distinct']);

      // Make sure we are not using a pager to prevent unnecessary count(*)
      // queries.
      $display->display_options['pager'] = unserialize('a:2:{s:4:"type";s:4:"none";s:7:"options";a:1:{s:6:"offset";s:1:"0";}}');
      $display_default->display_options['pager'] = unserialize('a:2:{s:4:"type";s:4:"none";s:7:"options";a:1:{s:6:"offset";s:1:"0";}}');

      // Some style plugins can affect the built query, make sure
      // we use a reliable field based style plugin.
      $display->display_options['style_plugin'] = 'default';
      $display->display_options['style_options'] = unserialize('a:4:{s:9:"row_class";s:0:"";s:17:"default_row_class";i:1;s:17:"row_class_special";i:1;s:11:"uses_fields";i:0;}');
      $display->display_options['row_plugin'] = 'fields';
      $display->display_options['row_options'] = unserialize('s:6:"fields";');

      // Run View.
      $view_copy
        ->execute($this->view->current_display);

      // Restore context parameters for real View.
      if (isset($items_per_page)) {
        $_GET['items_per_page'] = $items_per_page;
      }
      if (isset($exposed_page)) {
        $_GET['page'] = $exposed_page;
      }

      // Get Handler after execution.
      $display_field_handler = $view_copy->field[$display_field_id];

      // We show human-readable values when case.
      if (method_exists($display_field_handler, 'get_value_options')) {
        $display_field_handler
          ->get_value_options();
      }

      // Create array of objects for selector.
      $oids = array();
      $field_alias_original = isset($display_field_handler->aliases[$display_field_handler->real_field]) ? $display_field_handler->aliases[$display_field_handler->real_field] : $display_field_handler->table_alias . '_' . $display_field_handler->real_field;

      // views_plugin_query_default::add_field() truncates aliases to 60
      // characters.
      $field_alias = substr($field_alias_original, 0, 60);
      foreach ($view_copy->result as $index => $row) {

        // $key = $display_field_handler->get_value($row) should be more robust
        // but values are sometimes nested arrays, and we need scalar values
        // for the filters.
        $key = $display_field_handler
          ->get_value($row);
        if (!is_scalar($key)) {
          $key = $row->{$field_alias};
        }
        $value = strip_tags($view_copy
          ->render_field($display_field_id, $index));
        $oids[$key] = empty($value) ? t('Empty (@key)', array(
          '@key' => empty($key) ? json_encode($key) : $key,
        )) : $value;
      }

      // Sort values.
      $sort_option = $this->options['selective_display_sort'];
      switch ($sort_option) {
        case 'ASC':
          asort($oids);
          break;
        case 'DESC':
          arsort($oids);
          break;
        case 'KASC':
          ksort($oids);
          break;
        case 'KDESC':
          krsort($oids);
          break;
        case 'ORIG':
          $oids = self::filterOriginalOptions($this
            ->getOriginalOptions(), array_keys($oids));
          break;
        case 'NONE':
          break;
        default:
          asort($oids);
      }
      drupal_alter('views_filters_selective_sort', $oids, $this);

      // If limit exceeded this field is not good for being "selective".
      if (!empty($max_items) && count($oids) == $max_items) {
        drupal_set_message(t('Selective filter "@field" has limited the amount of total results. Please, review you query configuration.', array(
          '@field' => $ui_name,
        )), 'warning');
      }
      self::$results[$signature] = $oids;
      $view_copy
        ->destroy();
    }
    return self::$results[$signature];
  }

  /**
   * Filters a list of original options according to selected set.
   *
   * @param array $options
   *   The options list of the original filter.
   * @param array $set
   *   The narrowed set of results provided by the cloned view.
   *
   * @return array
   *   The original filter options list narrowed to the cloned query results.
   */
  protected static function filterOriginalOptions(array $options, array $set) {
    $filtered = array();
    foreach ($options as $key => $value) {

      // Handle grouped options.
      // @see hook_options_list().
      if (is_array($value)) {
        $nested = self::filterOriginalOptions($value, $set);
        if (!empty($nested)) {
          $filtered[$key] = $nested;
        }
        continue;
      }
      if (in_array($key, $set)) {
        $filtered[$key] = $value;
      }
    }
    return $filtered;
  }

  /**
   * Returns the original filter value options, if provides an options list.
   *
   * @return array|false
   *   The original filter option list, if available, or FALSE.
   */
  protected function getOriginalOptions() {
    if (!isset($this->originalOptions)) {
      $this->originalOptions = FALSE;
      $class = $this->definition['proxy'];
      $original_filter = new $class();
      if (is_callable(array(
        $original_filter,
        'get_value_options',
      ))) {
        $original_filter
          ->set_definition($this->definition);
        $options = $original_filter
          ->get_value_options();

        // We store only non-empty array.
        if (is_array($options) && !empty($options)) {
          $this->originalOptions = $options;
        }
        else {
          $this->originalOptions = array();
        }
      }
    }
    return $this->originalOptions;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
views_handler::$handler_type public property The type of the handler, for example filter/footer/field.
views_handler::$query public property Where the $query object will reside:. 1
views_handler::$real_field public property The actual field in the database table, maybe different on other kind of query plugins/special handlers.
views_handler::$relationship public property The relationship used for this field.
views_handler::$table_alias public property The alias of the table of this handler which is used in the query.
views_handler::$view public property The top object of a view. Overrides views_object::$view
views_handler::access public function Check whether current user has access to this handler. 10
views_handler::broken public function Determine if the handler is considered 'broken'. 6
views_handler::case_transform public function Transform a string by a certain method.
views_handler::ensure_my_table public function Ensure the main table for this handler is in the query. This is used a lot. 8
views_handler::exposed_submit public function Submit the exposed handler form.
views_handler::exposed_validate public function Validate the exposed handler form. 4
views_handler::expose_submit public function Perform any necessary changes to the form exposes prior to storage. There is no need for this function to actually store the data.
views_handler::extra_options public function Provide defaults for the handler.
views_handler::extra_options_form public function Provide a form for setting options. 1
views_handler::extra_options_submit public function Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.
views_handler::extra_options_validate public function Validate the options form.
views_handler::get_field public function Shortcut to get a handler's raw field value.
views_handler::get_join public function Get the join object that should be used for this handler.
views_handler::groupby_form public function Provide a form for aggregation settings. 1
views_handler::groupby_form_submit public function Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data. 1
views_handler::has_extra_options public function If a handler has 'extra options' it will get a little settings widget and another form called extra_options. 1
views_handler::is_exposed public function Determine if this item is 'exposed', meaning it provides form elements to let users modify the view.
views_handler::needs_style_plugin public function Determine if the argument needs a style plugin. 1
views_handler::placeholder public function Provides a unique placeholders for handlers.
views_handler::post_execute public function Run after the view is executed, before the result is cached. 1
views_handler::pre_query public function Run before the view is built. 1
views_handler::sanitize_value public function Sanitize the value for output.
views_handler::set_relationship public function Called just prior to query(), this lets a handler set up any relationship it needs.
views_handler::show_expose_form public function Shortcut to display the exposed options form.
views_handler::ui_name public function Return a string representing this handler's name in the UI. 9
views_handler::use_group_by public function Provides the handler some groupby. 2
views_handler_filter::$always_multiple public property Disable the possibility to force a single value. 6
views_handler_filter::$always_required public property Disable the possibility to allow a exposed input to be optional.
views_handler_filter::$group_info public property Contains the information of the selected item in a gruped filter.
views_handler_filter::$no_operator public property Disable the possibility to use operators. 2
views_handler_filter::$operator public property Contains the operator which is used on the query.
views_handler_filter::$value public property Contains the actual value of the field.
views_handler_filter::build_group_form public function Build the form to let users create the group of exposed filters.
views_handler_filter::build_group_options public function Provide default options for exposed filters.
views_handler_filter::build_group_submit public function Save new group items, re-enumerates and remove groups marked to delete.
views_handler_filter::build_group_validate public function Validate the build group options form. 1
views_handler_filter::can_build_group public function Determine if a filter can be converted into a group.
views_handler_filter::can_expose public function Determine if a filter can be exposed. Overrides views_handler::can_expose 5
views_handler_filter::can_group public function Can this filter be used in OR groups? 1
views_handler_filter::convert_exposed_input public function Transform the input from a grouped filter into a standard filter.
views_handler_filter::exposed_form public function Render our chunk of the exposed filter form when selecting. Overrides views_handler::exposed_form
views_handler_filter::exposed_info public function Tell the renderer about our exposed form. Overrides views_handler::exposed_info
views_handler_filter::exposed_translate public function Make some translations to a form item to make it more suitable to exposing.
views_handler_filter::expose_validate public function Validate the options form. Overrides views_handler::expose_validate
views_handler_filter::group_form public function Build a form with a group of operator | values to apply as a single filter.
views_handler_filter::group_multiple_exposed_input public function Options available for a grouped filter which uses checkboxes.
views_handler_filter::init public function Provide some extra help to get the operator/value easier to use. Overrides views_handler::init 2
views_handler_filter::is_a_group public function Returns TRUE if the exposed filter works like a grouped filter. Overrides views_handler::is_a_group
views_handler_filter::multiple_exposed_input public function Indicate whether users can select multiple group items. Overrides views_handler::multiple_exposed_input
views_handler_filter::operator_form public function Options form subform for setting the operator. 6
views_handler_filter::operator_submit public function Perform any necessary changes to the form values prior to storage.
views_handler_filter::operator_validate public function Validate the operator form.
views_handler_filter::options_submit public function Simple submit handler. Overrides views_handler::options_submit
views_handler_filter::options_validate public function Simple validate handler. Overrides views_handler::options_validate 1
views_handler_filter::prepare_filter_select_options public function Sanitizes the HTML select element's options.
views_handler_filter::show_build_group_button public function Shortcut to display the build_group/hide button.
views_handler_filter::show_build_group_form public function Shortcut to display the exposed options form.
views_handler_filter::show_expose_button public function Shortcut to display the expose/hide button. Overrides views_handler::show_expose_button
views_handler_filter::show_operator_form public function Shortcut to display the operator form.
views_handler_filter::show_value_form public function Shortcut to display the value form.
views_handler_filter::store_exposed_input public function Store the exposed input for processing later. Overrides views_handler::store_exposed_input
views_handler_filter::store_group_input public function If set to remember exposed input in the session, store it there.
views_handler_filter::value_validate public function Validate the options form. 3
views_handler_filter_in_operator::$value_form_type public property 1
views_handler_filter_in_operator::$value_options public property Stores all operations which are available on the form.
views_handler_filter_in_operator::accept_exposed_input public function Check to see if input from the exposed filters should change the behavior. Overrides views_handler_filter::accept_exposed_input 2
views_handler_filter_in_operator::admin_summary public function Display the filter on the administrative summary. Overrides views_handler_filter::admin_summary 2
views_handler_filter_in_operator::construct public function Views handlers use a special construct function. Overrides views_object::construct
views_handler_filter_in_operator::expose_options public function Provide default options for exposed filters. Overrides views_handler_filter::expose_options
views_handler_filter_in_operator::operators public function This kind of construct makes it relatively easy for a child class to add or remove functionality by overriding this function and adding/removing items from this array. 1
views_handler_filter_in_operator::operator_options public function Build strings from the operators() for 'select' options. Overrides views_handler_filter::operator_options 2
views_handler_filter_in_operator::operator_values public function
views_handler_filter_in_operator::op_empty public function
views_handler_filter_in_operator::op_simple public function
views_handler_filter_in_operator::reduce_value_options public function When using exposed filters, we may be required to reduce the set.
views_handler_filter_in_operator::validate public function Validates the handler against the complete View. Overrides views_handler::validate
views_handler_filter_in_operator::value_submit public function Perform any necessary changes to the form values prior to storage. Overrides views_handler_filter::value_submit 2
views_handler_filter_selective::$originalOptions protected property The original filter value options, if it's an options list handler.
views_handler_filter_selective::$results protected static property Static results set.
views_handler_filter_selective::baseFieldCompatible protected function Tell if two base fields are compatible.
views_handler_filter_selective::expose_form public function Options form subform for exposed filter options. Overrides views_handler_filter_in_operator::expose_form
views_handler_filter_selective::filterOriginalOptions protected static function Filters a list of original options according to selected set.
views_handler_filter_selective::getOriginalOptions protected function Returns the original filter value options, if provides an options list.
views_handler_filter_selective::getSignature protected function Get a signature for current filter handler.
views_handler_filter_selective::get_oids protected function Get list of options for current view, only at runtime.
views_handler_filter_selective::get_value_options public function Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values. Overrides views_handler_filter_in_operator::get_value_options
views_handler_filter_selective::options_form public function Provide the basic form which calls through to subforms. Overrides views_handler_filter::options_form
views_handler_filter_selective::option_definition public function Information about options for all kinds of purposes will be held here. Overrides views_handler_filter_in_operator::option_definition
views_handler_filter_selective::query public function Add this filter to the query. Overrides views_handler_filter_in_operator::query
views_handler_filter_selective::set_default_options public function Set default options. Overrides views_object::set_default_options
views_handler_filter_selective::value_form public function Options form subform for setting options. Overrides views_handler_filter_in_operator::value_form
views_object::$definition public property Handler's definition.
views_object::$options public property Except for displays, options for the object will be held here. 1
views_object::altered_option_definition function Collect this handler's option definition and alter them, ready for use.
views_object::destroy public function Destructor. 2
views_object::export_option public function 1
views_object::export_options public function
views_object::export_option_always public function Always exports the option, regardless of the default value.
views_object::options Deprecated public function Set default options on this object. 1
views_object::set_definition public function Let the handler know what its full definition is.
views_object::unpack_options public function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away.
views_object::unpack_translatable public function Unpack a single option definition.
views_object::unpack_translatables public function Unpacks each handler to store translatable texts.
views_object::_set_option_defaults public function