summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngie Byron2009-02-05 19:29:31 (GMT)
committerAngie Byron2009-02-05 19:29:31 (GMT)
commiteffd938585f804944c686171ba842ea03c9a96a3 (patch)
tree2f2b8de7aff0993beebe1dddcb69062c4099d62c
parentbdd5fa186df4254792b79a0d2565e79876ef340f (diff)
#369460 by rszrama: Add 'No books' message to Book module when no books exist.
-rw-r--r--modules/book/book.admin.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc
index f46e7c8..3496732 100644
--- a/modules/book/book.admin.inc
+++ b/modules/book/book.admin.inc
@@ -11,10 +11,18 @@
*/
function book_admin_overview() {
$rows = array();
+
+ $headers = array(t('Book'), t('Operations'));
+
+ // Add any recognized books to the table list.
foreach (book_get_books() as $book) {
- $rows[] = array(l($book['title'], $book['href'], $book['options']), l(t('edit order and titles'), "admin/content/book/" . $book['nid']));
+ $rows[] = array(l($book['title'], $book['href'], $book['options']), l(t('edit order and titles'), 'admin/content/book/' . $book['nid']));
+ }
+
+ // If no books were found, let the user know.
+ if (empty($rows)) {
+ $rows[] = array(array('data' => t('No books available.'), 'colspan' => 2));
}
- $headers = array(t('Book'), t('Operations'));
return theme('table', $headers, $rows);
}