[evolvis-commits] r18224: GRAUGH! lambdas aren’t supported in php 5.2 (lenny and hardy)…

mirabilos at evolvis.org mirabilos at evolvis.org
Tue Apr 3 12:06:49 CEST 2012


Author: mirabilos
Date: 2012-04-03 12:06:48 +0200 (Tue, 03 Apr 2012)
New Revision: 18224

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/www/admin/grouplist.php
Log:
GRAUGH! lambdas aren’t supported in php 5.2 (lenny and hardy)…


Modified: trunk/gforge_base/evolvisforge-5.1/src/www/admin/grouplist.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/admin/grouplist.php	2012-04-03 10:06:44 UTC (rev 18223)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/admin/grouplist.php	2012-04-03 10:06:48 UTC (rev 18224)
@@ -122,47 +122,47 @@
 	$rows[] = $grp;
 }
 
-usort($rows, function($a, $b) {
+usort($rows, create_function('$a, $b', '
 	global $sortorder, $sortrev;
 
 	$av = $a[$sortorder];
 	$bv = $b[$sortorder];
 
 	switch ($sortorder) {
-	case 'register_time':
-	case 'is_public':
-	case 'members':
-	case 'is_template':
+	case "register_time":
+	case "is_public":
+	case "members":
+	case "is_template":
 		$rv = $av === $bv ? 0 : $av > $bv ? 1 : -1;
 		break;
 
-	case 'group_name':
-	case 'status':
-	case 'license_name':
+	case "group_name":
+	case "status":
+	case "license_name":
 		$rv = strcasecmp($av, $bv);
 		break;
 
-	case 'unix_group_name':
+	case "unix_group_name":
 	default:
 		$rv = 0;
 	}
 
 	/* second order sort is by unix group id */
-	$rv = $rv ? $rv : strcmp($a['unix_group_name'], $b['unix_group_name']);
+	$rv = $rv ? $rv : strcmp($a["unix_group_name"], $b["unix_group_name"]);
 
 	return ($sortrev ? -$rv : $rv);
-    });
+    '));
 
-$t = new EvolvisTable($tcolnames, array_map(function($v) {
+$t = new EvolvisTable($tcolnames, array_map(create_function('$v', '
 	global $sortorder, $sortrev;
 
-	$rv = '/admin/grouplist.php?sortorder=' . $v;
+	$rv = "/admin/grouplist.php?sortorder=" . $v;
 	if ($v == $sortorder && !$sortrev) {
-		$rv .= '&sortrev=1';
+		$rv .= "&sortrev=1";
 	}
 
 	return ($rv);
-    }, $tcolids));
+    '), $tcolids));
 
 foreach ($rows as $grp) {
 	switch ($grp['status']) {



More information about the evolvis-commits mailing list