[Fusionforge-commits] r12692 - branches/Branch_5_1/src/www/admin

Alain Peyrat aljeux at fusionforge.org
Fri Mar 11 18:10:04 CET 2011


Author: aljeux
Date: 2011-03-11 18:10:04 +0100 (Fri, 11 Mar 2011)
New Revision: 12692

Modified:
   branches/Branch_5_1/src/www/admin/pluginman.php
Log:
In pluginman, display associated projects only if less than 100 to 
get a more visible output.

Modified: branches/Branch_5_1/src/www/admin/pluginman.php
===================================================================
--- branches/Branch_5_1/src/www/admin/pluginman.php	2011-03-11 17:09:55 UTC (rev 12691)
+++ branches/Branch_5_1/src/www/admin/pluginman.php	2011-03-11 17:10:04 UTC (rev 12692)
@@ -4,6 +4,7 @@
  *
  * Copyright 2005 GForge, LLC
  * Copyright 2010 FusionForge Team
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
  * http://fusionforge.org/
  *
  * This file is part of FusionForge.
@@ -163,10 +164,15 @@
 		if ($res) {
 			if (db_numrows($res)>0) {
 				$users = " ";
-				for($i=0;$i<db_numrows($res);$i++) {
+				$nb_users = db_numrows($res);
+				for($i=0;$i<$nb_users;$i++) {
 					$users .= db_result($res,$i,0) . " | ";
 				}
 				$users = substr($users,0,strlen($users) - 3); //remove the last |
+				// If there are too many users, replace the list with number of users
+				if ($nb_users > 100) {
+					$users = util_make_link("/admin/userlist.php?usingplugin=$filename", '<b>'.sprintf(_("%d users"), $nb_users).'</b>');
+				}
 			} else {
 				$users = _('None');
 			}
@@ -177,10 +183,15 @@
 		if ($res) {
 			if (db_numrows($res)>0) {
 				$groups = " ";
-				for($i=0;$i<db_numrows($res);$i++) {
+				$nb_groups = db_numrows($res);
+				for($i=0;$i<$nb_groups;$i++) {
 					$groups .= db_result($res,$i,0) . " | ";
 				}
 				$groups = substr($groups,0,strlen($groups) - 3); //remove the last |
+				// If there are too many projects, replace the list with number of projects
+				if ($nb_groups > 100) {
+					$groups = util_make_link("/admin/grouplist.php?usingplugin=$filename", '<b>'.sprintf(_("%d projects"), $nb_groups).'</b>');
+				}
 			} else {
 				$groups = _('None');
 			}




More information about the Fusionforge-commits mailing list