You are here

function workflow_show_form in Workflow 7

5 calls to workflow_show_form()
WorkflowDefaultWidget::formElement in includes/Field/WorkflowDefaultWidget.php
Implements hook_field_widget_form --> WidgetInterface::formElement().
workflowfield_field_formatter_view in workflow_field/workflowfield.formatter.inc
Implements hook_field_formatter_view().
workflow_node_view in ./workflow.node.inc
Implements hook_node_view().
workflow_tab_form in ./workflow.pages.inc
Form builder. Allow workflow state change and scheduling from workflow tab. N.B. This function is only used for Node API, not Field API.
_workflow_form_alter in ./workflow.node.inc
Used to Implement hook_form_alter(). Is now a subfunction of workflow_form_BASE_FORM_ID_alter(). This is more performant, since it is called only on form with correct BASE_FORM_ID.

File

./workflow.module, line 1048
Support workflows made up of arbitrary states.

Code

function workflow_show_form($sid, $workflow, $choices) {
  $count = count($choices);

  // The easiest case first: more then one option: always show form.
  if ($count > 1) {
    return TRUE;
  }

  // Only when in creation phase, one option is sufficient,
  // since the '(creation)' option is not included in $choices.
  if ($sid == $workflow
    ->getCreationSid()) {
    return TRUE;
  }
  return FALSE;
}