Commit effd9385 authored by webchick's avatar webchick
Browse files

#369460 by rszrama: Add 'No books' message to Book module when no books exist.

parent bdd5fa18
...@@ -11,10 +11,18 @@ ...@@ -11,10 +11,18 @@
*/ */
function book_admin_overview() { function book_admin_overview() {
$rows = array(); $rows = array();
$headers = array(t('Book'), t('Operations'));
// Add any recognized books to the table list.
foreach (book_get_books() as $book) { 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); return theme('table', $headers, $rows);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment