function workflow_node_current_state in Workflow 5
Same name and namespace in other branches
- 8 workflow.module \workflow_node_current_state()
- 5.2 workflow.module \workflow_node_current_state()
- 6.2 workflow.module \workflow_node_current_state()
- 6 workflow.module \workflow_node_current_state()
- 7.2 workflow.module \workflow_node_current_state()
- 7 workflow.module \workflow_node_current_state()
Get the current state of a given node.
Parameters
object $node:
Return value
string state ID
5 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 
- Generate a forms API compliant workflow field.
- workflow_nodeapi in ./workflow.module 
- Implementation of hook_nodeapi(). Summary of nodeapi ops we can see (Drupal 4.7):
- workflow_tab_page in ./workflow.module 
File
- ./workflow.module, line 585 
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;
}