diff options
| author | 2013-11-30 17:21:26 +0100 | |
|---|---|---|
| committer | 2013-11-30 17:21:26 +0100 | |
| commit | 37ce14c093c3dd009bcd7b627c5e819ac88dd5b7 (patch) | |
| tree | 0edf7fc2c7505c8b70fd0722fb7abfbf058fd814 /app/layout | |
| parent | e98b7ab13ec414d1c5c3c3d1d6a7c9995ebf4fea (diff) | |
Recherche côté SQL avec LIKE
Premier essai de recherche côté base de données (à améliorer)
https://github.com/marienfressinaud/FreshRSS/issues/204
Pour l'instant fait avec du LIKE et pas d'indexation texte complet.
* Suppression de EntriesGetter car le code est devenu plus simple grâce
au filtrage côté SQL
* Uniformisation de get_c à une lettre ('all' devient 'a','favoris'
devient 's' - pour "starred") pour simplifier le code
* low_to_high par DESC, high_to_low par ASC
* Réduction du nombre de créations de *DAO dans indexController
* Refactorisation de checkAndProcessType()
Pas encore trop testé...
Diffstat (limited to 'app/layout')
| -rw-r--r-- | app/layout/aside_flux.phtml | 4 | ||||
| -rw-r--r-- | app/layout/nav_menu.phtml | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index 918a44e01..ce5ded230 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -15,7 +15,7 @@ <li> <div class="category all"> - <a data-unread="<?php echo $this->nb_not_read; ?>" class="btn<?php echo $this->get_c == 'all' ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index'); ?>"> + <a data-unread="<?php echo $this->nb_not_read; ?>" class="btn<?php echo $this->get_c == 'a' ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index'); ?>"> <?php echo RSSThemes::icon('all'); ?> <?php echo Translate::t ('all_feeds'); ?> </a> @@ -24,7 +24,7 @@ <li> <div class="category favorites"> - <a data-unread="<?php echo $this->nb_favorites['unread']; ?>" class="btn<?php echo $this->get_c == 'favoris' ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index', 'get', 'favoris'); ?>"> + <a data-unread="<?php echo $this->nb_favorites['unread']; ?>" class="btn<?php echo $this->get_c == 's' ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index', 'get', 's'); ?>"> <?php echo RSSThemes::icon('bookmark'); ?> <?php echo Translate::t ('favorite_feeds', $this->nb_favorites['all']); ?> </a> diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 0b95b4b02..289fe6542 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -11,9 +11,8 @@ $get = 'f_' . $this->get_f; $string_mark = Translate::t ('mark_feed_read'); } elseif ($this->get_c && - $this->get_c != 'all' && - $this->get_c != 'favoris' && - $this->get_c != 'public') { + $this->get_c != 'a' && + $this->get_c != 's') { $get = 'c_' . $this->get_c; $string_mark = Translate::t ('mark_cat_read'); } @@ -34,7 +33,7 @@ $anotherUnreadId = $cat->id (); if ($foundCurrent) break; } - $nextGet = empty ($anotherUnreadId) ? 'all' : 'c_' . $anotherUnreadId; + $nextGet = empty ($anotherUnreadId) ? 'a' : 'c_' . $anotherUnreadId; break; case 'f': foreach ($this->cat_aside as $cat) { @@ -149,15 +148,15 @@ <li class="item"> <?php $url_order = $url; - if ($this->order == 'low_to_high') { - $url_order['params']['order'] = 'high_to_low'; + if ($this->order === 'DESC') { + $url_order['params']['order'] = 'ASC'; ?> <a href="<?php echo Url::display ($url_order); ?>"> <?php echo Translate::t ('older_first'); ?> </a> <?php } else { - $url_order['params']['order'] = 'low_to_high'; + $url_order['params']['order'] = 'DESC'; ?> <a href="<?php echo Url::display ($url_order); ?>"> <?php echo Translate::t ('newer_first'); ?> |
