function simpletest_example_form
Same name in other branches
- 7.x-1.x simpletest_example/simpletest_example.module \simpletest_example_form()
Implementation of hook_form().
Related topics
File
-
simpletest_example/
simpletest_example.module, line 70
Code
function simpletest_example_form(&$node) {
$type = node_get_types('type', $node);
if ($type->has_title) {
$form['title'] = array(
'#type' => 'textfield',
'#title' => check_plain($type->title_label),
'#required' => TRUE,
'#default_value' => $node->title,
'#weight' => -5,
);
}
if ($type->has_body) {
$form['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count);
}
return $form;
}