1 simpletest_example.module simpletest_example_form($node, $form_state)

Implements hook_form().

Form for the node type.

Related topics

File

modules/examples/simpletest_example/simpletest_example.module, line 64
Module file for simpletest_example

Code

function simpletest_example_form($node, $form_state) {
  $type = node_type_get_type($node);
  $form = array();
  if ($type->has_title) {
    $form['title'] = array(
      '#type' => 'textfield',
      '#title' => check_plain($type->title_label),
      '#required' => TRUE,
      '#default_value' => $node->title,
      '#maxlength' => 255,
      '#weight' => -5,
    );
  }
  return $form;
}