[Fusionforge-commits] r14456 - in trunk/src/plugins: doaprdf/include foafprofiles/include

Olivier Berger olberger at fusionforge.org
Wed Sep 21 10:18:15 CEST 2011


Author: olberger
Date: 2011-09-21 10:18:15 +0200 (Wed, 21 Sep 2011)
New Revision: 14456

Modified:
   trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php
   trunk/src/plugins/foafprofiles/include/foafprofilesPlugin.class.php
Log:
Get rid of useless commented code

Modified: trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php
===================================================================
--- trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php	2011-09-21 08:18:12 UTC (rev 14455)
+++ trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php	2011-09-21 08:18:15 UTC (rev 14456)
@@ -32,103 +32,10 @@
 		$this->Plugin($id) ;
 		$this->name = "doaprdf";
 		$this->text = "DoaPRDF!"; // To show in the tabs, use...
-		//$this->_addHook("user_personal_links");//to make a link to the user's personal part of the plugin
-		//$this->_addHook("usermenu");
-		//$this->_addHook("groupmenu");	// To put into the project tabs
-		//$this->_addHook("groupisactivecheckbox"); // The "use ..." checkbox in editgroupinfo
-		//$this->_addHook("groupisactivecheckboxpost"); //
-		//$this->_addHook("userisactivecheckbox"); // The "use ..." checkbox in user account
-		//$this->_addHook("userisactivecheckboxpost"); //
-		//$this->_addHook("project_admin_plugins"); // to show up in the admin page fro group
 		$this->_addHook("script_accepted_types");
 		$this->_addHook("content_negociated_project_home");
 
 	}
-/*
-	function CallHook ($hookname, &$params) {
-		global $use_doaprdfplugin,$G_SESSION,$HTML;
-		if ($hookname == "usermenu") {
-			$text = $this->text; // this is what shows in the tab
-			if ($G_SESSION->usesPlugin("doaprdf")) {
-				$param = '?type=user&id=' . $G_SESSION->getId() . "&pluginname=" . $this->name; // we indicate the part we're calling is the user one
-				echo ' | ' . $HTML->PrintSubMenu (array ($text),
-						  array ('/plugins/doaprdf/index.php' . $param ));
-			}
-		} elseif ($hookname == "groupmenu") {
-			$group_id=$params['group'];
-			$project = &group_get_object($group_id);
-			if (!$project || !is_object($project)) {
-				return;
-			}
-			if ($project->isError()) {
-				return;
-			}
-			if (!$project->isProject()) {
-				return;
-			}
-			if ( $project->usesPlugin ( $this->name ) ) {
-				$params['TITLES'][]=$this->text;
-				$params['DIRS'][]=util_make_url ('/plugins/doaprdf/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name) ; // we indicate the part we're calling is the project one
-			} else {
-				$params['TITLES'][]=$this->text." is [Off]";
-				$params['DIRS'][]='';
-			}
-			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
-		} elseif ($hookname == "groupisactivecheckbox") {
-			//Check if the group is active
-			// this code creates the checkbox in the project edit public info page to activate/deactivate the plugin
-			$group_id=$params['group'];
-			$group = &group_get_object($group_id);
-			echo "<tr>";
-			echo "<td>";
-			echo ' <input type="checkbox" name="use_doaprdfplugin" value="1" ';
-			// checked or unchecked?
-			if ( $group->usesPlugin ( $this->name ) ) {
-				echo "checked";
-			}
-			echo " /><br/>";
-			echo "</td>";
-			echo "<td>";
-			echo "<strong>Use ".$this->text." Plugin</strong>";
-			echo "</td>";
-			echo "</tr>";
-		} elseif ($hookname == "groupisactivecheckboxpost") {
-			// this code actually activates/deactivates the plugin after the form was submitted in the project edit public info page
-			$group_id=$params['group'];
-			$group = &group_get_object($group_id);
-			$use_doaprdfplugin = getStringFromRequest('use_doaprdfplugin');
-			if ( $use_doaprdfplugin == 1 ) {
-				$group->setPluginUse ( $this->name );
-			} else {
-				$group->setPluginUse ( $this->name, false );
-			}
-		} elseif ($hookname == "user_personal_links") {
-			// this displays the link in the user's profile page to it's personal DoaPRDF (if you want other sto access it, youll have to change the permissions in the index.php
-			$userid = $params['user_id'];
-			$user = user_get_object($userid);
-			$text = $params['text'];
-			//check if the user has the plugin activated
-			if ($user->usesPlugin($this->name)) {
-				echo '	<p>' ;
-				echo util_make_link ("/plugins/doaprdf/index.php?id=$userid&type=user&pluginname=".$this->name,
-						     _('View Personal DoaPRDF')
-					);
-				echo '</p>';
-			}
-		} elseif ($hookname == "project_admin_plugins") {
-			// this displays the link in the project admin options page to it's  DoaPRDF administration
-			$group_id = $params['group_id'];
-			$group = &group_get_object($group_id);
-			if ( $group->usesPlugin ( $this->name ) ) {
-				echo '<p>'.util_make_link ("/plugins/doaprdf/admin/index.php?id=".$group->getID().'&type=admin&pluginname='.$this->name,
-						     _('DoaPRDF Admin')).'</p>' ;
-			}
-		}
-		elseif ($hookname == "blahblahblah") {
-			// ...
-		}
-	}
-	*/
 
 	/**
 	 * Declares itself as accepting RDF XML on /users

Modified: trunk/src/plugins/foafprofiles/include/foafprofilesPlugin.class.php
===================================================================
--- trunk/src/plugins/foafprofiles/include/foafprofilesPlugin.class.php	2011-09-21 08:18:12 UTC (rev 14455)
+++ trunk/src/plugins/foafprofiles/include/foafprofilesPlugin.class.php	2011-09-21 08:18:15 UTC (rev 14456)
@@ -29,104 +29,11 @@
 	public function __construct($id=0) {
 		$this->Plugin($id) ;
 		$this->name = "foafprofiles";
-		$this->text = "FOAFProfiles!"; // To show in the tabs, use...
-		//$this->_addHook("user_personal_links");//to make a link to the user's personal part of the plugin
-		//$this->_addHook("usermenu");
-		//$this->_addHook("groupmenu");	// To put into the project tabs
-		//$this->_addHook("groupisactivecheckbox"); // The "use ..." checkbox in editgroupinfo
-		//$this->_addHook("groupisactivecheckboxpost"); //
-		//$this->_addHook("userisactivecheckbox"); // The "use ..." checkbox in user account
-		//$this->_addHook("userisactivecheckboxpost"); //
-		//$this->_addHook("project_admin_plugins"); // to show up in the admin page fro group
+		$this->text = "User FOAF Profiles"; // To show in the tabs, use...
 		$this->_addHook("script_accepted_types");
 		$this->_addHook("content_negociated_user_home");
 
 	}
-/*
-	function CallHook ($hookname, &$params) {
-		global $use_foafprofilesplugin,$G_SESSION,$HTML;
-		if ($hookname == "usermenu") {
-			$text = $this->text; // this is what shows in the tab
-			if ($G_SESSION->usesPlugin("foafprofiles")) {
-				$param = '?type=user&id=' . $G_SESSION->getId() . "&pluginname=" . $this->name; // we indicate the part we're calling is the user one
-				echo ' | ' . $HTML->PrintSubMenu (array ($text),
-						  array ('/plugins/foafprofiles/index.php' . $param ));
-			}
-		} elseif ($hookname == "groupmenu") {
-			$group_id=$params['group'];
-			$project = &group_get_object($group_id);
-			if (!$project || !is_object($project)) {
-				return;
-			}
-			if ($project->isError()) {
-				return;
-			}
-			if (!$project->isProject()) {
-				return;
-			}
-			if ( $project->usesPlugin ( $this->name ) ) {
-				$params['TITLES'][]=$this->text;
-				$params['DIRS'][]=util_make_url ('/plugins/foafprofiles/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name) ; // we indicate the part we're calling is the project one
-			} else {
-				$params['TITLES'][]=$this->text." is [Off]";
-				$params['DIRS'][]='';
-			}
-			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
-		} elseif ($hookname == "groupisactivecheckbox") {
-			//Check if the group is active
-			// this code creates the checkbox in the project edit public info page to activate/deactivate the plugin
-			$group_id=$params['group'];
-			$group = &group_get_object($group_id);
-			echo "<tr>";
-			echo "<td>";
-			echo ' <input type="checkbox" name="use_foafprofilesplugin" value="1" ';
-			// checked or unchecked?
-			if ( $group->usesPlugin ( $this->name ) ) {
-				echo "checked";
-			}
-			echo " /><br/>";
-			echo "</td>";
-			echo "<td>";
-			echo "<strong>Use ".$this->text." Plugin</strong>";
-			echo "</td>";
-			echo "</tr>";
-		} elseif ($hookname == "groupisactivecheckboxpost") {
-			// this code actually activates/deactivates the plugin after the form was submitted in the project edit public info page
-			$group_id=$params['group'];
-			$group = &group_get_object($group_id);
-			$use_foafprofilesplugin = getStringFromRequest('use_foafprofilesplugin');
-			if ( $use_foafprofilesplugin == 1 ) {
-				$group->setPluginUse ( $this->name );
-			} else {
-				$group->setPluginUse ( $this->name, false );
-			}
-		} elseif ($hookname == "user_personal_links") {
-			// this displays the link in the user's profile page to it's personal FOAFProfiles (if you want other sto access it, youll have to change the permissions in the index.php
-			$userid = $params['user_id'];
-			$user = user_get_object($userid);
-			$text = $params['text'];
-			//check if the user has the plugin activated
-			if ($user->usesPlugin($this->name)) {
-				echo '	<p>' ;
-				echo util_make_link ("/plugins/foafprofiles/index.php?id=$userid&type=user&pluginname=".$this->name,
-						     _('View Personal FOAFProfiles')
-					);
-				echo '</p>';
-			}
-		} elseif ($hookname == "project_admin_plugins") {
-			// this displays the link in the project admin options page to it's  FOAFProfiles administration
-			$group_id = $params['group_id'];
-			$group = &group_get_object($group_id);
-			if ( $group->usesPlugin ( $this->name ) ) {
-				echo '<p>'.util_make_link ("/plugins/foafprofiles/admin/index.php?id=".$group->getID().'&type=admin&pluginname='.$this->name,
-						     _('FOAFProfiles Admin')).'</p>' ;
-			}
-		}
-		elseif ($hookname == "blahblahblah") {
-			// ...
-		}
-	}
-	*/
 
 	/**
 	 * Declares itself as accepting RDF XML on /users




More information about the Fusionforge-commits mailing list