You are here

function workbench_moderation_moderate_callback in Workbench Moderation 7

Same name and namespace in other branches
  1. 7.3 workbench_moderation.module \workbench_moderation_moderate_callback()

Helper function to redirect after a state change submission.

Parameters

$node: The node being acted upon.

$state: The new moderation state requested.

1 string reference to 'workbench_moderation_moderate_callback'
workbench_moderation_menu in ./workbench_moderation.module
Implements hook_menu().

File

./workbench_moderation.module, line 1803
Content moderation for Workbench.

Code

function workbench_moderation_moderate_callback($node, $state) {
  if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], "{$node->nid}:{$node->vid}:{$state}")) {
    return MENU_ACCESS_DENIED;
  }
  workbench_moderation_moderate($node, $state);
  drupal_goto(isset($_GET['destination']) ? $_GET['destination'] : 'node/' . $node->nid . '/moderation');
}