You are here

function views_handler_filter_selective::get_value_options in Views Hacks 6

File

views_filters_selective/views_handler_filter_selective.inc, line 6

Class

views_handler_filter_selective

Code

function get_value_options() {
  $this->value_options = array(
    0 => t('Actual values will be available at run-time'),
  );
  if (empty($this->view->selective_all_results)) {

    // Load the original handler to have the class available.
    views_include_handler($this->definition['proxy'], array(), 'handler');
    $handler = _views_filters_selective_get_handler($this->definition['proxy']);
    $oids = $this
      ->get_all_results();
    $options = empty($oids) ? array() : call_user_func($handler, $this, $oids);
    sort($options);
    if (!empty($options)) {

      // Encode the values to keep special chars.
      $this->value_options = array_combine(array_map('urlencode', array_values($options)), array_values($options));
    }
  }
}