[Fusionforge-commits] r14439 - in trunk: . src/docs src/plugins/doaprdf/include src/plugins/oslc/include src/www

Roland Mas lolando at fusionforge.org
Mon Sep 19 14:18:50 CEST 2011


Author: lolando
Date: 2011-09-19 14:18:50 +0200 (Mon, 19 Sep 2011)
New Revision: 14439

Modified:
   trunk/
   trunk/src/docs/README.Plugins
   trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php
   trunk/src/plugins/oslc/include/oslcPlugin.class.php
   trunk/src/www/projects
Log:
Stop using (and modifying) a global group_id variable in a plugin

Modified: trunk/src/docs/README.Plugins
===================================================================
--- trunk/src/docs/README.Plugins	2011-09-19 12:01:26 UTC (rev 14438)
+++ trunk/src/docs/README.Plugins	2011-09-19 12:18:50 UTC (rev 14439)
@@ -499,7 +499,7 @@
                /projects or /users/ pages rendered through content-negociation
 
   Hook Name  : content_negociated_project_home
-  Parameters : $params['accept'] provides the content-type to be rendered, $params['groupname'] the project name
+  Parameters : $params['accept'] provides the content-type to be rendered, $params['groupname'] the project name, $params['group_id'] the project ID
   Description: returns in $params['content'] an alternate content for /projects/ page and 
                in $params['content_type'] the actual content-type to return
 		

Modified: trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php
===================================================================
--- trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php	2011-09-19 12:01:26 UTC (rev 14438)
+++ trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php	2011-09-19 12:18:50 UTC (rev 14439)
@@ -146,10 +146,9 @@
 	 * @param unknown_type $params
 	 */
 	function content_negociated_project_home (&$params) {
-		global $group_id;	
-	
 		$projectname = $params['groupname'];
 		$accept = $params['accept'];
+		$group_id = $params['group_id'];
 
 		if($accept == 'application/rdf+xml') {
 			$pm = ProjectManager::instance();
@@ -173,6 +172,7 @@
 							'http://purl.org/dc/terms/' => 'dcterms'
 			);
 			$hook_params['xml'] = array();
+			$hook_params['group'] = $group_id;
 			
 			plugin_hook_by_reference('project_rdf_metadata', $hook_params);
 			

Modified: trunk/src/plugins/oslc/include/oslcPlugin.class.php
===================================================================
--- trunk/src/plugins/oslc/include/oslcPlugin.class.php	2011-09-19 12:01:26 UTC (rev 14438)
+++ trunk/src/plugins/oslc/include/oslcPlugin.class.php	2011-09-19 12:18:50 UTC (rev 14439)
@@ -38,7 +38,7 @@
 	}
 
 	function CallHook ($hookname, &$params) {
-		global $use_oslcplugin,$G_SESSION,$HTML, $group_id;
+		global $use_oslcplugin,$G_SESSION,$HTML;
 		if ($hookname == "usermenu") {
 			$text = $this->text; // this is what shows in the tab
 			if ($G_SESSION->usesPlugin("oslc")) {
@@ -153,6 +153,7 @@
 		}
 		elseif($hookname == "project_rdf_metadata") {
 			
+			$group_id=$params['group'];
 			$serviceprovider = util_make_url ("/plugins/oslc/cm/oslc-cm-services/".$group_id);
 
 			if (! $params['prefixes']['http://open-services.net/ns/core#']) {

Modified: trunk/src/www/projects
===================================================================
--- trunk/src/www/projects	2011-09-19 12:01:26 UTC (rev 14438)
+++ trunk/src/www/projects	2011-09-19 12:18:50 UTC (rev 14439)
@@ -65,6 +65,7 @@
 			$hook_params['accept'] = $content_type;
 			$hook_params['return'] = '';
 			$hook_params['content_type'] = '';
+			$hook_params['group_id'] = $project->getID();
 			plugin_hook_by_reference('content_negociated_project_home', $hook_params);
 			if($hook_params['content_type'] != ''){
 				header('Content-type: '. $hook_params['content_type']);




More information about the Fusionforge-commits mailing list