function views_content_cache_key::view_key_replace_arguments in Views content cache 7.3
Same name and namespace in other branches
- 6.2 plugins/base.inc \views_content_cache_key::view_key_replace_arguments()
Replaces values corresponding to argument values set dynamically.
2 calls to views_content_cache_key::view_key_replace_arguments()
- views_content_cache_key::view_key in plugins/
views_content_cache/ base.inc - An array of keys to check in this cache segment when viewing the view.
- views_content_cache_key_og::view_key in plugins/
views_content_cache/ og.inc - An array of keys to check in this cache segment when viewing the view.
File
- plugins/
views_content_cache/ base.inc, line 79 - Provides the base Views content cache plugin.
Class
- views_content_cache_key
- Base class for the views content cache plugins.
Code
function view_key_replace_arguments($values, &$handler) {
foreach ($values as $value) {
if (strpos($value, '__arg:') === 0) {
// Get the argument and make sure its actually on the view still.
$arg_id = drupal_substr($value, drupal_strlen('__arg:'));
if (isset($handler->view->argument[$arg_id]) && $handler->view->argument[$arg_id]->argument_validated) {
// Argument is there and ready to go!
$argument = clone $handler->view->argument[$arg_id];
$arg_value = $argument
->get_value();
// Might need to split this up.
if (!empty($argument->options['break_phrase'])) {
views_break_phrase($argument
->get_value(), $argument);
foreach ($argument->value as $new_val) {
$values[$new_val] = $new_val;
}
}
else {
$new_val = $argument
->get_value();
$values[$new_val] = $new_val;
}
}
// Always remove the dummy argument value.
unset($values[$value]);
}
}
return $values;
}