You are here

function casetracker_basic_case_form in Case Tracker 5

Same name and namespace in other branches
  1. 6 casetracker_basic.module \casetracker_basic_case_form()
  2. 7 casetracker_basic.module \casetracker_basic_case_form()

Implementation of hook_form().

File

./casetracker_basic.module, line 83
Enables a basic project node type for use with Case Tracker.

Code

function casetracker_basic_case_form(&$node) {
  $form = array();
  if (in_array($node->type, variable_get('casetracker_case_node_types', array(
    'casetracker_basic_case',
  )))) {
    $form['casetracker_case_detail'] = array(
      '#type' => 'fieldset',
      '#title' => t('Case details'),
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
    );
    $form['casetracker_case_detail']['title'] = array(
      '#type' => 'textfield',
      '#title' => t('Title'),
      '#required' => TRUE,
      '#default_value' => isset($node->title) ? $node->title : NULL,
    );
    $form['casetracker_case_detail']['body_filter']['body'] = array(
      '#type' => 'textarea',
      '#title' => t('Description'),
      '#default_value' => isset($node->body) ? $node->body : NULL,
      '#rows' => 20,
      '#required' => TRUE,
    );
    $form['casetracker_case_detail']['body_filter']['format'] = filter_form($node->format);
  }
  return $form;
}