You are here

function simpletest_example_form in Examples for Developers 7

Same name and namespace in other branches
  1. 6 simpletest_example/simpletest_example.module \simpletest_example_form()

Implements hook_form().

Form for the node type.

Related topics

File

simpletest_example/simpletest_example.module, line 77
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;
}