mirror of
https://github.com/moparisthebest/wallabag
synced 2024-12-24 08:18:48 -05:00
Fixed #13 - tri par date / tri par titre
This commit is contained in:
parent
139769aa24
commit
9fee2e7266
@ -32,6 +32,21 @@ header {
|
|||||||
color: #F1F1F1;
|
color: #F1F1F1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#main ul#sort {
|
||||||
|
padding: 0;
|
||||||
|
list-style-type: none;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main ul#sort li {
|
||||||
|
display: inline;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main ul#sort img:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
#main, #article {
|
#main, #article {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
BIN
img/down.png
Executable file
BIN
img/down.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 216 B |
BIN
img/up.png
Executable file
BIN
img/up.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 212 B |
@ -35,8 +35,8 @@ if (!isset($_SESSION['token_poche'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Traitement des paramètres et déclenchement des actions
|
# Traitement des paramètres et déclenchement des actions
|
||||||
|
$view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index';
|
||||||
$action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : '';
|
$action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : '';
|
||||||
$_SESSION['view'] = (isset ($_GET['view'])) ? htmlentities($_GET['view']) : 'index';
|
|
||||||
$_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id';
|
$_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id';
|
||||||
$id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : '';
|
$id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : '';
|
||||||
$url = (isset ($_GET['url'])) ? $_GET['url'] : '';
|
$url = (isset ($_GET['url'])) ? $_GET['url'] : '';
|
||||||
|
@ -182,7 +182,7 @@ function action_to_do($action, $id, $url, $token)
|
|||||||
/**
|
/**
|
||||||
* Détermine quels liens afficher : home, fav ou archives
|
* Détermine quels liens afficher : home, fav ou archives
|
||||||
*/
|
*/
|
||||||
function display_view()
|
function display_view($view)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ function display_view()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($_SESSION['view'])
|
switch ($view)
|
||||||
{
|
{
|
||||||
case 'archive':
|
case 'archive':
|
||||||
$sql = "SELECT * FROM entries WHERE is_read=? " . $order;
|
$sql = "SELECT * FROM entries WHERE is_read=? " . $order;
|
||||||
|
@ -10,10 +10,10 @@
|
|||||||
|
|
||||||
include dirname(__FILE__).'/inc/config.php';
|
include dirname(__FILE__).'/inc/config.php';
|
||||||
|
|
||||||
$entries = display_view();
|
$entries = display_view($view);
|
||||||
|
|
||||||
$tpl->assign('title', 'poche, a read it later open source system');
|
$tpl->assign('title', 'poche, a read it later open source system');
|
||||||
$tpl->assign('view', $_SESSION['view']);
|
$tpl->assign('view', $view);
|
||||||
$tpl->assign('poche_url', get_poche_url());
|
$tpl->assign('poche_url', get_poche_url());
|
||||||
$tpl->assign('entries', $entries);
|
$tpl->assign('entries', $entries);
|
||||||
$tpl->assign('load_all_js', 1);
|
$tpl->assign('load_all_js', 1);
|
||||||
|
@ -22,6 +22,6 @@ function toggle_archive(element, id, token, view_article) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sort_links(sort, token) {
|
function sort_links(view, sort, token) {
|
||||||
$('#content').load('process.php', { sort: sort, token: token } );
|
$('#content').load('process.php', { view: view, sort: sort, token: token } );
|
||||||
}
|
}
|
16
process.php
Normal file
16
process.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* poche, a read it later open source system
|
||||||
|
*
|
||||||
|
* @category poche
|
||||||
|
* @author Nicolas Lœuillet <support@inthepoche.com>
|
||||||
|
* @copyright 2013
|
||||||
|
* @license http://www.wtfpl.net/ see COPYING file
|
||||||
|
*/
|
||||||
|
|
||||||
|
include dirname(__FILE__).'/inc/config.php';
|
||||||
|
|
||||||
|
$entries = display_view($view);
|
||||||
|
$tpl->assign('token', $_SESSION['token_poche']);
|
||||||
|
$tpl->assign('entries', $entries);
|
||||||
|
$tpl->draw('entries');
|
@ -9,10 +9,8 @@
|
|||||||
<li><a href="?view=archive" {if="$view == 'archive'"}class="current"{/if}>archive</a></li>
|
<li><a href="?view=archive" {if="$view == 'archive'"}class="current"{/if}>archive</a></li>
|
||||||
<li><a style="cursor: move" title="i am a bookmarklet, use me !" href="javascript:(function(){var%20url%20=%20location.href%20||%20url;window.open('{$poche_url}?action=add&url='%20+%20encodeURIComponent(url),'_self');})();">poche it !</a></li>
|
<li><a style="cursor: move" title="i am a bookmarklet, use me !" href="javascript:(function(){var%20url%20=%20location.href%20||%20url;window.open('{$poche_url}?action=add&url='%20+%20encodeURIComponent(url),'_self');})();">poche it !</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- <ul>
|
<ul id="sort">
|
||||||
<li onclick="sort_links('ia', '{$token}');">tri par id asc</li>
|
<li><img src="img/up.png" onclick="sort_links('{$view}', 'ia', '{$token}');" title="by date asc" /> by date <img src="img/down.png" onclick="sort_links('{$view}', 'id', '{$token}');" title="by date desc" /></li>
|
||||||
<li onclick="sort_links('id', '{$token}');">tri par id desc</li>
|
<li><img src="img/up.png" onclick="sort_links('{$view}', 'ta', '{$token}');" title="by title asc" /> by title <img src="img/down.png" onclick="sort_links('{$view}', 'td', '{$token}');" title="by title desc" /></li>
|
||||||
<li onclick="sort_links('ta', '{$token}');">tri par title asc</li>
|
</ul>
|
||||||
<li onclick="sort_links('td', '{$token}');">tri par title desc</li>
|
|
||||||
</ul> -->
|
|
||||||
<div id="content">
|
<div id="content">
|
Loading…
Reference in New Issue
Block a user