You are here

function cache_actions_action_clear_views_cache in Cache Actions 7

Same name and namespace in other branches
  1. 6.2 cache_actions.rules.inc \cache_actions_action_clear_views_cache()
  2. 6 cache_actions.rules.inc \cache_actions_action_clear_views_cache()
  3. 7.2 cache_actions.rules.inc \cache_actions_action_clear_views_cache()

This action clears the cache of a specific view.

Parameters

array $views the views to clear.:

2 string references to 'cache_actions_action_clear_views_cache'
cache_actions_rules_action_info in ./cache_actions.rules.inc
Implementation of hook_rules_action_info().
cache_actions_test_rules_defaults in cache_actions_test/cache_actions_test.rules_defaults.inc
Implementation of hook_rules_defaults(). Below are the rules needed for the testing.

File

./cache_actions.rules.inc, line 620
This file provides the rules integration for this module.

Code

function cache_actions_action_clear_views_cache($views) {
  if (module_exists('views')) {
    views_include_handlers();
    module_load_include('inc', 'views', 'plugins/views_plugin_cache');

    // Is this an array?
    if (is_array($views)) {
      foreach ($views as $view) {
        _cache_actions_clear_view($view);
      }
    }
    else {

      // Otherwise it's probably an old rule from 1.x, let's just handle that.
      _cache_actions_clear_view($views);
    }
  }
}