You are here

function cache_actions_rules_action_info in Cache Actions 6

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

Implementation of hook_rules_action_info().

File

./cache_actions.rules.inc, line 12
This file provides the rules integration for this module. @author Fabian Sörqvist <fabian.sorqvist@gmail.com>

Code

function cache_actions_rules_action_info() {

  // Actions that works for everyone
  $actions = array(
    'cache_actions_action_clear_cache' => array(
      'label' => t('Clear cache bins'),
      'arguments' => array(
        'tables' => array(
          'type' => 'string',
          'label' => t('Cache tables'),
          'description' => t('Specify which cache tables you want to clear here. Separate the tables with spaces. You can use * to clear all tables'),
        ),
      ),
      'module' => 'Cache Actions',
    ),
    'cache_actions_action_clear_css_js_cache' => array(
      'label' => t('Clear the css and js cache'),
      'module' => 'Cache Actions',
    ),
  );

  // If the views module is available, then we can clear the cache of individual views.
  if (module_exists('views')) {
    $actions['cache_actions_action_clear_views_cache'] = array(
      'label' => t('Clear the cache of a specific view.'),
      'arguments' => array(
        'view' => array(
          'type' => 'string',
          'label' => t('View'),
          'description' => t('Specify the view you want to clear.'),
        ),
      ),
      'module' => 'Cache Actions',
    );
  }

  // If the page manager module is available, then we can clear the cache of panel pages.
  if (module_exists('page_manager')) {
    $actions['cache_actions_action_clear_panels_page_cache'] = array(
      'label' => t('Clear the cache of a specific panel page.'),
      'arguments' => array(
        'panel' => array(
          'type' => 'number',
          'label' => t('Panel page'),
          'description' => t('Specify the panel page you want to clear.'),
        ),
      ),
      'module' => 'Cache Actions',
    );
  }

  // If the mini panels module is available, then we can clear the cache of mini panels.
  if (module_exists('panels_mini')) {
    $actions['cache_actions_action_clear_panels_mini_cache'] = array(
      'label' => t('Clear the cache of a specific mini panel.'),
      'arguments' => array(
        'panel' => array(
          'type' => 'number',
          'label' => t('Panel page'),
          'description' => t('Specify the mini panel you want to clear.'),
        ),
      ),
      'module' => 'Cache Actions',
    );
  }
  return $actions;
}