diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-02-05 19:29:31 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-02-05 19:29:31 +0000 |
commit | effd938585f804944c686171ba842ea03c9a96a3 (patch) | |
tree | 2f2b8de7aff0993beebe1dddcb69062c4099d62c | |
parent | bdd5fa186df4254792b79a0d2565e79876ef340f (diff) | |
download | brdo-effd938585f804944c686171ba842ea03c9a96a3.tar.gz brdo-effd938585f804944c686171ba842ea03c9a96a3.tar.bz2 |
#369460 by rszrama: Add 'No books' message to Book module when no books exist.
-rw-r--r-- | modules/book/book.admin.inc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc index f46e7c870..34967323f 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); } |