[Fusionforge-commits] r12461 - in trunk/src: common/include plugins/contribtracker/common plugins/extratabs/common plugins/hudson/include plugins/mailman/include plugins/mantis/include plugins/mediawiki/common plugins/oslc/include plugins/quota_management/common plugins/wiki/common

Franck VILLAUME nerville at fusionforge.org
Tue Mar 1 18:02:29 CET 2011


Author: nerville
Date: 2011-03-01 18:02:26 +0100 (Tue, 01 Mar 2011)
New Revision: 12461

Modified:
   trunk/src/common/include/Navigation.class.php
   trunk/src/plugins/contribtracker/common/ContribTrackerPlugin.class.php
   trunk/src/plugins/extratabs/common/ExtraTabsPlugin.class.php
   trunk/src/plugins/hudson/include/hudsonPlugin.class.php
   trunk/src/plugins/mailman/include/mailmanPlugin.class.php
   trunk/src/plugins/mantis/include/MantisPlugin.class.php
   trunk/src/plugins/mediawiki/common/MediaWikiPlugin.class.php
   trunk/src/plugins/oslc/include/oslcPlugin.class.php
   trunk/src/plugins/quota_management/common/quota_managementPlugin.class.php
   trunk/src/plugins/wiki/common/WikiPlugin.class.php
Log:
add admin urls in groupmenu hook

Modified: trunk/src/common/include/Navigation.class.php
===================================================================
--- trunk/src/common/include/Navigation.class.php	2011-03-01 17:00:47 UTC (rev 12460)
+++ trunk/src/common/include/Navigation.class.php	2011-03-01 17:02:26 UTC (rev 12461)
@@ -10,7 +10,7 @@
  * it under the terms of the GNU General Public License as published
  * by the Free Software Foundation; either version 2 of the License,
  * or (at your option) any later version.
- * 
+ *
  * FusionForge is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -23,7 +23,7 @@
  */
 
 require_once $gfwww.'search/include/SearchManager.class.php';
- 
+
 /**
  * This class provides all the navigational elements to be used by the themes,
  * like the site menu, the project menus, and the user links.
@@ -68,15 +68,15 @@
 	/** Get the HTML code for the favicon links of the site (to be
 	 *  put into the <head>. If $asHTML is false, it will return
 	 *  the URL of the favicon.
-	 * 
+	 *
 	 * @todo: Make favicon configurable
 	 */
 	function getFavIcon($asHTML = true) {
 		if (!$asHTML) {
 			return util_make_url('/images/icon.png');
 		} else {
-			return '<link rel="icon" type="image/png" href="' 
-				. $this->getFavIcon(false) .'" />' 
+			return '<link rel="icon" type="image/png" href="'
+				. $this->getFavIcon(false) .'" />'
 				. '<link rel="shortcut icon" type="image/png" href="'
 				. $this->getFavIcon(false) .'" />';
 		}
@@ -130,7 +130,7 @@
 		}
 
 		$defaultWords = htmlspecialchars($defaultWords);
-		
+
 		// if there is no search currently, set the default
 		if (!isset($type_of_search) ) {
 			$exact = 1;
@@ -153,7 +153,7 @@
 			<select name="type_of_search">';
 		for($i = 0, $max = count($searchEngines); $i < $max; $i++) {
 			$searchEngine =& $searchEngines[$i];
-			$res .= '<option value="' . $searchEngine->getType() . '"' 
+			$res .= '<option value="' . $searchEngine->getType() . '"'
 				. ( $type_of_search == $searchEngine->getType() ? ' selected="selected"' : '' )
 				. '>' . $searchEngine->getLabel($parameters) . '</option>' . "\n";
 		}
@@ -163,12 +163,12 @@
 		foreach($parameters AS $name => $value) {
 			$res .= '<input type="hidden" value="'.$value.'" name="'.$name.'" />' . "\n";
 		}
-		$res .= '<input type="text" size="12" id="searchBox-words" name="words" value="' 
+		$res .= '<input type="text" size="12" id="searchBox-words" name="words" value="'
 			. $defaultWords . '" />' . "\n";
 		$res .= '<input type="submit" name="Search" value="'._('Search').'" />' . "\n";
 
 		if (isset($group_id) && $group_id) {
-			$res .= util_make_link('/search/advanced_search.php?group_id=' . 
+			$res .= util_make_link('/search/advanced_search.php?group_id=' .
 					       $group_id, _('Advanced search'));
 		}
 		$res .= '</div>';
@@ -277,7 +277,7 @@
 			}
 		}
 
-		// Admin and Reporting 
+		// Admin and Reporting
 		if (forge_check_global_perm('forge_admin')) {
 			$user_is_super = true;
 			$menu['titles'][] = _('Site Admin');
@@ -295,7 +295,7 @@
 		}
 
 		// Project
-		if (isset($GLOBALS['group_id'])) { 
+		if (isset($GLOBALS['group_id'])) {
 			// get group info using the common result set
 			$project =& group_get_object($GLOBALS['group_id']);
 			if ($project && is_object($project)) {
@@ -334,7 +334,7 @@
 		// rebuild menu if it has never been built before, or
 		// if the toptab was set differently
 		if (!isset($this->project_menu_data[$group_id])
-			|| ($toptab != "") 
+			|| ($toptab != "")
 			|| ($toptab != $this->project_menu_data[$group_id]['last_toptab'])) {
 			// get the group and permission objects
 			$group = group_get_object($group_id);
@@ -390,7 +390,7 @@
 			 $TABS_TITLES[]=_('Home Page');
                         */
 
-                        // Project Activity tab 
+                        // Project Activity tab
                         $menu['titles'][] = _('Activity');
                         $menu['urls'][] = util_make_uri('/activity/?group_id=' . $group_id);
                         $menu['adminurls'][] = false;
@@ -421,9 +421,9 @@
                                 } else {
                                         $menu['adminurls'][] = false;
                                 }
-                                if ($toptab == "tracker" || 
-                                    $toptab == "bugs" || 
-                                    $toptab == "support" || 
+                                if ($toptab == "tracker" ||
+                                    $toptab == "bugs" ||
+                                    $toptab == "support" ||
                                     $toptab == "patch") {
 					$selected = (count($menu['urls'])-1);
 				}
@@ -521,7 +521,7 @@
                         $hookParams['TITLES'] =& $menu['titles'];
                         $hookParams['toptab'] =& $toptab;
                         $hookParams['selected'] =& $selected;
-                        plugin_hook ("groupmenu_scm", $hookParams) ; 
+                        plugin_hook ("groupmenu_scm", $hookParams) ;
 
                         // fill up adminurls
                         for ($i = 0; $i < count($menu['urls']) - count($menu['adminurls']); $i++) {
@@ -546,6 +546,7 @@
 			$hookParams = array();
 			$hookParams['group'] = $group_id ;
 			$hookParams['DIRS'] =& $menu['urls'];
+			$hookParams['ADMIN'] =& $menu['adminurls'];
 			$hookParams['TITLES'] =& $menu['titles'];
 			$hookParams['toptab'] =& $toptab;
 			$hookParams['selected'] =& $selected;
@@ -576,8 +577,8 @@
 	function getPoweredBy($asHTML=true) {
 		$res['url'] = 'http://fusionforge.org/';
 		$res['image'] = util_make_uri('/images/pow-fusionforge.png');
-		$res['title'] = '<img src="' 
-			. $res['image'] 
+		$res['title'] = '<img src="'
+			. $res['image']
 			. '" alt="Powered By FusionForge" border="0" />';
 		$res['html'] = util_make_link($res['url'], $res['title'], array(), true);
 		if ($asHTML) {
@@ -599,13 +600,13 @@
                         $res['url'] = util_make_url('/source.php?file='.getStringFromServer('SCRIPT_NAME'));
                         $res['title'] = _('Show source');
 		} else {
-                        return ($asHTML ? "" : NULL); 
+                        return ($asHTML ? "" : NULL);
 		}
                 if (!$asHTML) {
                         return $res;
 		} else {
-                        return util_make_link($res['url'], $res['title'], 
-                                              array('class' => 'showsource'), 
+                        return util_make_link($res['url'], $res['title'],
+                                              array('class' => 'showsource'),
                                               true);
 		}
 	}

Modified: trunk/src/plugins/contribtracker/common/ContribTrackerPlugin.class.php
===================================================================
--- trunk/src/plugins/contribtracker/common/ContribTrackerPlugin.class.php	2011-03-01 17:00:47 UTC (rev 12460)
+++ trunk/src/plugins/contribtracker/common/ContribTrackerPlugin.class.php	2011-03-01 17:02:26 UTC (rev 12461)
@@ -51,6 +51,7 @@
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][] = '<nobr>'._('Contribution tracker').'</nobr>' ;
 				$params['DIRS'][]='/plugins/'.$this->name.'/?group_id=' . $group_id ;
+                $params['ADMIN'][]='';
 			}
 			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
 		} elseif ($hookname == "groupisactivecheckbox") {

Modified: trunk/src/plugins/extratabs/common/ExtraTabsPlugin.class.php
===================================================================
--- trunk/src/plugins/extratabs/common/ExtraTabsPlugin.class.php	2011-03-01 17:00:47 UTC (rev 12460)
+++ trunk/src/plugins/extratabs/common/ExtraTabsPlugin.class.php	2011-03-01 17:02:26 UTC (rev 12461)
@@ -68,10 +68,12 @@
 					switch ($row_tab['type']) {
 					case 0: // Link
 						$params['DIRS'][] = $row_tab['tab_url'];
+                        $params['ADMIN'][] = '';
 						break;
 						
 					case 1: // Iframe
 						$params['DIRS'][] = '/plugins/'.$this->name.'/iframe.php?group_id='.$group_id.'&tab_name='.$row_tab['tab_name'];
+                        $params['ADMIN'][] = '';
 						if (isset($params['toptab']) && ($params['toptab'] == $row_tab['tab_name'])) {
 							$params['selected'] = count($params['TITLES']) - 1;
 						}

Modified: trunk/src/plugins/hudson/include/hudsonPlugin.class.php
===================================================================
--- trunk/src/plugins/hudson/include/hudsonPlugin.class.php	2011-03-01 17:00:47 UTC (rev 12460)
+++ trunk/src/plugins/hudson/include/hudsonPlugin.class.php	2011-03-01 17:02:26 UTC (rev 12461)
@@ -62,6 +62,7 @@
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
 				$params['DIRS'][]='/plugins/hudson/index.php?group_id=' . $group_id . "&pluginname=" . $this->name; // we indicate the part we're calling is the project one
+                $params['ADMIN'][]='';
 			} 
 			if (isset($params['toptab'])) {
 				(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );

Modified: trunk/src/plugins/mailman/include/mailmanPlugin.class.php
===================================================================
--- trunk/src/plugins/mailman/include/mailmanPlugin.class.php	2011-03-01 17:00:47 UTC (rev 12460)
+++ trunk/src/plugins/mailman/include/mailmanPlugin.class.php	2011-03-01 17:02:26 UTC (rev 12461)
@@ -94,6 +94,7 @@
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
 				$params['DIRS'][]='/plugins/mailman/index.php?group_id=' . $group_id . "&pluginname=" . $this->name; // we indicate the part we�re calling is the project one
+                $params['ADMIN'][]='';
 			} 
 			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
 		} elseif ($hookname == "groupisactivecheckbox") {

Modified: trunk/src/plugins/mantis/include/MantisPlugin.class.php
===================================================================
--- trunk/src/plugins/mantis/include/MantisPlugin.class.php	2011-03-01 17:00:47 UTC (rev 12460)
+++ trunk/src/plugins/mantis/include/MantisPlugin.class.php	2011-03-01 17:02:26 UTC (rev 12461)
@@ -66,9 +66,11 @@
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
 				$params['DIRS'][]=util_make_url ('/plugins/mantis/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name) ; // we indicate the part we're calling is the project one
+                $params['ADMIN'][]='';
 			} else {
 				$params['TITLES'][]=$this->text." is [Off]";
 				$params['DIRS'][]='';
+                $params['ADMIN'][]='';
 			}	
 			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
 		} elseif ($hookname == "groupisactivecheckbox") {

Modified: trunk/src/plugins/mediawiki/common/MediaWikiPlugin.class.php
===================================================================
--- trunk/src/plugins/mediawiki/common/MediaWikiPlugin.class.php	2011-03-01 17:00:47 UTC (rev 12460)
+++ trunk/src/plugins/mediawiki/common/MediaWikiPlugin.class.php	2011-03-01 17:02:26 UTC (rev 12461)
@@ -78,6 +78,7 @@
 				} else {
 					$params['DIRS'][]=util_make_url('/plugins/mediawiki/wiki/'.$project->getUnixName().'/index.php');
 				}
+                $params['ADMIN'][]='';
 			}
 			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
 		} elseif ($hookname == "groupisactivecheckbox") {

Modified: trunk/src/plugins/oslc/include/oslcPlugin.class.php
===================================================================
--- trunk/src/plugins/oslc/include/oslcPlugin.class.php	2011-03-01 17:00:47 UTC (rev 12460)
+++ trunk/src/plugins/oslc/include/oslcPlugin.class.php	2011-03-01 17:02:26 UTC (rev 12461)
@@ -60,9 +60,11 @@
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
 				$params['DIRS'][]=util_make_uri('/plugins/oslc/');
+                $params['ADMIN'][]='';
 			} else {
 				$params['TITLES'][]=$this->text." is [Off]";
 				$params['DIRS'][]='';
+                $params['ADMIN'][]='';
 			}	
 			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
 		} elseif ($hookname == "groupisactivecheckbox") {

Modified: trunk/src/plugins/quota_management/common/quota_managementPlugin.class.php
===================================================================
--- trunk/src/plugins/quota_management/common/quota_managementPlugin.class.php	2011-03-01 17:00:47 UTC (rev 12460)
+++ trunk/src/plugins/quota_management/common/quota_managementPlugin.class.php	2011-03-01 17:02:26 UTC (rev 12461)
@@ -63,6 +63,7 @@
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
 				$params['DIRS'][]=util_make_url ('/plugins/quota_management/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name) ; // we indicate the part we're calling is the project one
+                $params['ADMIN'][]='';
 			} else {
 			//	$params['TITLES'][]=$this->text." is [Off]";
 			}	

Modified: trunk/src/plugins/wiki/common/WikiPlugin.class.php
===================================================================
--- trunk/src/plugins/wiki/common/WikiPlugin.class.php	2011-03-01 17:00:47 UTC (rev 12460)
+++ trunk/src/plugins/wiki/common/WikiPlugin.class.php	2011-03-01 17:02:26 UTC (rev 12461)
@@ -57,6 +57,7 @@
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
 				$params['DIRS'][]='/wiki/g/'.$project->getUnixName().'/HomePage';
+                $params['ADMIN'][]='';
 			} else {
 				$this->hooks["groupmenu"] = "";
 				//$params['TITLES'][]=$this->text." [Off]";




More information about the Fusionforge-commits mailing list