- Modified patch #8552 by Gerhard: added 'add child page' link to book pages you can edit.
parent
918d33f41f
commit
f67c046d40
|
|
@ -65,6 +65,9 @@ function book_link($type, $node = 0, $main = 0) {
|
||||||
|
|
||||||
if ($type == 'node' && $node->type == 'book') {
|
if ($type == 'node' && $node->type == 'book') {
|
||||||
if (!$main) {
|
if (!$main) {
|
||||||
|
if (book_access('create', $node)) {
|
||||||
|
$links[] = l(t('add child page'), "node/add/book/parent/$node->nid");
|
||||||
|
}
|
||||||
$links[] = l(t('printer-friendly version'), 'book/print/'. $node->nid, array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')));
|
$links[] = l(t('printer-friendly version'), 'book/print/'. $node->nid, array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -223,7 +226,8 @@ function book_form(&$node) {
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$op = $_POST['op'];
|
$op = $_POST['op'];
|
||||||
$output = form_select(t('Parent'), 'parent', $node->parent, 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.'));
|
|
||||||
|
$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')) {
|
if (function_exists('taxonomy_node_form')) {
|
||||||
$output .= implode('', taxonomy_node_form('book', $node));
|
$output .= implode('', taxonomy_node_form('book', $node));
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,9 @@ function book_link($type, $node = 0, $main = 0) {
|
||||||
|
|
||||||
if ($type == 'node' && $node->type == 'book') {
|
if ($type == 'node' && $node->type == 'book') {
|
||||||
if (!$main) {
|
if (!$main) {
|
||||||
|
if (book_access('create', $node)) {
|
||||||
|
$links[] = l(t('add child page'), "node/add/book/parent/$node->nid");
|
||||||
|
}
|
||||||
$links[] = l(t('printer-friendly version'), 'book/print/'. $node->nid, array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')));
|
$links[] = l(t('printer-friendly version'), 'book/print/'. $node->nid, array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -223,7 +226,8 @@ function book_form(&$node) {
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$op = $_POST['op'];
|
$op = $_POST['op'];
|
||||||
$output = form_select(t('Parent'), 'parent', $node->parent, 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.'));
|
|
||||||
|
$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')) {
|
if (function_exists('taxonomy_node_form')) {
|
||||||
$output .= implode('', taxonomy_node_form('book', $node));
|
$output .= implode('', taxonomy_node_form('book', $node));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue