diff options
| author | 2013-09-13 21:56:45 +0200 | |
|---|---|---|
| committer | 2013-09-13 21:56:45 +0200 | |
| commit | 2e0441195b65316cbef40574d55c7f1b305b3615 (patch) | |
| tree | 66bc028f989ae1e17764f7493df738ea3b40082c /app/controllers/indexController.php | |
| parent | 31a6a13268023a2db5eba2445ee6c7db4a6d9623 (diff) | |
Title: Unread in category/feed vs. global
Distinguish in the title of the page between the number of unread
articles in the category/feed displayed vs. the total number of unread
articles.
Diffstat (limited to 'app/controllers/indexController.php')
| -rwxr-xr-x | app/controllers/indexController.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index 8cc3bb15a..493384c5b 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -29,10 +29,9 @@ class indexController extends ActionController { $nb_not_read = $this->view->nb_not_read; if($nb_not_read > 0) { - View::prependTitle (' (' . $nb_not_read . ') - '); - } else { - View::prependTitle (' - '); + View::appendTitle (' (' . $nb_not_read . ')'); } + View::prependTitle (' - '); $entryDAO = new EntryDAO (); $feedDAO = new FeedDAO (); @@ -132,7 +131,8 @@ class indexController extends ActionController { $catDAO = new CategoryDAO (); $cat = $catDAO->searchById ($type['id']); if ($cat) { - View::prependTitle ($cat->name ()); + $nbnr = $cat->nbNotRead (); + View::prependTitle ($cat->name () . ($nbnr > 0 ? ' (' . $nbnr . ')' : '')); $this->view->get_c = $type['id']; return false; } else { @@ -142,7 +142,8 @@ class indexController extends ActionController { $feedDAO = new FeedDAO (); $feed = $feedDAO->searchById ($type['id']); if ($feed) { - View::prependTitle ($feed->name ()); + $nbnr = $feed->nbNotRead (); + View::prependTitle ($feed->name () . ($nbnr > 0 ? ' (' . $nbnr . ')' : '')); $this->view->get_f = $type['id']; $this->view->get_c = $feed->category (); return false; |
