diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-01-31 15:49:26 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-01-31 15:49:26 +0000 |
commit | 05a708fb06137758cf7a15a623b4813af2fc005f (patch) | |
tree | 6ae6f50edbcb601329805cbbd7c22d11340327e3 /modules/book | |
parent | 4c9fc80fc48608982a731b03655b02e5ccdb6b17 (diff) | |
download | brdo-05a708fb06137758cf7a15a623b4813af2fc005f.tar.gz brdo-05a708fb06137758cf7a15a623b4813af2fc005f.tar.bz2 |
- Patch #112715 by chx, webchick, asimmonds, et al: fixing E_ALL notices. Thanks.
Diffstat (limited to 'modules/book')
-rw-r--r-- | modules/book/book.module | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/book/book.module b/modules/book/book.module index 8216d617a..d1913bc2e 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -445,7 +445,7 @@ function book_nodeapi(&$node, $op, $teaser, $page) { break; case 'update': if (isset($node->parent)) { - if ($node->revision) { + if (!empty($node->revision)) { db_query("INSERT INTO {book} (nid, vid, parent, weight) VALUES (%d, %d, %d, %d)", $node->nid, $node->vid, $node->parent, $node->weight); } else { @@ -507,7 +507,7 @@ function theme_book_navigation($node) { * This is a helper function for book_toc(). */ function book_toc_recurse($nid, $indent, $toc, $children, $exclude) { - if ($children[$nid]) { + if (!empty($children[$nid])) { foreach ($children[$nid] as $foo => $node) { if (!$exclude || $exclude != $node->nid) { $toc[$node->nid] = $indent .' '. $node->title; @@ -527,7 +527,7 @@ function book_toc($exclude = 0) { $children = array(); while ($node = db_fetch_object($result)) { - if (!$children[$node->parent]) { + if (empty($children[$node->parent])) { $children[$node->parent] = array(); } $children[$node->parent][] = $node; @@ -958,6 +958,7 @@ function book_admin($nid = 0) { */ function book_admin_overview() { $result = db_query(db_rewrite_sql('SELECT n.nid, n.title, b.weight FROM {node} n INNER JOIN {book} b ON n.vid = b.vid WHERE b.parent = 0 ORDER BY b.weight, n.title')); + $rows = array(); while ($book = db_fetch_object($result)) { $rows[] = array(l($book->title, "node/$book->nid"), l(t('outline'), "admin/content/book/$book->nid")); } |