You are here

function workflow_select_given_state_action in Workflow 6.2

Same name and namespace in other branches
  1. 5.2 workflow.module \workflow_select_given_state_action()
  2. 6 workflow_actions/workflow_actions.module \workflow_select_given_state_action()

Implementation of a Drupal action. Move a node to a specified state.

File

workflow_actions/workflow_actions.module, line 108
Provide actions and triggers for workflows. Why it's own module? Some sites prefer rules, some prefer actions, all prefer a lower code footprint and better performance. Additional creadit to gcassie ( http://drupal.org/user/80260 ) for the…

Code

function workflow_select_given_state_action($node, $context) {
  $comment = t($context['workflow_comment'], array(
    '%title' => check_plain($node->title),
    '%state' => check_plain($context['state_name']),
  ));
  workflow_execute_transition($node, $context['target_sid'], $comment, $context['force']);
}