You are here

function acquia_purge_rules_action_info_alter in Acquia Purge 7

Implements hook_rules_action_info_alter().

File

./acquia_purge.rules.inc, line 33
Rules integration that provides a purge action as rule action.

Code

function acquia_purge_rules_action_info_alter(&$actions) {
  $action = 'expire_rules_action_flush_url';
  if (!isset($actions[$action])) {
    return;
  }

  // Rename and overload Expire's "Clear URL(s) from the page cache." rule
  // action into "Clear pages on Acquia Cloud.". With this reimplementation
  // the middle man gets cut out whilst retaining all functionality and it
  // improves the administrators experience drastically.
  $actions[$action]['label'] = t('Clear pages on Acquia Cloud.');
  $actions[$action]['base'] = '_acquia_purge_action_flush_url';
  $actions[$action]['module'] = 'acquia_purge';
  $actions[$action]['parameter']['urls']['description'] = t('A Drupal path or full absolute URL that refers to a page on your website. Paths need to be relative from the document root of your site, for instance "node/1" or "news" but not "news/*" as wildcards are not supported. When providing tokens that generate absolute URLs it is important to understand that the domain names in URLs will be stripped out and not respected as Acquia Purge will use its own list of domains, which it uses to clear every path or URL it processes.');

  // Remove the original validation callback, which we will also take care of.
  unset($actions[$action]['callbacks']);
}