You are here

function workflow_edit_form in Workflow 5.2

Same name and namespace in other branches
  1. 5 workflow.module \workflow_edit_form()

Menu callback to edit a workflow's properties.

Parameters

$wid: The ID of the workflow.

Return value

HTML form.

2 string references to 'workflow_edit_form'
workflow_access_form_alter in ./workflow_access.module
Implementation of hook_form_alter().
workflow_menu in ./workflow.module
Implementation of hook_menu().

File

./workflow.module, line 1000

Code

function workflow_edit_form($wid) {
  $workflow = db_fetch_object(db_query('SELECT * FROM {workflows} WHERE wid = %d', $wid));
  $form['wid'] = array(
    '#type' => 'value',
    '#value' => $workflow->wid,
  );
  $form['basic'] = array(
    '#type' => 'fieldset',
    '#title' => t('Workflow information'),
  );
  $form['basic']['wf_name'] = array(
    '#type' => 'textfield',
    '#default_value' => check_plain(t($workflow->name)),
    '#title' => t('Workflow Name'),
    '#size' => '16',
    '#maxlength' => '254',
  );
  $form['tab'] = array(
    '#type' => 'fieldset',
    '#title' => t('Workflow tab permissions'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['tab']['tab_roles'] = array(
    '#type' => 'checkboxes',
    '#options' => workflow_get_roles(),
    '#default_value' => explode(',', $workflow->tab_roles),
    '#description' => t('Select any roles that should have access to the workflow tab on nodes that have a workflow.'),
  );
  $form['transitions'] = workflow_transition_grid_form($workflow->wid);
  $form['transitions']['#tree'] = TRUE;
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  $form['permissions'] = array(
    '#type' => 'fieldset',
    '#title' => t('Permissions Summary'),
  );
  $form['permissions']['summary'] = array(
    '#value' => workflow_permissions($workflow->wid),
  );
  return $form;
}