aboutsummaryrefslogtreecommitdiffstats
path: root/include/profile_advanced.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-07-04 04:53:03 -0700
committerfriendica <info@friendica.com>2013-07-04 04:53:03 -0700
commit2979a2ee5a3a820bdc6ccbda173a5e5016d570db (patch)
treedaeb7239685294559879f68e8948d965ef76b748 /include/profile_advanced.php
parentec38f1d5dbe75ee8bb66a904414266a7391412d4 (diff)
downloadvolse-hubzilla-2979a2ee5a3a820bdc6ccbda173a5e5016d570db.tar.gz
volse-hubzilla-2979a2ee5a3a820bdc6ccbda173a5e5016d570db.tar.bz2
volse-hubzilla-2979a2ee5a3a820bdc6ccbda173a5e5016d570db.zip
more "thing" work
Diffstat (limited to 'include/profile_advanced.php')
-rw-r--r--include/profile_advanced.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/profile_advanced.php b/include/profile_advanced.php
index e113e019d..21606185d 100644
--- a/include/profile_advanced.php
+++ b/include/profile_advanced.php
@@ -91,19 +91,33 @@ function advanced_profile(&$a) {
if($r) {
$things = array();
+
+ // Use the system obj_verbs array as a sort key, since we don't really
+ // want an alphabetic sort. To change the order, use a plugin to
+ // alter the obj_verbs() array or alter it in code. Unknown verbs come
+ // after the known ones - in no particular order.
+
+ $v = obj_verbs();
+ foreach($v as $k => $foo)
+ $things[$k] = null;
foreach($r as $rr) {
if(! $things[$rr['obj_verb']])
$things[$rr['obj_verb']] = array();
$things[$rr['obj_verb']][] = array('term' => $rr['term'],'url' => $rr['url'],'img' => $rr['imgurl']);
}
+ $sorted_things = array();
+ if($things)
+ foreach($things as $k => $v)
+ if(is_array($things[$k]))
+ $sorted_things[$k] = $v;
}
- logger('mod_profile: things: ' . print_r($things,true), LOGGER_DATA);
+ logger('mod_profile: things: ' . print_r($sorted_things,true), LOGGER_DATA);
return replace_macros($tpl, array(
'$title' => t('Profile'),
'$profile' => $profile,
- '$things' => $things
+ '$things' => $sorted_things
));
}