aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-03-02 12:41:50 -0800
committerzotlabs <mike@macgirvin.com>2018-03-02 12:41:50 -0800
commitb38ce967f36e0dc5a503fbca9477732cd8967ea6 (patch)
tree9fa375a38be707e1a660d7ab66e413af58b0ef0a
parentdbe73cdcbe4a51bbb9588af88afea22b5b201cc0 (diff)
downloadvolse-hubzilla-b38ce967f36e0dc5a503fbca9477732cd8967ea6.tar.gz
volse-hubzilla-b38ce967f36e0dc5a503fbca9477732cd8967ea6.tar.bz2
volse-hubzilla-b38ce967f36e0dc5a503fbca9477732cd8967ea6.zip
sort settings/featured
-rw-r--r--Zotlabs/Module/Settings/Featured.php19
-rw-r--r--include/text.php6
2 files changed, 22 insertions, 3 deletions
diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php
index 1da139206..542a05363 100644
--- a/Zotlabs/Module/Settings/Featured.php
+++ b/Zotlabs/Module/Settings/Featured.php
@@ -57,7 +57,10 @@ class Featured {
}
call_hooks('feature_settings', $settings_addons);
-
+
+ $this->sortpanels($settings_addons);
+
+
$tpl = get_markup_template("settings_addons.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_featured"),
@@ -67,5 +70,15 @@ class Featured {
));
return $o;
}
-
-} \ No newline at end of file
+
+ function sortpanels(&$s) {
+ $a = explode('<div class="panel">',$s);
+ if($a) {
+ usort($a,'featured_sort');
+ $s = implode('<div class="panel">',$a);
+ }
+ }
+
+}
+
+
diff --git a/include/text.php b/include/text.php
index c82fad517..6675043e6 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3311,4 +3311,10 @@ function purify_filename($s) {
return $s;
}
+// callback for sorting the settings/featured entries.
+function featured_sort($a,$b) {
+ $s1 = substr($a,strpos($a,'id='),20);
+ $s2 = substr($b,strpos($b,'id='),20);
+ return(strcmp($s1,$s2));
+}