summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2012-06-11 14:02:23 -0700
committerBharat Mediratta <bharat@menalto.com>2012-06-11 14:02:23 -0700
commite4daa4283035197136850ae2c409dffc79fa8459 (patch)
tree023d558951c4992959e2952a7f3ca378a2ca7469 /modules
parent8e74750dc22ea959261db5b424c8e5ab157c39e8 (diff)
Rename the comparator to something that makes more sense (to me), and make it static.
Follow-on to 5d9e71741754809ebe5f543eb874634e6fc8cc9d for #1859.
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/helpers/module.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php
index 7292b106..e4f41d3d 100644
--- a/modules/gallery/helpers/module.php
+++ b/modules/gallery/helpers/module.php
@@ -110,10 +110,7 @@ class module_Core {
$identity_module = module::get_var("gallery", "identity_provider", "user");
$modules->$identity_module->locked = true;
- function natural_name_sort($a, $b) {
- return strnatcasecmp($a->name, $b->name);
- }
- $modules->uasort('natural_name_sort');
+ $modules->uasort(array("module", "module_comparator"));
self::$available = $modules;
}
@@ -121,6 +118,13 @@ class module_Core {
}
/**
+ * Natural name sort comparator
+ */
+ static function module_comparator($a, $b) {
+ return strnatcasecmp($a->name, $b->name);
+ }
+
+ /**
* Return a list of all the active modules in no particular order.
*/
static function active() {