You are here

function views_content_cache_key::additional_options_for_arguments in Views content cache 6.2

Same name and namespace in other branches
  1. 7.3 plugins/views_content_cache/base.inc \views_content_cache_key::additional_options_for_arguments()

Handy helper method that scans the given view looking for arguments.

2 calls to views_content_cache_key::additional_options_for_arguments()
views_content_cache_key_node::options_form in plugins/node.inc
Optionally provides a option form for the user to use this segment.
views_content_cache_key_og::options_form in plugins/og.inc
Optionally provides a option form for the user to use this segment.

File

plugins/base.inc, line 119

Class

views_content_cache_key
Base class for the views content cache plugins.

Code

function additional_options_for_arguments(&$view) {
  $options = array();
  $arguments = $view->display_handler
    ->get_handlers('argument');
  if (is_array($arguments)) {
    foreach ($arguments as $arg_id => $argument) {
      foreach ($this
        ->view_key_from_arguments() as $class) {
        if (is_a($argument, $class)) {

          // This argument can provide us with keys.
          $options['__arg:' . $arg_id] = t('Value from argument: %title', array(
            '%title' => $argument
              ->ui_name(),
          ));
        }
      }
    }
  }
  return $options;
}