You are here

function workbench_workflows_state_flow_entity_machine_type_alter in Workbench Moderation 7.2

Implements hook_state_flow_machine_type_alter().

File

modules/workbench_workflows/workbench_workflows.module, line 312
workbench_workflows.module

Code

function workbench_workflows_state_flow_entity_machine_type_alter(&$machine_type, $entity, $entity_type) {
  if ($entity_type == 'node') {
    module_load_include('inc', 'workbench_workflows', 'workbench_workflows.state_flow_entity');
    $workflow = workbench_workflows_select_workflow($entity);
    if (!empty($workflow->name)) {
      $machine_type = 'workbench_workflows__' . $workflow->name;
    }
    else {
      if (variable_get('workbench_workflows_default_to_ignore', FALSE)) {
        $machine_type = 'workbench_workflows_ignore';
      }
    }
  }
}