You are here

function workflow_edit_form in Workflow 5

Same name and namespace in other branches
  1. 5.2 workflow.module \workflow_edit_form()
2 string references to 'workflow_edit_form'
workflow_access_form_alter in ./workflow_access.module
Implementation of hook_form_alter().
workflow_edit_page in ./workflow.module
Menu callback to edit a workflow's properties.

File

./workflow.module, line 773

Code

function workflow_edit_form($wid) {
  $form = array();

  #$form['#theme'] = 'workflow_edit_form';
  $workflow = db_fetch_object(db_query("SELECT * FROM {workflows} WHERE wid = %d", $wid));
  $form['wid'] = array(
    '#type' => 'value',
    '#value' => $workflow->wid,
  );
  $form['wf_name'] = array(
    '#type' => 'textfield',
    '#default_value' => $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'),
  );
  return $form;
}