Handle when $config['cops_recentbooks_limit'] is <= 0. fix #94

This commit is contained in:
Sébastien Lucas 2013-09-13 09:54:19 +02:00
parent b255d306d0
commit bf0bb3170d
1 changed files with 7 additions and 5 deletions

View File

@ -462,11 +462,13 @@ class Book extends Base {
str_format (localize ("allbooks.alphabetical", $nBooks), $nBooks), "text",
array ( new LinkNavigation ("?page=".parent::PAGE_ALL_BOOKS)));
array_push ($result, $entry);
$entry = new Entry (localize ("recent.title"),
self::ALL_RECENT_BOOKS_ID,
str_format (localize ("recent.list"), $config['cops_recentbooks_limit']), "text",
array ( new LinkNavigation ("?page=".parent::PAGE_ALL_RECENT_BOOKS)));
array_push ($result, $entry);
if ($config['cops_recentbooks_limit'] > 0) {
$entry = new Entry (localize ("recent.title"),
self::ALL_RECENT_BOOKS_ID,
str_format (localize ("recent.list"), $config['cops_recentbooks_limit']), "text",
array ( new LinkNavigation ("?page=".parent::PAGE_ALL_RECENT_BOOKS)));
array_push ($result, $entry);
}
return $result;
}