aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorM. Dent <dentm42@gmail.com>2019-03-29 18:19:06 +0100
committerM. Dent <dentm42@gmail.com>2019-03-29 18:19:06 +0100
commit4fa827ddfd036f933b4f3ad4471644107fd0d32d (patch)
tree40b154dab9793ffab70fae7586c46f76cfc703d4
parent1b3c73618c35423c20378a24c7f599eb989ac2a6 (diff)
parent318fd7c9e37803226b6c2ab68e8cc570d1a6c7ff (diff)
downloadvolse-hubzilla-4fa827ddfd036f933b4f3ad4471644107fd0d32d.tar.gz
volse-hubzilla-4fa827ddfd036f933b4f3ad4471644107fd0d32d.tar.bz2
volse-hubzilla-4fa827ddfd036f933b4f3ad4471644107fd0d32d.zip
Merge branch 'connections_ordering' into 'dev'
add backend support for connections ordering See merge request hubzilla/core!1576
-rw-r--r--Zotlabs/Module/Connections.php18
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
);
}