[Fusionforge-commits] r9458 - trunk/plugins/templates/helloworld/include

Christian Bayle cbayle at libremir.placard.fr.eu.org
Mon Apr 12 14:42:10 CEST 2010


Author: cbayle
Date: 2010-04-12 14:42:10 +0200 (Mon, 12 Apr 2010)
New Revision: 9458

Modified:
   trunk/plugins/templates/helloworld/include/helloworldPlugin.class.php
Log:
Make constructor more 'object oriented'


Modified: trunk/plugins/templates/helloworld/include/helloworldPlugin.class.php
===================================================================
--- trunk/plugins/templates/helloworld/include/helloworldPlugin.class.php	2010-04-11 09:43:32 UTC (rev 9457)
+++ trunk/plugins/templates/helloworld/include/helloworldPlugin.class.php	2010-04-12 12:42:10 UTC (rev 9458)
@@ -22,18 +22,18 @@
  */
 
 class helloworldPlugin extends Plugin {
-	function helloworldPlugin () {
-		$this->Plugin() ;
-		$this->name = "helloworld" ;
-		$this->text = "HelloWorld!" ; // To show in the tabs, use...
-		$this->hooks[] = "user_personal_links";//to make a link to the user's personal part of the plugin
-		$this->hooks[] = "usermenu" ;
-		$this->hooks[] = "groupmenu" ;	// To put into the project tabs
-		$this->hooks[] = "groupisactivecheckbox" ; // The "use ..." checkbox in editgroupinfo
-		$this->hooks[] = "groupisactivecheckboxpost" ; //
-		$this->hooks[] = "userisactivecheckbox" ; // The "use ..." checkbox in user account
-		$this->hooks[] = "userisactivecheckboxpost" ; //
-		$this->hooks[] = "project_admin_plugins"; // to show up in the admin page fro group
+	public function __construct($id=0) {
+		$this->Plugin($id) ;
+		$this->name = "helloworld";
+		$this->text = "HelloWorld!"; // 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
 	}
 
 	function CallHook ($hookname, $params) {
@@ -144,7 +144,7 @@
 			$group_id = $params['group_id'];
 			$group = &group_get_object($group_id);
 			if ( $group->usesPlugin ( $this->name ) ) {
-				echo util_make_link ("/plugins/projects_hierarchy/index.php?id=".$group->getID().'&type=admin&pluginname='.$this->name,
+				echo util_make_link ("/plugins/helloworld/admin/index.php?id=".$group->getID().'&type=admin&pluginname='.$this->name,
 						     _('View the HelloWorld Administration')) ;
 				echo '</p>';
 			}




More information about the Fusionforge-commits mailing list