Skip to content

Commit

Permalink
Handle when $config['cops_recentbooks_limit'] is <= 0. fix #94
Browse files Browse the repository at this point in the history
  • Loading branch information
seblucas committed Sep 13, 2013
1 parent b255d30 commit bf0bb31
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions book.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,13 @@ public static function getCount() {
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;
}

Expand Down

0 comments on commit bf0bb31

Please sign in to comment.