[Fusionforge-commits] r10399 - trunk/src/plugins/wiki/common

Marc-Etienne VARGENAU vargenau at libremir.placard.fr.eu.org
Thu Sep 2 21:27:03 CEST 2010


Author: vargenau
Date: 2010-09-02 21:27:03 +0200 (Thu, 02 Sep 2010)
New Revision: 10399

Modified:
   trunk/src/plugins/wiki/common/WikiPlugin.class.php
Log:
Remove unused hooks (personal wiki) and hooks implemented at plugin level

Modified: trunk/src/plugins/wiki/common/WikiPlugin.class.php
===================================================================
--- trunk/src/plugins/wiki/common/WikiPlugin.class.php	2010-09-02 19:15:06 UTC (rev 10398)
+++ trunk/src/plugins/wiki/common/WikiPlugin.class.php	2010-09-02 19:27:03 UTC (rev 10399)
@@ -30,14 +30,10 @@
 		$this->Plugin() ;
 		$this->name = "wiki" ;
 		$this->text = "Wiki" ; // To show in the tabs, use...
-//		$this->hooks[] = "user_personal_links"; //to make a link to the user's personal wiki
-//		$this->hooks[] = "usermenu" ;
 		$this->hooks[] = "groupmenu";
 		$this->hooks[] = "groupisactivecheckbox" ; // The "use ..." checkbox in editgroupinfo
 		$this->hooks[] = "groupisactivecheckboxpost" ; // 
 		$this->hooks[] = "project_admin_plugins"; // to show up in the project admin page
-//		$this->hooks[] = "userisactivecheckbox" ; // The "use ..." checkbox in user account
-//		$this->hooks[] = "userisactivecheckboxpost" ; // 
 		$this->hooks[] = 'search_engines';
 		$this->hooks[] = 'full_search_engines';
 		$this->hooks[] = 'cssfile';
@@ -49,18 +45,7 @@
 		if (is_array($params) && isset($params['group']))
 			$group_id=$params['group'];
 		$use_wikiplugin = getIntFromRequest('use_wikiplugin');
-		if ($hookname == "usermenu") {
-			$text = $this->text;
-			if ( ($G_SESSION) && ($G_SESSION->usesPlugin("wiki")) ) {
-				$param = '?id=' . $G_SESSION->getId() . '&type=u';
-				echo ' | ' . $HTML->PrintSubMenu (array ($text),
-						  array ('/wiki/u/'. $user_name.'/HomePage' ));
-			} else {
-				$this->hooks["usermenu"] = "" ;
-				//$param = "?off=true";
-			}
-			
-		} elseif ($hookname == "groupmenu") {
+		if ($hookname == "groupmenu") {
 			$project = &group_get_object($group_id);
 			if (!$project || !is_object($project))
 				return;
@@ -76,7 +61,7 @@
 				//$params['TITLES'][]=$this->text." [Off]";
 				//$params['DIRS'][]='/plugins/wiki/index.php?off=true';
 			}
-							
+
 			if (isset($params['toptab'])) {
 				(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
 			}
@@ -103,54 +88,13 @@
 			} else {
 				$group->setPluginUse ( $this->name, false );
 			}
-                } elseif ($hookname == "project_admin_plugins") {
-                        // this displays the link in the project admin options page to its administration page.
-                        $group_id = $params['group_id'];
-                        $group = &group_get_object($group_id);
-                        if ( $group->usesPlugin ( $this->name ) ) {
-                                echo '<p><a href="/plugins/wiki/wikiadmin.php?id=' . $group->getID() . '&amp;type=admin&amp;pluginname=' . $this->name . '">' . _('Wiki Admin') . '</a></p>';
-                        }
-		} elseif ($hookname == "userisactivecheckbox") {
-			//check if user is active
-			$user = $params['user'];
-			echo "<tr>";
-			echo "<td>";
-			echo ' <input type="checkbox" name="use_wikiplugin" value="1" ';
-			// checked or unchecked?
-			if ( $user->usesPlugin ( $this->name ) ) {
-				echo "checked=\"checked\"";
-                            }
-
-			echo " />    Use ".$this->text." Plugin";
-			echo "</td>";
-			echo "</tr>";
-		} elseif ($hookname == "userisactivecheckboxpost") {
-			$user = $params['user'];
-			if ( getIntFromRequest('use_wikiplugin') == 1 ) {
-				$user->setPluginUse ( $this->name );
-			} else {
-				$user->setPluginUse ( $this->name, false );
+		} elseif ($hookname == "project_admin_plugins") {
+			// this displays the link in the project admin options page to its administration page.
+			$group_id = $params['group_id'];
+			$group = &group_get_object($group_id);
+			if ( $group->usesPlugin ( $this->name ) ) {
+				echo '<p><a href="/plugins/wiki/wikiadmin.php?id=' . $group->getID() . '&amp;type=admin&amp;pluginname=' . $this->name . '">' . _('Wiki Admin') . '</a></p>';
 			}
-			echo "<tr>";
-			echo "<td>";
-			echo ' <input type="checkbox" name="use_wikiplugin" value="1" ';
-			// checked or unchecked?
-			if ( $user->usesPlugin ( $this->name ) ) {
-				echo "checked=\"checked\"";
-                            }
-
-			echo " />    Use ".$this->text." Plugin";
-			echo "</td>";
-			echo "</tr>";
-		} elseif ($hookname == "user_personal_links") {
-			$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>
-					<a href="/plugins/wiki/index.php?id=' . $userid . '&type=u">' . _("View Personal Wiki") .'</a></p>';
-			}
 		} elseif ($hookname == 'search_engines') {
 			// FIXME: when the hook is called, the group_id is not set.
 			// So I use the global variable instead.




More information about the Fusionforge-commits mailing list