You are here

function revisioning_delete_archived_action in Revisioning 6.3

Same name and namespace in other branches
  1. 8 revisioning_triggers_actions.inc \revisioning_delete_archived_action()
  2. 7 revisioning_triggers_actions.inc \revisioning_delete_archived_action()

Implementation of delete archived action.

File

./revisioning_triggers_actions.inc, line 119
Triggers and actions supported by the revisioning module.

Code

function revisioning_delete_archived_action(&$node, $context = array()) {
  if (empty($node->revision_moderation)) {

    // return;
  }
  $num_archived = revisioning_get_number_of_archived_revisions($node);
  if ($num_archived > 0) {
    $type = node_get_types('name', $node->type);
    watchdog('revisioning', 'Executing deleting archived revisions action for @type %title', array(
      '@type' => $type,
      '%title' => $node->title,
    ), WATCHDOG_NOTICE, l(t('view'), "node/{$node->nid}"));
    if (revisioning_delete_archived_revisions($node)) {
      drupal_set_message(format_plural($num_archived, '@type %title: one archived revision deleted.', '@type %title: @count archived revisions deleted.', array(
        '@type' => $type,
        '%title' => $node->title,
      )));
    }
  }
}