diff options
Diffstat (limited to 'app/controllers/indexController.php')
| -rwxr-xr-x | app/controllers/indexController.php | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index 594d379fb..d1c615d6d 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -3,7 +3,7 @@ class indexController extends ActionController { private $get = false; private $nb_not_read = 0; - private $mode = 'all'; + private $mode = 'all'; //TODO: Is this used? public function indexAction () { $output = Request::param ('output'); @@ -11,16 +11,28 @@ class indexController extends ActionController { if ($output == 'rss') { $this->view->_useLayout (false); } else { + View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'actualize'))); + + if(!$output) { + $output = $this->view->conf->viewMode(); + Request::_param ('output', $output); + } + View::appendScript (Url::display ('/scripts/shortcut.js')); View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'main'))); - View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'actualize'))); View::appendScript (Url::display ('/scripts/endless_mode.js')); - if(!$output) { - Request::_param ('output', $this->view->conf->viewMode()); + if ($output == 'global') { + View::appendScript (Url::display ('/scripts/global_view.js')); } } + $nb_not_read = $this->view->nb_not_read; + if($nb_not_read > 0) { + View::appendTitle (' (' . $nb_not_read . ')'); + } + View::prependTitle (' - '); + $entryDAO = new EntryDAO (); $feedDAO = new FeedDAO (); $catDAO = new CategoryDAO (); @@ -28,6 +40,7 @@ class indexController extends ActionController { $this->view->cat_aside = $catDAO->listCategories (); $this->view->nb_favorites = $entryDAO->countFavorites (); $this->view->nb_total = $entryDAO->count (); + $this->view->currentName = ''; $this->view->get_c = ''; $this->view->get_f = ''; @@ -59,7 +72,7 @@ class indexController extends ActionController { $this->view->entryPaginator = $entries; } catch(EntriesGetterException $e) { - Log::record ($e->getMessage (), Log::NOTICE); + Minz_Log::record ($e->getMessage (), Minz_Log::NOTICE); Error::error ( 404, array ('error' => array (Translate::t ('page_not_found'))) @@ -104,22 +117,27 @@ class indexController extends ActionController { */ private function checkAndProcessType ($type) { if ($type['type'] == 'all') { - View::prependTitle (Translate::t ('your_rss_feeds') . ' - '); + $this->view->currentName = Translate::t ('your_rss_feeds'); + View::prependTitle ($this->view->currentName); $this->view->get_c = $type['type']; return false; } elseif ($type['type'] == 'favoris') { - View::prependTitle (Translate::t ('your_favorites') . ' - '); + $this->view->currentName = Translate::t ('your_favorites'); + View::prependTitle ($this->view->currentName); $this->view->get_c = $type['type']; return false; } elseif ($type['type'] == 'public') { - View::prependTitle (Translate::t ('public') . ' - '); + $this->view->currentName = Translate::t ('public'); + View::prependTitle ($this->view->currentName); $this->view->get_c = $type['type']; return false; } elseif ($type['type'] == 'c') { $catDAO = new CategoryDAO (); $cat = $catDAO->searchById ($type['id']); if ($cat) { - View::prependTitle ($cat->name () . ' - '); + $this->view->currentName = $cat->name (); + $nbnr = $cat->nbNotRead (); + View::prependTitle ($this->view->currentName . ($nbnr > 0 ? ' (' . $nbnr . ')' : '')); $this->view->get_c = $type['id']; return false; } else { @@ -129,7 +147,9 @@ class indexController extends ActionController { $feedDAO = new FeedDAO (); $feed = $feedDAO->searchById ($type['id']); if ($feed) { - View::prependTitle ($feed->name () . ' - '); + $this->view->currentName = $feed->name (); + $nbnr = $feed->nbNotRead (); + View::prependTitle ($this->view->currentName . ($nbnr > 0 ? ' (' . $nbnr . ')' : '')); $this->view->get_f = $type['id']; $this->view->get_c = $feed->category (); return false; |
