book_form
- Versions
- 4.6 – 5
book_form(&$node)
Implementation of hook_form().
Code
modules/book.module, line 202
<?php
function book_form(&$node) {
global $user;
$op = $_POST['op'];
$output = form_select(t('Parent'), 'parent', ($node->parent ? $node->parent : arg(4)), book_toc($node->nid), t('The parent that this page belongs in. Note that pages whose parent is <top-level> are regarded as independent, top-level books.'));
if (function_exists('taxonomy_node_form')) {
$output .= implode('', taxonomy_node_form('book', $node));
}
$output .= form_textarea(t('Body'), 'body', $node->body, 60, 20, '', NULL, TRUE);
$output .= filter_form('format', $node->format);
$output .= form_textarea(t('Log message'), 'log', $node->log, 60, 5, t('An explanation of the additions or updates being made to help other authors understand your motivations.'));
if (user_access('administer nodes')) {
$output .= form_weight(t('Weight'), 'weight', $node->weight, 15, t('Pages at a given level are ordered first by weight and then by title.'));
}
else {
// If a regular user updates a book page, we create a new revision
// authored by that user:
$output .= form_hidden('revision', 1);
}
return $output;
}
?>Login or register to post comments 