aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Connedit.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-11-24 15:08:31 -0800
committerzotlabs <mike@macgirvin.com>2016-11-24 15:08:31 -0800
commit08a4bbb7d0b9c63ec97bb4f74e5842cc3ea8ee77 (patch)
treebd2b85d4a39c2d185d11d6c795a0a1a35e4abf99 /Zotlabs/Module/Connedit.php
parent1596391a2ebcdfe9955e28b1db14adc05a6856da (diff)
downloadvolse-hubzilla-08a4bbb7d0b9c63ec97bb4f74e5842cc3ea8ee77.tar.gz
volse-hubzilla-08a4bbb7d0b9c63ec97bb4f74e5842cc3ea8ee77.tar.bz2
volse-hubzilla-08a4bbb7d0b9c63ec97bb4f74e5842cc3ea8ee77.zip
prev-next navigation for mod_connedit
Diffstat (limited to 'Zotlabs/Module/Connedit.php')
-rw-r--r--Zotlabs/Module/Connedit.php39
1 files changed, 36 insertions, 3 deletions
diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php
index 5ab6f814b..9dfa871f7 100644
--- a/Zotlabs/Module/Connedit.php
+++ b/Zotlabs/Module/Connedit.php
@@ -41,11 +41,16 @@ class Connedit extends \Zotlabs\Web\Controller {
}
}
+
$channel = \App::get_channel();
if($channel)
head_set_icon($channel['xchan_photo_s']);
}
+
+ static public function xchan_name_sort($a,$b) {
+ return strcasecmp($a['xchan_name'],$b['xchan_name']);
+ }
/* @brief Evaluate posted values and set changes
*
@@ -546,9 +551,34 @@ class Connedit extends \Zotlabs\Web\Controller {
if(\App::$poi) {
+ $abook_prev = 0;
+ $abook_next = 0;
+
$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",
+ intval(local_channel())
+ );
+ if($cn) {
+ usort($cn, '\\Zotlabs\\Module\\Connedit::xchan_name_sort');
+
+ $pntotal = count($cn);
+
+ for($x = 0; $x < $pntotal; $x ++) {
+ if($cn[$x]['abook_id'] == $contact_id) {
+ if($x === 0)
+ $abook_prev = 0;
+ else
+ $abook_prev = $cn[$x - 1]['abook_id'];
+ if($x === $pntotal)
+ $abook_next = 0;
+ else
+ $abook_next = $cn[$x +1]['abook_id'];
+ }
+ }
+ }
+
$tools = array(
'view' => array(
@@ -615,8 +645,10 @@ class Connedit extends \Zotlabs\Web\Controller {
$self = false;
- if(intval($contact['abook_self']))
+ if(intval($contact['abook_self'])) {
$self = true;
+ $abook_prev = $abook_next = 0;
+ }
$tpl = get_markup_template("abook_edit.tpl");
@@ -792,7 +824,8 @@ class Connedit extends \Zotlabs\Web\Controller {
'$multiprofs' => $multiprofs,
'$contact_id' => $contact['abook_id'],
'$name' => $contact['xchan_name'],
-
+ '$abook_prev' => $abook_prev,
+ '$abook_next' => $abook_next
));
$arr = array('contact' => $contact,'output' => $o);