瀏覽代碼

Fix issue #133 : nombre non lus dans titre onglet

+ Début fix issue #130 : en cliquant sur une catégorie ou un flux, on
repasse en mode de vue "normale" pour pouvoir lire les articles
Ce n'est qu'un début :)
Marien Fressinaud 12 年之前
父節點
當前提交
695af6e1fe
共有 2 個文件被更改,包括 14 次插入7 次删除
  1. 12 5
      app/controllers/indexController.php
  2. 2 2
      app/views/helpers/view/global_view.phtml

+ 12 - 5
app/controllers/indexController.php

@@ -21,6 +21,13 @@ 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 (' - ');
+		}
+
 		$entryDAO = new EntryDAO ();
 		$feedDAO = new FeedDAO ();
 		$catDAO = new CategoryDAO ();
@@ -104,22 +111,22 @@ class indexController extends ActionController {
 	 */
 	private function checkAndProcessType ($type) {
 		if ($type['type'] == 'all') {
-			View::prependTitle (Translate::t ('your_rss_feeds') . ' - ');
+			View::prependTitle (Translate::t ('your_rss_feeds'));
 			$this->view->get_c = $type['type'];
 			return false;
 		} elseif ($type['type'] == 'favoris') {
-			View::prependTitle (Translate::t ('your_favorites') . ' - ');
+			View::prependTitle (Translate::t ('your_favorites'));
 			$this->view->get_c = $type['type'];
 			return false;
 		} elseif ($type['type'] == 'public') {
-			View::prependTitle (Translate::t ('public') . ' - ');
+			View::prependTitle (Translate::t ('public'));
 			$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 () . ' - ');
+				View::prependTitle ($cat->name ());
 				$this->view->get_c = $type['id'];
 				return false;
 			} else {
@@ -129,7 +136,7 @@ class indexController extends ActionController {
 			$feedDAO = new FeedDAO ();
 			$feed = $feedDAO->searchById ($type['id']);
 			if ($feed) {
-				View::prependTitle ($feed->name () . ' - ');
+				View::prependTitle ($feed->name ());
 				$this->view->get_f = $type['id'];
 				$this->view->get_c = $feed->category ();
 				return false;

+ 2 - 2
app/views/helpers/view/global_view.phtml

@@ -9,7 +9,7 @@
 ?>
 	<div class="category">
 		<div class="cat_header">
-			<a href="<?php echo _url ('index', 'index', 'get', 'c_' . $cat->id ()); ?>">
+			<a href="<?php echo _url ('index', 'index', 'get', 'c_' . $cat->id (), 'output', 'normal'); ?>">
 			<?php echo $cat->name(); ?><?php echo $catNotRead > 0 ? ' (' . $catNotRead . ')' : ''; ?>
 			</a>
 		</div>
@@ -20,7 +20,7 @@
 			<li class="item">
 				<img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="" />
 
-				<a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>">
+				<a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id (), 'output', 'normal'); ?>">
 				<?php echo $not_read > 0 ? '<b>' : ''; ?>
 				<?php echo $feed->name(); ?>
 				<?php echo $not_read > 0 ? ' (' . $not_read . ')' : ''; ?>