From 46a5bdea25c0ae0624082dd08f3c41060e7fed86 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Wed, 8 Jan 2014 00:05:00 -0500 Subject: [PATCH] Ajout d'un filtre sur les articles lus Ajout d'un filtre sur les articles favoris --- app/Models/EntryDAO.php | 3 +++ app/i18n/en.php | 2 ++ app/i18n/fr.php | 2 ++ app/layout/nav_menu.phtml | 48 +++++++++++++++++++++++++++++++-------- 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 9070ae426..aaf4dcf6a 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -293,6 +293,9 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { case 'read': $where .= 'AND e1.is_read = 1 '; break; + case 'favorite': + $where .= 'AND e1.is_favorite = 1 '; + break; default: throw new FreshRSS_EntriesGetter_Exception ('Bad state in Entry->listByType: [' . $state . ']!'); } diff --git a/app/i18n/en.php b/app/i18n/en.php index 4588a054a..3717e0245 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -44,6 +44,8 @@ return array ( 'rss_view' => 'RSS feed', 'show_all_articles' => 'Show all articles', 'show_not_reads' => 'Show only unread', + 'show_read' => 'Show only read', + 'show_favorite' => 'Show favorites', 'older_first' => 'Oldest first', 'newer_first' => 'Newer first', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 20085e6b4..42b6f8dcf 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -44,6 +44,8 @@ return array ( 'rss_view' => 'Flux RSS', 'show_all_articles' => 'Afficher tous les articles', 'show_not_reads' => 'Afficher les non lus', + 'show_read' => 'Afficher les lus', + 'show_favorite' => 'Afficher les favoris', 'older_first' => 'Plus anciens en premier', 'newer_first' => 'Plus récents en premier', diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 44b49b10c..adb8aea9b 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -128,24 +128,52 @@
  • + state, $url_state['params']['state']) <> 0) { + ?>
  • - state == 'not_read') { - $url_state['params']['state'] = 'all'; - ?> - +
  • + + + state, $url_state['params']['state']) <> 0) { + ?> +
  • -
  • + + + state, $url_state['params']['state']) <> 0) { + ?> +
  • + + + +
  • + + + state, $url_state['params']['state']) <> 0) { + ?> +
  • + + + +
  • + + +