You are here

function workflow_node_current_state in Workflow 5.2

Same name and namespace in other branches
  1. 8 workflow.module \workflow_node_current_state()
  2. 5 workflow.module \workflow_node_current_state()
  3. 6.2 workflow.module \workflow_node_current_state()
  4. 6 workflow.module \workflow_node_current_state()
  5. 7.2 workflow.module \workflow_node_current_state()
  6. 7 workflow.module \workflow_node_current_state()

Get the current state of a given node.

Parameters

object $node:

Return value

string state ID

7 calls to workflow_node_current_state()
workflow_execute_transition in ./workflow.module
Execute a transition (change state of a node).
workflow_field_choices in ./workflow.module
Get the states one can move to for a given node.
workflow_form_alter in ./workflow.module
Modify the node form to add the workflow field.
workflow_ng_condition_workflow_transition_is in contrib/workflow_workflow_ng/workflow_workflow_ng.module
workflow_nodeapi in ./workflow.module
Implementation of hook_nodeapi().

... See full list

File

./workflow.module, line 794

Code

function workflow_node_current_state($node) {
  $sid = db_result(db_query('SELECT sid FROM {workflow_node} WHERE nid = %d', $node->nid));
  if (!$sid) {
    $wid = workflow_get_workflow_for_type($node->type);
    $sid = _workflow_creation_state($wid);
  }
  return $sid;
}