[Fusionforge-commits] r7124 - trunk/gforge/www/include

Julien HEYMAN jheyman at libremir.placard.fr.eu.org
Fri Mar 6 11:48:39 CET 2009


Author: jheyman
Date: 2009-03-06 11:48:39 +0100 (Fri, 06 Mar 2009)
New Revision: 7124

Modified:
   trunk/gforge/www/include/project_home.php
   trunk/gforge/www/include/trove.php
Log:
Diplay complete trove When we display the trove, we lose the information classification. But, the goal of the trove, is sort, and classify.

Modified: trunk/gforge/www/include/project_home.php
===================================================================
--- trunk/gforge/www/include/project_home.php	2009-03-06 10:48:35 UTC (rev 7123)
+++ trunk/gforge/www/include/project_home.php	2009-03-06 10:48:39 UTC (rev 7124)
@@ -53,7 +53,7 @@
 
 if($GLOBALS['sys_use_trove']) {
 	print "<br />\n";
-	print stripslashes(trove_getcatlisting($group_id,0,1));
+	print stripslashes(trove_getcatcompletelisting($group_id));
 }
 
 // registration date

Modified: trunk/gforge/www/include/trove.php
===================================================================
--- trunk/gforge/www/include/trove.php	2009-03-06 10:48:35 UTC (rev 7123)
+++ trunk/gforge/www/include/trove.php	2009-03-06 10:48:39 UTC (rev 7124)
@@ -307,6 +307,59 @@
 }
 
 /**
+ * trove_getcatcompletelisting() - Gets complete discriminator listing for a group
+ *
+ * @param		int		The group ID
+ */
+function trove_getcatcompletelisting($group_id) {
+	global $discrim_url;
+	global $form_cat;
+	global $Language;
+
+	$res_trovecat = db_query("
+		SELECT trove_cat.fullpath AS fullpath,
+			trove_cat.fullpath_ids AS fullpath_ids,
+			trove_cat.trove_cat_id AS trove_cat_id
+		FROM trove_cat,trove_group_link
+		WHERE trove_cat.trove_cat_id=trove_group_link.trove_cat_id
+		AND trove_group_link.group_id='$group_id'
+		ORDER BY trove_cat.fullpath");
+
+	$return = '';
+	if (db_numrows($res_trovecat) < 1) {
+		$return .= $Language->getText('trove','not_categorized')
+			.' <a href="/softwaremap/trove_list.php">'
+			. $Language->getText('trove','title')
+			.'</a>.<p />';
+	} else {
+		$return .= '<ul>';
+		$need_close_ul_tag = 1;
+	}
+
+	while ($row_trovecat = db_fetch_array($res_trovecat)) {
+		$return .= '<li>';
+		$folders = explode(" :: ",$row_trovecat['fullpath']);
+		$folders_ids = explode(" :: ",$row_trovecat['fullpath_ids']);
+		$folders_len = count($folders);
+		// if first in discrim print root category
+		for ($i=0;$i<$folders_len;$i++)
+		{
+			$return .= '<a href="/softwaremap/trove_list.php?form_cat='.$folders_ids[$i].$discrim_url.'">'.$folders[$i].'</a>';
+			if ($i != $folders_len-1)
+			{
+				$return .= " : ";
+			}
+		}
+		$return .= '</li>';
+	}
+	if ($need_close_ul_tag)
+	{
+		$return .= '</ul>';
+	}
+	return $return;
+}
+
+/**
  * trove_getfullname() - Returns cat fullname
  *
  * @param		int		The node




More information about the Fusionforge-commits mailing list