[evolvis-commits] r15668: Remove unused hooks (personal wiki) and hooks implemented at plugin level
mirabilos at evolvis.org
mirabilos at evolvis.org
Tue Mar 1 00:23:52 CET 2011
Author: mirabilos
Date: 2011-03-01 00:23:52 +0100 (Tue, 01 Mar 2011)
New Revision: 15668
Modified:
trunk/gforge_base/evolvisforge-5.1/src/plugins/wiki/common/WikiPlugin.class.php
Log:
Remove unused hooks (personal wiki) and hooks implemented at plugin level
Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/wiki/common/WikiPlugin.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/wiki/common/WikiPlugin.class.php 2011-02-28 23:23:49 UTC (rev 15667)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/wiki/common/WikiPlugin.class.php 2011-02-28 23:23:52 UTC (rev 15668)
@@ -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() . '&type=admin&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() . '&type=admin&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 evolvis-commits
mailing list