[Fusionforge-commits] r8664 - trunk/gforge/plugins/mediawiki/common

Julien HEYMAN jheyman at libremir.placard.fr.eu.org
Wed Jan 13 14:32:44 CET 2010


Author: jheyman
Date: 2010-01-13 14:32:44 +0100 (Wed, 13 Jan 2010)
New Revision: 8664

Modified:
   trunk/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php
Log:
Add hook into mediawiki plugin

Modified: trunk/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php
===================================================================
--- trunk/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php	2010-01-13 09:45:53 UTC (rev 8663)
+++ trunk/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php	2010-01-13 13:32:44 UTC (rev 8664)
@@ -29,6 +29,7 @@
 		$this->hooks[] = "groupmenu" ;	// To put into the project tabs
 		$this->hooks[] = "groupisactivecheckbox" ; // The "use ..." checkbox in editgroupinfo
 		$this->hooks[] = "groupisactivecheckboxpost" ; //
+		$this->hooks[] = "project_public_area";
 	}
 
 	function CallHook ($hookname, $params) {
@@ -87,6 +88,24 @@
 			} else {
 				$group->setPluginUse ( $this->name, false );
 			}
+		} elseif ($hookname == "project_public_area") {
+			$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 ) ) {
+				print '<hr size="1" />';
+				print '<a href='. util_make_url ('/plugins/mediawiki/wiki/'.$project->getUnixName().'/index.php').'>';
+				print html_abs_image(util_make_url ('/plugins/mediawiki/wiki/'.$project->getUnixName().'/skins/fusionforge/wiki.png'),'20','20',array('alt'=>'Mediawiki'));
+				print 'Mediawiki';
+				print '</a>';
+			}
 		} elseif ($hookname == "blahblahblah") {
 			// ...
 		} 




More information about the Fusionforge-commits mailing list