simpletestauto_test_form

Definition

simpletestauto_test_form(&$node)
simpletestauto.inc, line 34

Code

<?php
function simpletestauto_test_form(&$node) {
  global $drupal_releases;
  
  // after the test is tested editing is disabled
  if ($node->test_status != SIMPLETESTAUTO_NOT_TESTED) {
    $disabled = true;
  }
  else {
    $disabled = false;
  }
  $form['#attributes'] = array("enctype" => "multipart/form-data");
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Title'),
    '#required' => TRUE,
    '#default_value' => $node->title,
    '#weight' => -5
  );
 $form['body_filter']['body'] = array(
    '#type' => 'textarea',
    '#description' => 'You can leave this empty or write some notes about your patch.',
    '#title' => t('Body'),
    '#default_value' => $node->body,
    '#required' => FALSE,
    '#disabled' => $disabled,
  );
  $form['body_filter']['filter'] = filter_form($node->format);

  $form['project'] = array(
    '#type' => 'hidden',
    '#title' => t('Project name'),
    '#description' => t('Which project is this patch for. If project is drupal core than write Drupal'),
    '#default_value' => 'Drupal',
    '#required' => TRUE,
    '#disabled' => $disabled,
  );
  $drupal_releases = array(
    'HEAD' => 'HEAD',
    'DRUPAL-5' => 'Drupal 5 dev',
    'DRUPAL-5-1' => 'Drupal 5.1',
  );
  $form['version'] = array(
    '#type' => 'textfield',
    '#title' => t('Version'),
    '#default_value' => (isset($node->version) ? $node->version : 'HEAD') ,
    '#required' => TRUE,
    '#disabled' => $disabled,
  );
  
  $form['patch_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Patch URL'),
    '#default_value' => $node->patch_url,
    '#description' => "Enter patch url here or upload patch.",
    '#disabled' => $disabled,    
  );
  if (!isset($node->patch_url)) {
  	$form['patch_file'] = array(
      '#type' => 'file',
      '#title' => t('File attachment'),
      '#size' => 40,
      '#description' => ($node->patch_file || $node->patch_file ? t('A file already exists, if you upload another file the current file will be replaced.') : t('Attach a patch.')),
    );
  }

  return $form;
}
?>