[Fusionforge-commits] r7516 - in trunk/gforge: common/include plugins/helloworld/common plugins/mantis/include plugins/mediawiki/common plugins/projects_hierarchy/common plugins/quota_management/common plugins/webcalendar/common plugins/wiki/include www/include www/themes/gforge www/themes/gforge-simple-theme

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Apr 29 11:00:37 CEST 2009


Author: lolando
Date: 2009-04-29 11:00:37 +0200 (Wed, 29 Apr 2009)
New Revision: 7516

Modified:
   trunk/gforge/common/include/utils.php
   trunk/gforge/plugins/helloworld/common/HelloWorldPlugin.class.php
   trunk/gforge/plugins/mantis/include/MantisPlugin.class.php
   trunk/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php
   trunk/gforge/plugins/projects_hierarchy/common/projects_hierarchyPlugin.class.php
   trunk/gforge/plugins/quota_management/common/quota_managementPlugin.class.php
   trunk/gforge/plugins/webcalendar/common/webcalendarPlugin.class.php
   trunk/gforge/plugins/wiki/include/WikiPlugin.class.php
   trunk/gforge/www/include/Layout.class.php
   trunk/gforge/www/themes/gforge-simple-theme/Theme.class.php
   trunk/gforge/www/themes/gforge/Theme.class.php
Log:
Extratabs plugin needs that the URLs passed to the groupmenu be already absolute -- out-of-tree plugins and themes will need to be updated

Modified: trunk/gforge/common/include/utils.php
===================================================================
--- trunk/gforge/common/include/utils.php	2009-04-29 09:00:21 UTC (rev 7515)
+++ trunk/gforge/common/include/utils.php	2009-04-29 09:00:37 UTC (rev 7516)
@@ -938,14 +938,18 @@
 	return $url ;
 }
 
-function util_make_link ($path, $text, $extra_params=false) {
+function util_make_link ($path, $text, $extra_params=false, $absolute=false) {
 	$ep = '' ;
 	if (is_array($extra_params)) {
 		foreach ($extra_params as $key => $value) {
 			$ep .= "$key=\"$value\" ";
 		}
 	}
-	return '<a ' . $ep . 'href="' . util_make_url ($path) . '">' . $text . '</a>' ;
+	if ($absolute) {
+		return '<a ' . $ep . 'href="' . $path . '">' . $text . '</a>' ;
+	} else {
+		return '<a ' . $ep . 'href="' . util_make_url ($path) . '">' . $text . '</a>' ;
+	}
 }
 
 function util_make_link_u ($username, $user_id,$text) {

Modified: trunk/gforge/plugins/helloworld/common/HelloWorldPlugin.class.php
===================================================================
--- trunk/gforge/plugins/helloworld/common/HelloWorldPlugin.class.php	2009-04-29 09:00:21 UTC (rev 7515)
+++ trunk/gforge/plugins/helloworld/common/HelloWorldPlugin.class.php	2009-04-29 09:00:37 UTC (rev 7516)
@@ -59,7 +59,7 @@
 			}
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
-				$params['DIRS'][]='/plugins/helloworld/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name; // we indicate the part we're calling is the project one
+				$params['DIRS'][]=util_make_url ('/plugins/helloworld/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name) ; // we indicate the part we're calling is the project one
 			} else {
 				$params['TITLES'][]=$this->text." is [Off]";
 				$params['DIRS'][]='';

Modified: trunk/gforge/plugins/mantis/include/MantisPlugin.class.php
===================================================================
--- trunk/gforge/plugins/mantis/include/MantisPlugin.class.php	2009-04-29 09:00:21 UTC (rev 7515)
+++ trunk/gforge/plugins/mantis/include/MantisPlugin.class.php	2009-04-29 09:00:37 UTC (rev 7516)
@@ -59,7 +59,7 @@
 			}
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
-				$params['DIRS'][]='/plugins/mantis/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name; // we indicate the part we're calling is the project one
+				$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
 			} else {
 				$params['TITLES'][]=$this->text." is [Off]";
 				$params['DIRS'][]='';

Modified: trunk/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php
===================================================================
--- trunk/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php	2009-04-29 09:00:21 UTC (rev 7515)
+++ trunk/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php	2009-04-29 09:00:37 UTC (rev 7516)
@@ -49,7 +49,7 @@
 		}
 		if ($hookname == "outermenu") {
 			$params['TITLES'][] = 'MediaWiki';
-			$params['DIRS'][] = '/mediawiki';
+			$params['DIRS'][] = util_make_url ('/mediawiki') ;
 		} elseif ($hookname == "usermenu") {
 			$text = $this->text; // this is what shows in the tab
 			if ($G_SESSION->usesPlugin("mediawiki")) {
@@ -69,7 +69,7 @@
 			}
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
-				$params['DIRS'][]='/plugins/mediawiki/index.php?group_id=' . $project->getID(); 
+				$params['DIRS'][]=util_make_url ('/plugins/mediawiki/index.php?group_id=' . $project->getID()) ; 
 			}
 			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
 		} elseif ($hookname == "groupisactivecheckbox") {

Modified: trunk/gforge/plugins/projects_hierarchy/common/projects_hierarchyPlugin.class.php
===================================================================
--- trunk/gforge/plugins/projects_hierarchy/common/projects_hierarchyPlugin.class.php	2009-04-29 09:00:21 UTC (rev 7515)
+++ trunk/gforge/plugins/projects_hierarchy/common/projects_hierarchyPlugin.class.php	2009-04-29 09:00:37 UTC (rev 7516)
@@ -63,7 +63,7 @@
 			}
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
-				$params['DIRS'][]='/plugins/projects_hierarchy/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name; // we indicate the part we're calling is the project one
+				$params['DIRS'][]=util_make_url ('/plugins/projects_hierarchy/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name) ; // we indicate the part we're calling is the project one
 			} else {
 				//$params['TITLES'][]=$this->text." is [Off]";
 			}	

Modified: trunk/gforge/plugins/quota_management/common/quota_managementPlugin.class.php
===================================================================
--- trunk/gforge/plugins/quota_management/common/quota_managementPlugin.class.php	2009-04-29 09:00:21 UTC (rev 7515)
+++ trunk/gforge/plugins/quota_management/common/quota_managementPlugin.class.php	2009-04-29 09:00:37 UTC (rev 7516)
@@ -62,7 +62,7 @@
 			}
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
-				$params['DIRS'][]='/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['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
 			} else {
 			//	$params['TITLES'][]=$this->text." is [Off]";
 			}	

Modified: trunk/gforge/plugins/webcalendar/common/webcalendarPlugin.class.php
===================================================================
--- trunk/gforge/plugins/webcalendar/common/webcalendarPlugin.class.php	2009-04-29 09:00:21 UTC (rev 7515)
+++ trunk/gforge/plugins/webcalendar/common/webcalendarPlugin.class.php	2009-04-29 09:00:37 UTC (rev 7516)
@@ -76,7 +76,7 @@
 			}
 			if ( !$project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
-				$params['DIRS'][]='/plugins/webcalendar/index2.php?type=group&group_id='.$group_id;
+				$params['DIRS'][]=util_make_url ('/plugins/webcalendar/index2.php?type=group&group_id='.$group_id) ;
 				} else {
 				$params['TITLES'][]=$this->text." is [Off]";
 				$params['DIRS'][]='';

Modified: trunk/gforge/plugins/wiki/include/WikiPlugin.class.php
===================================================================
--- trunk/gforge/plugins/wiki/include/WikiPlugin.class.php	2009-04-29 09:00:21 UTC (rev 7515)
+++ trunk/gforge/plugins/wiki/include/WikiPlugin.class.php	2009-04-29 09:00:37 UTC (rev 7516)
@@ -64,11 +64,11 @@
 				return;
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
-				$params['DIRS'][]='/wiki/g/'.$project->getUnixName().'/HomePage';
+				$params['DIRS'][]=util_make_url ('/wiki/g/'.$project->getUnixName().'/HomePage') ;
 			} else {
 				$this->hooks["groupmenu"] = "";
 				//$params['TITLES'][]=$this->text." [Off]";
-				//$params['DIRS'][]='/plugins/wiki/index.php?off=true';
+				//$params['DIRS'][]=util_make_url ('/plugins/wiki/index.php?off=true') ;
 			}
 							
 			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );

Modified: trunk/gforge/www/include/Layout.class.php
===================================================================
--- trunk/gforge/www/include/Layout.class.php	2009-04-29 09:00:21 UTC (rev 7515)
+++ trunk/gforge/www/include/Layout.class.php	2009-04-29 09:00:37 UTC (rev 7516)
@@ -151,7 +151,7 @@
 <table border="0" width="100%" cellspacing="0" cellpadding="0" id="headertable">
 
 	<tr>
-		<td><a href="<?php echo util_make_url (''); ?>/"><?php echo html_image('logo.png',198,52,array('border'=>'0')); ?></a></td>
+		<td><a href="<?php echo util_make_url ('/'); ?>"><?php echo html_image('logo.png',198,52,array('border'=>'0')); ?></a></td>
 		<td><?php echo $this->searchBox(); ?></td>
 		<td align="right"><?php
 			if (session_loggedin()) {
@@ -412,16 +412,16 @@
 	function outerTabs($params) {
 		global $sys_use_trove,$sys_use_snippet,$sys_use_people,$sys_use_project_tags, $sys_use_project_full_list;
 
-		$TABS_DIRS[]='/';
-		$TABS_DIRS[]='/my/';
+		$TABS_DIRS[]=util_make_url ('/');
+		$TABS_DIRS[]=util_make_url ('/my/');
 		if ($sys_use_trove || $sys_use_project_tags || $sys_use_project_full_list) {
-			$TABS_DIRS[]='/softwaremap/';
+			$TABS_DIRS[]=util_make_url ('/softwaremap/') ;
 		}
 		if ($sys_use_snippet) {
-			$TABS_DIRS[]='/snippet/';
+			$TABS_DIRS[]=util_make_url ('/snippet/') ;
 		}
 		if ($sys_use_people) {
-			$TABS_DIRS[]='/people/';
+			$TABS_DIRS[]=util_make_url ('/people/') ;
 		}
 		$TABS_TITLES[]=_('Home');
 		$TABS_TITLES[]=_('My&nbsp;Page');
@@ -451,11 +451,11 @@
 
 			if ($permmaster->isAdmin()) {
 				$user_is_super=true;
-				$TABS_DIRS[]='/admin/';
+				$TABS_DIRS[]=util_make_url ('/admin/') ;
 				$TABS_TITLES[]=_('Admin');
 			}
 			if ($permstats->isMember()) {
-				$TABS_DIRS[]='/reporting/';
+				$TABS_DIRS[]=util_make_url ('/reporting/') ;
 				$TABS_TITLES[]=_('Reporting');
 			}
 		}
@@ -469,29 +469,29 @@
 
 				} else {
 					if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
-						$TABS_DIRS[]='/project/?group_id'.$project->getId();
+						$TABS_DIRS[]=util_make_url ('/project/?group_id') .$project->getId();
 					} else {
-						$TABS_DIRS[]='/projects/'.$project->getUnixName().'/';
+						$TABS_DIRS[]=util_make_url ('/projects/') .$project->getUnixName().'/';
 					}
 					$TABS_TITLES[]=$project->getPublicName();
 					$selected=count($TABS_DIRS)-1;
 				}
 			}
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),'/my/') || 
-				strstr(getStringFromServer('REQUEST_URI'),'/account/') || 
-				strstr(getStringFromServer('REQUEST_URI'),'/register/') ||  
-				strstr(getStringFromServer('REQUEST_URI'),'/themes/') ) {
-			$selected=array_search("/my/", $TABS_DIRS);
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),'softwaremap')) {
-			$selected=array_search("/softwaremap/", $TABS_DIRS);
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),'/snippet/')) {
-			$selected=array_search("/snippet/", $TABS_DIRS);
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),'/people/')) {
-			$selected=array_search("/people/", $TABS_DIRS);
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),'/reporting/')) {
-			$selected=array_search('/reporting/',$TABS_DIRS);
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),'/admin/') && $user_is_super) {
-			$selected=array_search('/admin/',$TABS_DIRS);
+		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/my/') ) || 
+			  strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/account/') ) || 
+			  strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/register/') ) ||  
+			  strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/themes/') ) ) {
+			$selected=array_search(util_make_url ('/my/'), $TABS_DIRS);
+		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('softwaremap') )) {
+			$selected=array_search(util_make_url ('/softwaremap/'), $TABS_DIRS);
+		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/snippet/') )) {
+			$selected=array_search(util_make_url ('/snippet/'), $TABS_DIRS);
+		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/people/') )) {
+			$selected=array_search(util_make_url ('/people/'), $TABS_DIRS);
+		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/reporting/') )) {
+			$selected=array_search(util_make_url ('/reporting/'),$TABS_DIRS);
+		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/admin/') ) && $user_is_super) {
+			$selected=array_search(util_make_url ('/admin/'),$TABS_DIRS);
 		} elseif (count($PLUGIN_TABS_DIRS)>0) {
 			foreach ($PLUGIN_TABS_DIRS as $PLUGIN_TABS_DIRS_VALUE) {
 				if (strstr(getStringFromServer('REQUEST_URI'),$PLUGIN_TABS_DIRS_VALUE)) {
@@ -529,9 +529,9 @@
 
 		// Summary
 		if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
-			$TABS_DIRS[]='/project/?group_id='. $project->getId();
+			$TABS_DIRS[]=util_make_url ('/project/?group_id=' . $project->getId());
 		} else {
-			$TABS_DIRS[]='/projects/'. $project->getUnixName() .'/';
+			$TABS_DIRS[]=util_make_url ('/projects/' . $project->getUnixName() .'/');
 		}
 		$TABS_TITLES[]=_('Summary');
 		(($toptab == 'home') ? $selected=(count($TABS_TITLES)-1) : '' );
@@ -539,7 +539,7 @@
 		// Project Admin
 		$perm =& $project->getPermission( session_get_user() );
 		if ($perm->isAdmin()) {
-			$TABS_DIRS[]='/project/admin/?group_id='. $group;
+			$TABS_DIRS[]=util_make_url ('/project/admin/?group_id=' . $group);
 			$TABS_TITLES[]=_('Admin');
 			(($toptab == 'admin') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
@@ -550,20 +550,20 @@
 
 		// Project Activity tab 
 
-		$TABS_DIRS[]='/activity/?group_id='. $group;
+		$TABS_DIRS[]=util_make_url ('/activity/?group_id=' . $group);
 		$TABS_TITLES[]=_('Activity');
 		(($toptab == 'activity') ? $selected=(count($TABS_TITLES)-1) : '' );
 
 		// Forums
 		if ($project->usesForum()) {
-			$TABS_DIRS[]='/forum/?group_id='.$group;
+			$TABS_DIRS[]=util_make_url ('/forum/?group_id='.$group);
 			$TABS_TITLES[]=_('Forums');
 			(($toptab == 'forums') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
 		// Artifact Tracking
 		if ($project->usesTracker()) {
-			$TABS_DIRS[]='/tracker/?group_id='.$group;
+			$TABS_DIRS[]=util_make_url ('/tracker/?group_id='.$group);
 			$TABS_TITLES[]=_('Tracker');
 			(($toptab == 'tracker' || $toptab == 'bugs' || $toptab == 'support' || $toptab == 'patch')
 				? $selected=(count($TABS_TITLES)-1) : '' );
@@ -571,42 +571,42 @@
 
 		// Mailing Lists
 		if ($project->usesMail()) {
-			$TABS_DIRS[]='/mail/?group_id='.$group;
+			$TABS_DIRS[]=util_make_url ('/mail/?group_id='.$group);
 			$TABS_TITLES[]=_('Lists');
 			(($toptab == 'mail') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
 		// Project Manager
 		if ($project->usesPm()) {
-			$TABS_DIRS[]='/pm/?group_id='.$group;
+			$TABS_DIRS[]=util_make_url ('/pm/?group_id='.$group);
 			$TABS_TITLES[]=_('Tasks');
 			(($toptab == 'pm') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
 		// Doc Manager
 		if ($project->usesDocman()) {
-			$TABS_DIRS[]='/docman/?group_id='.$group;
+			$TABS_DIRS[]=util_make_url ('/docman/?group_id='.$group);
 			$TABS_TITLES[]=_('Docs');
 			(($toptab == 'docman') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
 		// Surveys
 		if ($project->usesSurvey()) {
-			$TABS_DIRS[]='/survey/?group_id='.$group;
+			$TABS_DIRS[]=util_make_url ('/survey/?group_id='.$group);
 			$TABS_TITLES[]=_('Surveys');
 			(($toptab == 'surveys') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
 		//newsbytes
 		if ($project->usesNews()) {
-			$TABS_DIRS[]='/news/?group_id='.$group;
+			$TABS_DIRS[]=util_make_url ('/news/?group_id='.$group);
 			$TABS_TITLES[]=_('News');
 			(($toptab == 'news') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
 		// SCM systems
 		if ($project->usesSCM()) {
-			$TABS_DIRS[]='/scm/?group_id='.$group;
+			$TABS_DIRS[]=util_make_url ('/scm/?group_id='.$group);
 			$TABS_TITLES[]=_('SCM');
 			(($toptab == 'scm') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
@@ -622,7 +622,7 @@
 
 		// Downloads
 		if ($project->usesFRS()) {
-			$TABS_DIRS[]='/frs/?group_id='.$group;
+			$TABS_DIRS[]=util_make_url ('/frs/?group_id='.$group);
 			$TABS_TITLES[]=_('Files');
 			(($toptab == 'frs') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
@@ -672,7 +672,7 @@
 				$return .= '
 					<td '.$rowspan.'valign="top" width="10" style="background:url('.$this->imgroot . 'theme-'.$inner.'-end-'.(($issel) ? '' : 'not').'selected.png)">'.
 						'<img src="'.$this->imgroot . 'clear.png" height="25" width="10" alt="" /></td>'.
-						'<td '.$rowspan.'style="background:url('.$this->imgroot . $bgimg.')" width="'.$width.'%" align="center">'.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink'))).'</td>';
+					'<td '.$rowspan.'style="background:url('.$this->imgroot . $bgimg.')" width="'.$width.'%" align="center">'.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink')),true).'</td>';
 			} elseif ($i==$count-1) {
 				//
 				//	this is the last tab, choose an image with name-end
@@ -687,7 +687,7 @@
 				$return .= '
 					<td '.$rowspan.'colspan="2" valign="top" width="20" style="background:url('.$this->imgroot . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png)">'.
 						'<img src="'.$this->imgroot . 'clear.png" height="2" width="20" alt="" /></td>'.
-						'<td '.$rowspan.'style="background:url('.$this->imgroot . $bgimg.')" width="'.$width.'%" align="center">'.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink'))).'</td>';
+					'<td '.$rowspan.'style="background:url('.$this->imgroot . $bgimg.')" width="'.$width.'%" align="center">'.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink')),true).'</td>';
 				//
 				//	Last graphic on right-side
 				//
@@ -709,7 +709,7 @@
 				$return .= '
 					<td '.$rowspan.'colspan="2" valign="top" width="20" style="background:url('.$this->imgroot . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png)">'.
 						'<img src="'.$this->imgroot . 'clear.png" height="2" width="20" alt="" /></td>'.
-						'<td '.$rowspan.'style="background:url('.$this->imgroot . $bgimg.')" width="'.$width.'%" align="center">'.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink'))).'</td>';
+					'<td '.$rowspan.'style="background:url('.$this->imgroot . $bgimg.')" width="'.$width.'%" align="center">'.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink')),true).'</td>';
 
 			}
 		}

Modified: trunk/gforge/www/themes/gforge/Theme.class.php
===================================================================
--- trunk/gforge/www/themes/gforge/Theme.class.php	2009-04-29 09:00:21 UTC (rev 7515)
+++ trunk/gforge/www/themes/gforge/Theme.class.php	2009-04-29 09:00:37 UTC (rev 7516)
@@ -368,16 +368,16 @@
     function outerTabs($params) {
         global $sys_use_trove,$sys_use_snippet,$sys_use_people,$sys_use_project_tags,$sys_use_project_full_list;
 
-        $TABS_DIRS[]='/';
-        $TABS_DIRS[]='/my/';
+        $TABS_DIRS[]=util_make_url ('/') ;
+        $TABS_DIRS[]=util_make_url ('/my/') ;
 	if ($sys_use_trove || $sys_use_project_tags || $sys_use_project_full_list) {
-        	$TABS_DIRS[]='/softwaremap/';
+		$TABS_DIRS[]=util_make_url ('/softwaremap/') ;
 	}
         if ($sys_use_snippet) {
-            $TABS_DIRS[]='/snippet/';
+		$TABS_DIRS[]=util_make_url ('/snippet/') ;
         }
         if ($sys_use_people) {
-            $TABS_DIRS[]='/people/';
+		$TABS_DIRS[]=util_make_url ('/people/') ;
         }
         $TABS_TITLES[]=_('Home');
         $TABS_TITLES[]=_('My&nbsp;Page');
@@ -407,11 +407,11 @@
 
 		if ($permmaster->isAdmin()) {
 			$user_is_super=true;
-			$TABS_DIRS[]='/admin/';
+			$TABS_DIRS[]=util_make_url ('/admin/') ;
 			$TABS_TITLES[]=_('Admin');
 		}
 		if ($permstats->isMember()) {
-			$TABS_DIRS[]='/reporting/';
+			$TABS_DIRS[]=util_make_url ('/reporting/') ;
 			$TABS_TITLES[]=_('Reporting');
 		}
 	}
@@ -425,27 +425,27 @@
 
                 } else {
 		    if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
-		    	$TABS_DIRS[]='/project/?group_id='. $params['group'];
+			    $TABS_DIRS[]=util_make_url ('/project/?group_id='. $params['group']) ;
 		    } else {
-                    	$TABS_DIRS[]='/projects/'.$project->getUnixName().'/';
+			    $TABS_DIRS[]=util_make_url ('/projects/'.$project->getUnixName().'/') ;
 		    }
                     $TABS_TITLES[]=$project->getPublicName();
                     $selected=count($TABS_DIRS)-1;
                 }
             }
-        } elseif (strstr(getStringFromServer('REQUEST_URI'),'/my/') || strstr(getStringFromServer('REQUEST_URI'),'/account/') ||
-        strstr(getStringFromServer('REQUEST_URI'),'/themes/') ) {
-            $selected=array_search("/my/", $TABS_DIRS);
-        } elseif (strstr(getStringFromServer('REQUEST_URI'),'softwaremap')) {
-            $selected=array_search("/softwaremap/", $TABS_DIRS);
-        } elseif (strstr(getStringFromServer('REQUEST_URI'),'/snippet/')) {
-            $selected=array_search("/snippet/", $TABS_DIRS);
-        } elseif (strstr(getStringFromServer('REQUEST_URI'),'/people/')) {
-            $selected=array_search("/people/", $TABS_DIRS);
-        } elseif (strstr(getStringFromServer('REQUEST_URI'),'/reporting/')) {
-            $selected=array_search('/reporting/',$TABS_DIRS);
-        } elseif (strstr(getStringFromServer('REQUEST_URI'),'/admin/') && $user_is_super) {
-            $selected=array_search('/admin/',$TABS_DIRS);
+        } elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/my/')) || strstr(getStringFromServer('REQUEST_URI'),'/account/') ||
+		  strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/themes/')) ) {
+		$selected=array_search(util_make_url ('/my/'), $TABS_DIRS);
+        } elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('softwaremap'))) {
+		$selected=array_search(util_make_url ('/softwaremap/'), $TABS_DIRS);
+        } elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/snippet/'))) {
+		$selected=array_search(util_make_url ('/snippet/'), $TABS_DIRS);
+        } elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/people/'))) {
+		$selected=array_search(util_make_url ('/people/'), $TABS_DIRS);
+        } elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/reporting/'))) {
+		$selected=array_search(util_make_url ('/reporting/'),$TABS_DIRS);
+        } elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/admin/')) && $user_is_super) {
+		$selected=array_search(util_make_url ('/admin/'),$TABS_DIRS);
         } elseif (count($PLUGIN_TABS_DIRS)>0) {
             foreach ($PLUGIN_TABS_DIRS as $PLUGIN_TABS_DIRS_VALUE) {
                if (strstr(getStringFromServer('REQUEST_URI'),$PLUGIN_TABS_DIRS_VALUE)) {
@@ -486,9 +486,9 @@
 
         // Summary
 	if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
-		$TABS_DIRS[]='/project/?group_id='. $group;
+		$TABS_DIRS[]=util_make_url ('/project/?group_id='. $group);
 	} else {
-        	$TABS_DIRS[]='/projects/'. $project->getUnixName() .'/';
+        	$TABS_DIRS[]=util_make_url ('/projects/'. $project->getUnixName() .'/');
 	}
         $TABS_TITLES[]=_('Summary');
         (($toptab == 'home') ? $selected=(count($TABS_TITLES)-1) : '' );
@@ -496,30 +496,30 @@
         // Project Admin
         $perm =& $project->getPermission( session_get_user() );
         if ($perm->isAdmin()) {
-            $TABS_DIRS[]='/project/admin/?group_id='. $group;
+		$TABS_DIRS[]=util_make_url ('/project/admin/?group_id='. $group);
             $TABS_TITLES[]=_('Admin');
             (($toptab == 'admin') ? $selected=(count($TABS_TITLES)-1) : '' );
         }
         /* Homepage
-        $TABS_DIRS[]='http://'. $project->getHomePage();
+        $TABS_DIRS[]=util_make_url ('http://'. $project->getHomePage());
         $TABS_TITLES[]=_('Home Page');
         */
 
         // Project Activity tab 
-        $TABS_DIRS[]='/activity/?group_id='. $group;
+        $TABS_DIRS[]=util_make_url ('/activity/?group_id='. $group);
         $TABS_TITLES[]=_('Activity');
         (($toptab == 'activity') ? $selected=(count($TABS_TITLES)-1) : '' );
 
         // Forums
         if ($project->usesForum()) {
-            $TABS_DIRS[]='/forum/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/forum/?group_id='.$group);
             $TABS_TITLES[]=_('Forums');
             (($toptab == 'forums') ? $selected=(count($TABS_TITLES)-1) : '' );
         }
 
         // Artifact Tracking
         if ($project->usesTracker()) {
-            $TABS_DIRS[]='/tracker/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/tracker/?group_id='.$group);
             $TABS_TITLES[]=_('Tracker');
             (($toptab == 'tracker' || $toptab == 'bugs' || $toptab == 'support' || $toptab == 'patch')
             ? $selected=(count($TABS_TITLES)-1) : '' );
@@ -527,42 +527,42 @@
 
         // Mailing Lists
         if ($project->usesMail()) {
-            $TABS_DIRS[]='/mail/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/mail/?group_id='.$group);
             $TABS_TITLES[]=_('Lists');
             (($toptab == 'mail') ? $selected=(count($TABS_TITLES)-1) : '' );
         }
 
         // Project Manager
         if ($project->usesPm()) {
-            $TABS_DIRS[]='/pm/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/pm/?group_id='.$group);
             $TABS_TITLES[]=_('Tasks');
             (($toptab == 'pm') ? $selected=(count($TABS_TITLES)-1) : '' );
         }
 
         // Doc Manager
         if ($project->usesDocman()) {
-            $TABS_DIRS[]='/docman/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/docman/?group_id='.$group);
             $TABS_TITLES[]=_('Docs');
             (($toptab == 'docman') ? $selected=(count($TABS_TITLES)-1) : '' );
         }
 
         // Surveys
         if ($project->usesSurvey()) {
-            $TABS_DIRS[]='/survey/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/survey/?group_id='.$group);
             $TABS_TITLES[]=_('Surveys');
             (($toptab == 'surveys') ? $selected=(count($TABS_TITLES)-1) : '' );
         }
 
         //newsbytes
         if ($project->usesNews()) {
-            $TABS_DIRS[]='/news/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/news/?group_id='.$group);
             $TABS_TITLES[]=_('News');
             (($toptab == 'news') ? $selected=(count($TABS_TITLES)-1) : '' );
         }
 
         // SCM systems
         if ($project->usesSCM()) {
-            $TABS_DIRS[]='/scm/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/scm/?group_id='.$group);
             $TABS_TITLES[]=_('SCM');
             (($toptab == 'scm') ? $selected=(count($TABS_TITLES)-1) : '' );
         }
@@ -578,7 +578,7 @@
 
         // Downloads
         if ($project->usesFRS()) {
-            $TABS_DIRS[]='/frs/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/frs/?group_id='.$group);
             $TABS_TITLES[]=_('Files');
             (($toptab == 'frs') ? $selected=(count($TABS_TITLES)-1) : '' );
         }
@@ -635,7 +635,7 @@
                 $return .= sprintf(
                     '<td background="%s" width="'.$width.'%%" style="text-align:center">
             		<a class="%s" href="%s">%s</a>
-    		</td>', $middle_img, $css_class, util_make_url ($TABS_DIRS[$i]), $TABS_TITLES[$i]);
+    		</td>', $middle_img, $css_class, $TABS_DIRS[$i], $TABS_TITLES[$i]);
     
                 // if the next tab is not last, insert a separator
                 if ($i < $count-1) {
@@ -656,7 +656,7 @@
                 $return .= sprintf(
                     '<td background="%s" width="'.$width.'%%" style="text-align:center">
             		<a class="%s" href="%s">%s</a>
-    		</td>', $middle_img, $css_class, util_make_url ($TABS_DIRS[$i]), $TABS_TITLES[$i]);
+    		</td>', $middle_img, $css_class, $TABS_DIRS[$i], $TABS_TITLES[$i]);
     
                 // if the next tab is not selected, close this tab
                 if ($selected != $i+1) {

Modified: trunk/gforge/www/themes/gforge-simple-theme/Theme.class.php
===================================================================
--- trunk/gforge/www/themes/gforge-simple-theme/Theme.class.php	2009-04-29 09:00:21 UTC (rev 7515)
+++ trunk/gforge/www/themes/gforge-simple-theme/Theme.class.php	2009-04-29 09:00:37 UTC (rev 7516)
@@ -342,41 +342,38 @@
 	global $sys_use_trove,$sys_use_snippet,$sys_use_people;
 
 	$selected=0;
-	$TABS_DIRS[]='/';
+	$TABS_DIRS[]=util_make_url ('/') ;
 	$TABS_IDS[]='home';
 	$TABS_TITLES[]=_('Home');
 
 	$TABS_IDS[]='my';
-	$TABS_DIRS[]='/my/';
+	$TABS_DIRS[]=util_make_url ('/my/') ;
 	$TABS_TITLES[]=_('My&nbsp;Page');
 	if (strstr(getStringFromServer('REQUEST_URI'),'/my/') || strstr(getStringFromServer('REQUEST_URI'),'/account/') ) {
 		$selected=count($TABS_DIRS)-1;
 	}
 
 	if ($sys_use_trove) {
-		$thistab='softwaremap';
 		$TABS_IDS[]='softwaremap';
-		$TABS_DIRS[]='/'.$thistab.'/';
+		$TABS_DIRS[]=util_make_url ('/softwaremap/') ;
 		$TABS_TITLES[]=_('Project&nbsp;Tree');
-		if (strstr(getStringFromServer('REQUEST_URI'),$thistab)){
+		if (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/softwaremap/'))) {
 			$selected=count($TABS_DIRS)-1;
 		}
 	}
 	if ($sys_use_snippet) {
-		$thistab='snippet';
-		$TABS_IDS[]=$thistab;
-		$TABS_DIRS[]='/'.$thistab.'/';
+		$TABS_IDS[]='snippet';
+		$TABS_DIRS[]=util_make_url ('/snippet/') ;
 		$TABS_TITLES[]=_('Code&nbsp;Snippets');
-		if (strstr(getStringFromServer('REQUEST_URI'),$thistab)){
+		if (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/snippet/'))) {
 			$selected=count($TABS_DIRS)-1;
 		}
 	}
 	if ($sys_use_people) {
-		$thistab='people';
-		$TABS_IDS[]=$thistab;
-		$TABS_DIRS[]='/'.$thistab.'/';
+		$TABS_IDS[]='people';
+		$TABS_DIRS[]=util_make_url ('/people/') ;
 		$TABS_TITLES[]=_('Project&nbsp;Openings');
-		if (strstr(getStringFromServer('REQUEST_URI'),$thistab)){
+		if (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/people/'))) {
 			$selected=count($TABS_DIRS)-1;
 		}
 	}
@@ -388,21 +385,19 @@
 	$TABS_DIRS = array_merge($TABS_DIRS, $PLUGIN_TABS_DIRS);
 
 	if (user_ismember(1,'A')) {
-		$thistab='admin';
-		$TABS_IDS[]=$thistab;
-		$TABS_DIRS[]='/'.$thistab.'/';
+		$TABS_IDS[]='admin';
+		$TABS_DIRS[]=util_make_url ('/admin/') ;
 		$TABS_TITLES[]=_('Admin');
-		if (strstr(getStringFromServer('REQUEST_URI'),$thistab)){
+		if (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/admin/'))) {
 			$selected=count($TABS_DIRS)-1;
 		}
 
 	}
 	if (user_ismember($GLOBALS['sys_stats_group'])) {
-		$thistab='reporting';
-		$TABS_IDS[]=$thistab;
-		$TABS_DIRS[]='/'.$thistab.'/';
+		$TABS_IDS[]='reporting';
+		$TABS_DIRS[]=util_make_url ('/reporting/') ;
 		$TABS_TITLES[]=_('Reporting');
-		if (strstr(getStringFromServer('REQUEST_URI'),$thistab)){
+		if (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/reporting/'))) {
 			$selected=count($TABS_DIRS)-1;
 		}
 	}
@@ -478,9 +473,9 @@
 
 	// Summary
 	if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
-		$TABS_DIRS[]='/project/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url('/project/?group_id='.$group);
 	} else {
-		$TABS_DIRS[]='/projects/'.$project->getUnixName();
+		$TABS_DIRS[]=util_make_url('/projects/'.$project->getUnixName());
 	}
 	$TABS_IDS[]='gforge-project-summary';
 	$TABS_TITLES[]=_('Summary');
@@ -488,7 +483,7 @@
 
 	if (user_ismember($group,'A')) {
 		// Project Admin
-		$TABS_DIRS[]='/project/admin/?group_id='. $group;
+		$TABS_DIRS[]=util_make_url('/project/admin/?group_id='. $group);
 		$TABS_IDS[]='gforge-project-admin';
 		$TABS_TITLES[]=_('Admin');
 		(($toptab == 'admin') ? $selected=(count($TABS_TITLES)-1) : '' );
@@ -498,14 +493,14 @@
 		$TABS_TITLES[]=_('Home Page');
 		*/
 
-	$TABS_DIRS[]='/activity/?group_id='. $group;
+	$TABS_DIRS[]=util_make_url('/activity/?group_id='. $group);
 	$TABS_IDS[]='gforge-project-activity';
 	$TABS_TITLES[]=_('Activity');
 	(($toptab == 'activity') ? $selected=(count($TABS_TITLES)-1) : '' );
 
 	// Forums
 	if ($project->usesForum()) {
-		$TABS_DIRS[]='/forum/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/forum/?group_id='.$group) ;
 		$TABS_IDS[]='gforge-project-forum';
 		$TABS_TITLES[]=_('Forums');
 		(($toptab == 'forums') ? $selected=(count($TABS_TITLES)-1) : '' );
@@ -513,7 +508,7 @@
 
 	// Artifact Tracking
 	if ($project->usesTracker()) {
-		$TABS_DIRS[]='/tracker/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/tracker/?group_id='.$group) ;
 		$TABS_IDS[]='gforge-project-tracker';
 		$TABS_TITLES[]=_('Tracker');
 		(($toptab == 'tracker' || $toptab == 'bugs' || $toptab == 'support' || $toptab == 'patch')
@@ -522,7 +517,7 @@
 
 	// Mailing Lists
 	if ($project->usesMail()) {
-		$TABS_DIRS[]='/mail/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/mail/?group_id='.$group) ;
 		$TABS_IDS[]='gforge-project-mail';
 		$TABS_TITLES[]=_('Lists');
 		(($toptab == 'mail') ? $selected=(count($TABS_TITLES)-1) : '' );
@@ -530,15 +525,15 @@
 
 	// Project Manager
 	if ($project->usesPm()) {
+		$TABS_DIRS[]=util_make_url ('/pm/?group_id='.$group) ;
 		$TABS_IDS[]='gforge-project-task';
-		$TABS_DIRS[]='/pm/?group_id='.$group;
 		$TABS_TITLES[]=_('Tasks');
 		(($toptab == 'pm') ? $selected=(count($TABS_TITLES)-1) : '' );
 	}
 
 	// Doc Manager
 	if ($project->usesDocman()) {
-		$TABS_DIRS[]='/docman/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/docman/?group_id='.$group) ;
 		$TABS_IDS[]='gforge-project-docman';
 		$TABS_TITLES[]=_('Docs');
 		(($toptab == 'docman') ? $selected=(count($TABS_TITLES)-1) : '' );
@@ -546,7 +541,7 @@
 
 	// Surveys
 	if ($project->usesSurvey()) {
-		$TABS_DIRS[]='/survey/?group_id='.$group;
+		$TABS_DIRS[]=util_make_url ('/survey/?group_id='.$group) ;
 		$TABS_IDS[]='gforge-project-survey';
 		$TABS_TITLES[]=_('Surveys');
 		(($toptab == 'surveys') ? $selected=(count($TABS_TITLES)-1) : '' );
@@ -554,16 +549,16 @@
 
 	//newsbytes
 	if ($project->usesNews()) {
+		$TABS_DIRS[]=util_make_url ('/news/?group_id='.$group) ;
 		$TABS_IDS[]='gforge-project-news';
-		$TABS_DIRS[]='/news/?group_id='.$group;
 		$TABS_TITLES[]=_('News');
 		(($toptab == 'news') ? $selected=(count($TABS_TITLES)-1) : '' );
 	}
 
 	// SCM systems
 	if ($project->usesSCM()) {
+		$TABS_DIRS[]=util_make_url ('/scm/?group_id='.$group) ;
 		$TABS_IDS[]='gforge-project-scm';
-		$TABS_DIRS[]='/scm/?group_id='.$group;
 		$TABS_TITLES[]=_('SCM');
 		(($toptab == 'scm') ? $selected=(count($TABS_TITLES)-1) : '' );
 	}
@@ -579,8 +574,8 @@
 
 	// Downloads
 	if ($project->usesFRS()) {
+		$TABS_DIRS[]=util_make_url ('/frs/?group_id='.$group) ;
 		$TABS_IDS[]='gforge-project-frs';
-		$TABS_DIRS[]='/frs/?group_id='.$group;
 		$TABS_TITLES[]=_('Files');
 		(($toptab == 'frs') ? $selected=(count($TABS_TITLES)-1) : '' );
 	}
@@ -601,16 +596,16 @@
 			$this->selected_title = $TABS_TITLES[$i];
 			$this->selected_dir = $TABS_DIRS[$i];
 			//$this->selected_id = $TABS_IDS[$i];
-			$return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>'gforge-project-selected'));
+			$return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>'gforge-project-selected'),true);
 
 		}
 		else{
 			if (!isset($TABS_IDS[$i]) || $TABS_IDS[$i]==''){
-				$return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>'gforge-project-std','title'=>$TABS_TITLES[$i]));
+				$return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>'gforge-project-std','title'=>$TABS_TITLES[$i]),true);
 
 			}
 			else {
-				$return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>$TABS_IDS[$i],'title'=>$TABS_TITLES[$i]));
+				$return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>$TABS_IDS[$i],'title'=>$TABS_TITLES[$i]),true);
 			}
 		}
 	}




More information about the Fusionforge-commits mailing list