summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/book.module8
-rw-r--r--modules/book/book.module8
2 files changed, 10 insertions, 6 deletions
diff --git a/modules/book.module b/modules/book.module
index 96274581e..b4ade10bd 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -361,7 +361,7 @@ function book_outline_submit($form_id, $form_values) {
*/
function book_location($node, $nodes = array()) {
$parent = db_fetch_object(db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.vid = b.vid WHERE n.nid = %d'), $node->parent));
- if ($parent->title) {
+ if (isset($parent->title)) {
$nodes = book_location($parent, $nodes);
$nodes[] = $parent;
}
@@ -499,6 +499,7 @@ function book_nodeapi(&$node, $op, $teaser, $page) {
*/
function theme_book_navigation($node) {
$output = '';
+ $links = '';
if ($node->nid) {
$tree = book_tree($node->nid);
@@ -575,8 +576,9 @@ function book_toc($exclude = 0) {
* This is a helper function for book_tree()
*/
function book_tree_recurse($nid, $depth, $children, $unfold = array()) {
+ $output = '';
if ($depth > 0) {
- if ($children[$nid]) {
+ if (isset($children[$nid])) {
foreach ($children[$nid] as $foo => $node) {
if (in_array($node->nid, $unfold)) {
if ($tree = book_tree_recurse($node->nid, $depth - 1, $children, $unfold)) {
@@ -612,7 +614,7 @@ function book_tree($parent = 0, $depth = 3, $unfold = array()) {
$result = db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.vid = b.vid WHERE n.status = 1 AND n.moderate = 0 ORDER BY b.weight, n.title'));
while ($node = db_fetch_object($result)) {
- $list = $children[$node->parent] ? $children[$node->parent] : array();
+ $list = isset($children[$node->parent]) ? $children[$node->parent] : array();
$list[] = $node;
$children[$node->parent] = $list;
}
diff --git a/modules/book/book.module b/modules/book/book.module
index 96274581e..b4ade10bd 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -361,7 +361,7 @@ function book_outline_submit($form_id, $form_values) {
*/
function book_location($node, $nodes = array()) {
$parent = db_fetch_object(db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.vid = b.vid WHERE n.nid = %d'), $node->parent));
- if ($parent->title) {
+ if (isset($parent->title)) {
$nodes = book_location($parent, $nodes);
$nodes[] = $parent;
}
@@ -499,6 +499,7 @@ function book_nodeapi(&$node, $op, $teaser, $page) {
*/
function theme_book_navigation($node) {
$output = '';
+ $links = '';
if ($node->nid) {
$tree = book_tree($node->nid);
@@ -575,8 +576,9 @@ function book_toc($exclude = 0) {
* This is a helper function for book_tree()
*/
function book_tree_recurse($nid, $depth, $children, $unfold = array()) {
+ $output = '';
if ($depth > 0) {
- if ($children[$nid]) {
+ if (isset($children[$nid])) {
foreach ($children[$nid] as $foo => $node) {
if (in_array($node->nid, $unfold)) {
if ($tree = book_tree_recurse($node->nid, $depth - 1, $children, $unfold)) {
@@ -612,7 +614,7 @@ function book_tree($parent = 0, $depth = 3, $unfold = array()) {
$result = db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.vid = b.vid WHERE n.status = 1 AND n.moderate = 0 ORDER BY b.weight, n.title'));
while ($node = db_fetch_object($result)) {
- $list = $children[$node->parent] ? $children[$node->parent] : array();
+ $list = isset($children[$node->parent]) ? $children[$node->parent] : array();
$list[] = $node;
$children[$node->parent] = $list;
}