diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-03-27 20:42:56 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2019-03-27 20:42:56 +0100 |
commit | 318fd7c9e37803226b6c2ab68e8cc570d1a6c7ff (patch) | |
tree | 6e543ec9cd3ad1f1d2215c81494e5fb2ad0a5508 /Zotlabs | |
parent | c218970890c9d522db67dd7f10d700c04c35a61d (diff) | |
download | volse-hubzilla-318fd7c9e37803226b6c2ab68e8cc570d1a6c7ff.tar.gz volse-hubzilla-318fd7c9e37803226b6c2ab68e8cc570d1a6c7ff.tar.bz2 volse-hubzilla-318fd7c9e37803226b6c2ab68e8cc570d1a6c7ff.zip |
add backend support for connections ordering
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Connections.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Zotlabs/Module/Connections.php b/Zotlabs/Module/Connections.php index 6a93b3462..7c8d71210 100644 --- a/Zotlabs/Module/Connections.php +++ b/Zotlabs/Module/Connections.php @@ -127,6 +127,20 @@ class Connections extends \Zotlabs\Web\Controller { $unblocked = true; } + switch($_REQUEST['order']) { + case 'name_desc': + $sql_order = 'xchan_name DESC'; + break; + case 'connected': + $sql_order = 'abook_created'; + break; + case 'connected_desc': + $sql_order = 'abook_created DESC'; + break; + default: + $sql_order = 'xchan_name'; + } + $search = ((x($_REQUEST,'search')) ? notags(trim($_REQUEST['search'])) : ''); $tabs = array( @@ -233,7 +247,7 @@ class Connections extends \Zotlabs\Web\Controller { } $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash - WHERE abook_channel = %d and abook_self = 0 and xchan_deleted = 0 and xchan_orphan = 0 $sql_extra $sql_extra2 ORDER BY xchan_name LIMIT %d OFFSET %d ", + WHERE abook_channel = %d and abook_self = 0 and xchan_deleted = 0 and xchan_orphan = 0 $sql_extra $sql_extra2 ORDER BY $sql_order LIMIT %d OFFSET %d ", intval(local_channel()), intval(App::$pager['itemspage']), intval(App::$pager['start']) @@ -307,7 +321,7 @@ class Connections extends \Zotlabs\Web\Controller { 'ignore_hover' => t('Ignore connection'), 'ignore' => ((! $rr['abook_ignored']) ? t('Ignore') : false), 'recent_label' => t('Recent activity'), - 'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']), + 'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']) . '&name=' . $rr['xchan_name'], 'oneway' => $oneway ); } |