From 7de4f1d96f5f1fe4dccd56c1456df1d82aa5c30b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 26 Nov 2016 14:28:36 -0800 Subject: connedit prev/next: sort in the db. --- Zotlabs/Module/Connedit.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'Zotlabs/Module/Connedit.php') diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php index 9dfa871f7..47e1ce167 100644 --- a/Zotlabs/Module/Connedit.php +++ b/Zotlabs/Module/Connedit.php @@ -48,9 +48,6 @@ class Connedit extends \Zotlabs\Web\Controller { } - static public function xchan_name_sort($a,$b) { - return strcasecmp($a['xchan_name'],$b['xchan_name']); - } /* @brief Evaluate posted values and set changes * @@ -557,12 +554,11 @@ class Connedit extends \Zotlabs\Web\Controller { $contact_id = \App::$poi['abook_id']; $contact = \App::$poi; - $cn = q("SELECT abook_id, xchan_name from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0", + $cn = q("SELECT abook_id, xchan_name from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0 order by xchan_name", intval(local_channel()) ); - if($cn) { - usort($cn, '\\Zotlabs\\Module\\Connedit::xchan_name_sort'); + if($cn) { $pntotal = count($cn); for($x = 0; $x < $pntotal; $x ++) { -- cgit v1.2.3 From 8c87f32b381ec0be066cdd0e6ca4fe50079bbd16 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 29 Nov 2016 18:41:34 -0800 Subject: This isn't the most elegant solution as it requires a bit of arcane knowledge, but provide a way to step through connections with a specific tab/panel open in the connection editor. It does not close the default panel, but merely opens the one specified by a §ion= URL parameter (closing the default panel would require a major refactoring of the default panel logic). Valid choices for section currently are affinity, filter, and perms. This tab/panel selection should persist across form posting and 'prev/next'. --- Zotlabs/Module/Connedit.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Zotlabs/Module/Connedit.php') diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php index 47e1ce167..5968ccde6 100644 --- a/Zotlabs/Module/Connedit.php +++ b/Zotlabs/Module/Connedit.php @@ -398,6 +398,7 @@ class Connedit extends \Zotlabs\Web\Controller { return login(); } + $section = ((array_key_exists('section',$_REQUEST)) ? $_REQUEST['section'] : ''); $channel = \App::get_channel(); $my_perms = get_channel_default_perms(local_channel()); $role = get_pconfig(local_channel(),'system','permissions_role'); @@ -779,6 +780,7 @@ class Connedit extends \Zotlabs\Web\Controller { '$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connection: %s'),$contact['xchan_name'])), '$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('Connection requests will be approved without your interaction'), $yes_no), '$addr' => $contact['xchan_addr'], + '$section' => $section, '$addr_text' => t('This connection\'s primary address is'), '$loc_text' => t('Available locations:'), '$locstr' => $locstr, -- cgit v1.2.3