definition['cck_field']; $allowed_values = module_invoke($field['module'], 'allowed_values', $field); foreach ($allowed_values as $allowed_value => $nice_text) { $options[$allowed_value] = strtolower(str_replace(' ', '-', $nice_text)); } if (!empty($this->options['break_phrase'])) { $arguments = explode(',', $this->get_value()); } else { $arguments = array($this->get_value()); } // time to set the arguments to something new $new_arguments = array(); foreach ($arguments as $value) { $key = array_search($value, $options); if (!empty($key)) { $new_arguments[] = $key; } else { // TODO: do we need to do something here? } } foreach ($new_arguments as $facet_value) { $this->query->add_filter($this->real_field, apachesolr_views_query::escape_term($facet_value)); } } /** * Get the title this argument will assign the view, given the argument. */ function title() { $field = $this->definition['cck_field']; $allowed_values = module_invoke($field['module'], 'allowed_values', $field); foreach ($allowed_values as $allowed_value => $nice_text) { $valid_path = strtolower(str_replace(' ', '-', $nice_text)); if ($this->argument == $valid_path) { return check_plain($nice_text); } } return check_plain($this->argument); } }