function workflow_extensions_extract_workflow_name in Workflow Extensions 6
Same name and namespace in other branches
- 7 workflow_extensions.module \workflow_extensions_extract_workflow_name()
1 call to workflow_extensions_extract_workflow_name()
- workflow_extensions_form_alter in ./
workflow_extensions.module - Implementation of hook_form_alter().
File
- ./
workflow_extensions.module, line 448 - UI-related improvements to the Workflow module and tokens for Rules.
Code
function workflow_extensions_extract_workflow_name($form) {
// Current and allowed next states for this user and node live in
// $form['workflow'][$workflow_name]['#options].
// At the time of writing, the workflow.module (6.x.1-4) contained a bug that
// resulted in the $workflow_name being passed as blank. Luckily we can work
// around this and also be compatible with later versions that don't have the
// bug.
if (isset($form['workflow'][''])) {
return '';
}
return isset($form['#wf']->name) ? $form['#wf']->name : $form['workflow']['#title'];
}