diff options
| author | 2014-01-08 13:37:36 -0800 | |
|---|---|---|
| committer | 2014-01-08 13:37:36 -0800 | |
| commit | 50e0339188107564fddb3abddeabbe0132cff6b1 (patch) | |
| tree | f0736f104e14fa8095aae13d8f3afb18446690b5 | |
| parent | d31fcb404231b39f1107a32531b972f97ad75b8d (diff) | |
| parent | 46a5bdea25c0ae0624082dd08f3c41060e7fed86 (diff) | |
Merge pull request #352 from aledeg/filters
Ajout de filtres
| -rw-r--r-- | app/Models/EntryDAO.php | 3 | ||||
| -rw-r--r-- | app/i18n/en.php | 2 | ||||
| -rw-r--r-- | app/i18n/fr.php | 2 | ||||
| -rw-r--r-- | 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 @@ <li class="separator"></li> + <?php + $url_state = $url; + $url_state['params']['state'] = 'all'; + if (strcmp($this->state, $url_state['params']['state']) <> 0) { + ?> <li class="item"> - <?php - $url_state = $url; - if ($this->state == 'not_read') { - $url_state['params']['state'] = 'all'; - ?> <a class="print_all" href="<?php echo Minz_Url::display ($url_state); ?>"> <?php echo Minz_Translate::t ('show_all_articles'); ?> </a> - <?php - } else { - $url_state['params']['state'] = 'not_read'; - ?> + </li> + <?php } ?> + + <?php + $url_state['params']['state'] = 'not_read'; + if (strcmp($this->state, $url_state['params']['state']) <> 0) { + ?> + <li class="item"> <a class="print_non_read" href="<?php echo Minz_Url::display ($url_state); ?>"> <?php echo Minz_Translate::t ('show_not_reads'); ?> </a> - <?php } ?> </li> + <?php } ?> + + <?php + $url_state['params']['state'] = 'read'; + if (strcmp($this->state, $url_state['params']['state']) <> 0) { + ?> + <li class="item"> + <a class="print_read" href="<?php echo Minz_Url::display ($url_state); ?>"> + <?php echo Minz_Translate::t ('show_read'); ?> + </a> + </li> + <?php } ?> + + <?php + $url_state['params']['state'] = 'favorite'; + if (strcmp($this->state, $url_state['params']['state']) <> 0) { + ?> + <li class="item"> + <a class="print_read" href="<?php echo Minz_Url::display ($url_state); ?>"> + <?php echo Minz_Translate::t ('show_favorite'); ?> + </a> + </li> + <?php } ?> + + <li class="separator"></li> <li class="item"> <?php |
