function simpletest_example_form

Implements hook_form().

Form for the node type.

Related topics

File

simpletest_example/simpletest_example.module, line 77

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;
}