From e4daa4283035197136850ae2c409dffc79fa8459 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 11 Jun 2012 14:02:23 -0700 Subject: Rename the comparator to something that makes more sense (to me), and make it static. Follow-on to 5d9e71741754809ebe5f543eb874634e6fc8cc9d for #1859. --- modules/gallery/helpers/module.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'modules/gallery/helpers') 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,16 +110,20 @@ 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; } return self::$available; } + /** + * 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. */ -- cgit v1.2.3