diff options
| author | 2013-04-29 00:57:08 +0200 | |
|---|---|---|
| committer | 2013-04-29 00:57:08 +0200 | |
| commit | 9820345eec3958e9df1b1f8daaaa776de0d333e5 (patch) | |
| tree | e85c0890ca77be78c858e0c3f0e4721f779cb28f /app/layout | |
| parent | 00bac232e0976a2ca09e7c4e73956cd802176480 (diff) | |
Revue de code pour la récupération des articles : ATTENTION GROS CHANGEMENTS, aucune garantie de stabilité et possibles régressions. La recherche dans le contenu des articles fonctionnent et possibilité de rechercher des tags
Diffstat (limited to 'app/layout')
| -rw-r--r-- | app/layout/aside_flux.phtml | 19 | ||||
| -rw-r--r-- | app/layout/header.phtml | 15 | ||||
| -rw-r--r-- | app/layout/nav_menu.phtml | 56 |
3 files changed, 67 insertions, 23 deletions
diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index d2e5341e3..d1fe6b759 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -3,21 +3,16 @@ <ul class="categories"> <?php - $get = Request::param ('get', ''); - $search = Request::param ('search', ''); + $params = Request::params (); + $params['output'] = 'rss'; + if (isset ($params['search'])) { + $params['search'] = urlencode ($params['search']); + } $url = array ( 'c' => 'index', 'a' => 'index', - 'params' => array ( - 'output' => 'rss' - ) + 'params' => $params ); - if ($get != '') { - $url['params']['get'] = $get; - } - if ($search != '') { - $url['params']['search'] = $search; - } ?> <?php if (!login_is_conf ($this->conf) || is_logged ()) { ?> <li> @@ -30,7 +25,7 @@ <li> <div class="all"> - <a class="btn<?php echo !$this->get_c ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index'); ?>"> + <a class="btn<?php echo $this->get_c == 'all' ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index'); ?>"> <i class="icon i_all"></i> <?php echo Translate::t ('all_feeds', $this->nb_total); ?> <?php if ($this->nb_not_read > 0) { ?> diff --git a/app/layout/header.phtml b/app/layout/header.phtml index d6fe41950..4b62a9003 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -15,10 +15,21 @@ </div> <div class="item search"> - <form action="<?php echo _url ('index', 'index'); ?>" method="get"> + <?php + $params = Request::params (); + if (isset ($params['search'])) { + unset ($params['search']); + } + $url = array ( + 'c' => 'index', + 'a' => 'index', + 'params' => $params + ); + ?> + <form action="<?php echo Url::display ($url); ?>" method="post"> <div class="stick"> <?php $s = Request::param ('search', ''); ?> - <input type="text" name="search" id="search" value="<?php echo $s; ?>" placeholder="<?php echo Translate::t ('search_on_title'); ?>" /> + <input type="text" name="search" id="search" value="<?php echo $s; ?>" placeholder="<?php echo Translate::t ('search'); ?>" /> <button class="btn" type="submit"><i class="icon i_search"></i></button> </div> </form> diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index ce124da11..3411f344b 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -10,7 +10,10 @@ if ($this->get_f) { $get = 'f_' . $this->get_f; $string_mark = Translate::t ('mark_feed_read'); - } elseif ($this->get_c) { + } elseif ($this->get_c && + $this->get_c != 'all' && + $this->get_c != 'favoris' && + $this->get_c != 'public') { $get = 'c_' . $this->get_c; $string_mark = Translate::t ('mark_cat_read'); } @@ -39,6 +42,17 @@ </div> <?php } ?> + <?php + $params = Request::params (); + if (isset ($params['search'])) { + $params['search'] = urlencode ($params['search']); + } + $url = array ( + 'c' => 'index', + 'a' => 'index', + 'params' => $params + ); + ?> <div class="dropdown"> <div id="dropdown-views" class="dropdown-target"></div> <a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Translate::t ('display'); ?> <i class="icon i_down"></i></a> @@ -46,18 +60,42 @@ <li class="dropdown-close"><a href="#close"><i class="icon i_close"></i></a></li> <li class="item"> - <?php if ($this->mode == 'not_read') { ?> - <a class="print_all" href="<?php echo _url ('index', 'changeMode', 'mode', 'all'); ?>"><?php echo Translate::t ('show_all_articles'); ?></a> - <?php } else { ?> - <a class="print_non_read" href="<?php echo _url ('index', 'changeMode', 'mode', 'not_read'); ?>"><?php echo Translate::t ('show_not_reads'); ?></a> + <?php + if ($this->state == 'not_read') { + $url['params']['state'] = 'all'; + ?> + <a class="print_all" href="<?php echo Url::display ($url); ?>"><?php echo Translate::t ('show_all_articles'); ?></a> + <?php + } else { + $url['params']['state'] = 'not_read'; + ?> + <a class="print_non_read" href="<?php echo Url::display ($url); ?>"><?php echo Translate::t ('show_not_reads'); ?></a> <?php } ?> </li> <li class="separator"></li> + + <?php + $params = Request::params (); + if (isset ($params['search'])) { + $params['search'] = urlencode ($params['search']); + } + $url = array ( + 'c' => 'index', + 'a' => 'index', + 'params' => $params + ); + ?> <li class="item"> - <?php if ($this->order == 'low_to_high') { ?> - <a href="<?php echo _url ('index', 'changeOrder', 'order', 'high_to_low'); ?>"><?php echo Translate::t ('older_first'); ?></a> - <?php } else { ?> - <a href="<?php echo _url ('index', 'changeOrder', 'order', 'low_to_high'); ?>"><?php echo Translate::t ('newer_first'); ?></a> + <?php + if ($this->order == 'low_to_high') { + $url['params']['order'] = 'high_to_low'; + ?> + <a href="<?php echo Url::display ($url); ?>"><?php echo Translate::t ('older_first'); ?></a> + <?php + } else { + $url['params']['order'] = 'low_to_high'; + ?> + <a href="<?php echo Url::display ($url); ?>"><?php echo Translate::t ('newer_first'); ?></a> <?php } ?> </li> </ul> |
