[evolvis-commits] r17508: Tooltips for outerTabs and projectTabs

mirabilos at evolvis.org mirabilos at evolvis.org
Fri Sep 2 11:57:32 CEST 2011


Author: mirabilos
Date: 2011-09-02 11:57:32 +0200 (Fri, 02 Sep 2011)
New Revision: 17508

Modified:
   branches/ev48fixes/www/themes/evolvis/Theme.class.php
Log:
Tooltips for outerTabs and projectTabs


Modified: branches/ev48fixes/www/themes/evolvis/Theme.class.php
===================================================================
--- branches/ev48fixes/www/themes/evolvis/Theme.class.php	2011-09-02 09:30:33 UTC (rev 17507)
+++ branches/ev48fixes/www/themes/evolvis/Theme.class.php	2011-09-02 09:57:32 UTC (rev 17508)
@@ -588,10 +588,15 @@
 	}
 
 
-	function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='BLACK',$total_width='100%',$TAB_TYPE) {
+	function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor,$total_width,$TAB_TYPE,$TABS_TOOLTIPS=array()) {
 		$rv = "";
 		for ($i = 0; $i < count($TABS_DIRS); $i++) {
-			$rv .= '<span class="headblock"><span class="headlink' .
+			$tooltip = util_html_secure(util_ifsetor($TABS_TOOLTIPS[$i], ""));
+			$rv .= '<span class="headblock"';
+			if ($tooltip) {
+				$rv .= ' title="' . $tooltip . '"';
+			}
+			$rv .= '><span class="headlink' .
 			    (($TAB_TYPE=='outerTab' || $selected==$i) ? 's' : '') .
 			    '">//</span><a class="headlink" href="' .
 			    $TABS_DIRS[$i] . '"><span class="headlink' .
@@ -604,17 +609,20 @@
 	function outerTabs($params,$write=1) {
 		global $sys_use_trove,$sys_use_snippet,$sys_use_people;
 
+		$TABS_TOOLTIPS = array();
+
 		$TABS_DIRS[]='/';
+		$TABS_TITLES[]=_('Home');
+		$TABS_TOOLTIPS[count($TABS_DIRS)-1]=_('Forge Main Page');
 		if ($sys_use_trove) {
 			$TABS_DIRS[]='/softwaremap/';
-		}
-		$TABS_TITLES[]=_('Home');
-		if ($sys_use_trove) {
 			$TABS_TITLES[]=_('Projects');
+			$TABS_TOOLTIPS[count($TABS_DIRS)-1]=_('List of all publicly accessible projects');
 		}
 		if (user_ismember(1,'A')) {
 			$TABS_DIRS[]='/admin/';
 			$TABS_TITLES[]=_('Site-Admin');
+			$TABS_TOOLTIPS[count($TABS_DIRS)-1]=_('Global Forge Administration');
 		}
 		if (user_ismember($GLOBALS['sys_stats_group'])) {
 			$TABS_DIRS[]='/reporting/';
@@ -641,6 +649,7 @@
 		// outermenu hook
 		$hookParams['DIRS'] = &$TABS_DIRS;
 		$hookParams['TITLES'] = &$TABS_TITLES;
+		$hookParams['TOOLTIPS'] = &$TABS_TOOLTIPS;
 		$hookParams['selected'] = &$selected;
 		plugin_hook("outermenu", $hookParams);
 
@@ -648,10 +657,11 @@
 			$this->COLOR_SELECTED_TAB= '#e0e0e0';
 		}
 
+		$rv = $this->tabGenerator($TABS_DIRS,$TABS_TITLES,false,$selected,$this->COLOR_SELECTED_TAB,'100%',"outerTab",$TABS_TOOLTIPS);
 		if (!$write) {
-			return $this->tabGenerator($TABS_DIRS,$TABS_TITLES,false,$selected,$this->COLOR_SELECTED_TAB,'100%',"outerTab");
+			return $rv;
 		} else {
-			echo $this->tabGenerator($TABS_DIRS,$TABS_TITLES,false,$selected,$this->COLOR_SELECTED_TAB,'100%',"outerTab");
+			echo $rv;
 		}
 	}
 
@@ -678,15 +688,19 @@
 			return;
 		}
 
+		$TABS_TOOLTIPS = array();
+
 		// Summary
 		$TABS_DIRS[]='/projects/'. $project->getUnixName() .'/';
 		$TABS_TITLES[]=_('Summary');
+		$TABS_TOOLTIPS[count($TABS_DIRS)-1]=_('Project Main Page');
 		(($toptab == 'home') ? $selected=(count($TABS_TITLES)-1) : '' );
 
 		if (user_ismember($group,'A')) {
 			// Project Admin
 			$TABS_DIRS[]='/project/admin/?group_id='. $group;
 			$TABS_TITLES[]=_('Project-Admin');
+			$TABS_TOOLTIPS[count($TABS_DIRS)-1]=_('Project Features & Users Administration');
 			(($toptab == 'admin') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
@@ -701,6 +715,7 @@
 		if ($project->usesTracker()) {
 			$TABS_DIRS[]='/tracker/?group_id='.$group;
 			$TABS_TITLES[]=_('Trackers');
+			$TABS_TOOLTIPS[count($TABS_DIRS)-1]=_('Bugtracker, Feature Requests, etc.');
 			(($toptab == 'tracker' || $toptab == 'bugs' || $toptab == 'support' || $toptab == 'patch')
 				? $selected=(count($TABS_TITLES)-1) : '' );
 		}
@@ -709,6 +724,7 @@
 		if ($project->usesMail()) {
 			$TABS_DIRS[]='/mail/?group_id='.$group;
 			$TABS_TITLES[]=_('Lists');
+			$TABS_TOOLTIPS[count($TABS_DIRS)-1]=_('Project Mailing Lists');
 			(($toptab == 'mail') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
@@ -716,6 +732,7 @@
 		if ($project->usesPm()) {
 			$TABS_DIRS[]='/pm/?group_id='.$group;
 			$TABS_TITLES[]=_('Tasks');
+			$TABS_TOOLTIPS[count($TABS_DIRS)-1]=_('Task and Time Tracking');
 			(($toptab == 'pm') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
@@ -723,6 +740,7 @@
 		if ($project->usesDocman()) {
 			$TABS_DIRS[]='/docman/?group_id='.$group;
 			$TABS_TITLES[]=_('Docs');
+			$TABS_TOOLTIPS[count($TABS_DIRS)-1]=_('Document Manager');
 			(($toptab == 'docman') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
@@ -737,12 +755,14 @@
 		if ($project->usesSCM()) {
 			$TABS_DIRS[]='/scm/?group_id='.$group;
 			$TABS_TITLES[]=_('SCM');
+			$TABS_TOOLTIPS[count($TABS_DIRS)-1]=_('Source Code Management');
 			(($toptab == 'scm') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
 		// groupmenu_after_scm hook
 		$hookParams['DIRS'] = &$TABS_DIRS;
 		$hookParams['TITLES'] = &$TABS_TITLES;
+		$hookParams['TOOLTIPS'] = &$TABS_TOOLTIPS;
 		$hookParams['toptab'] = &$toptab;
 		$hookParams['selected'] = &$selected;
 		$hookParams['group_id'] = $group ;
@@ -753,19 +773,21 @@
 		if ($project->usesFRS()) {
 			$TABS_DIRS[]='/frs/?group_id='.$group;
 			$TABS_TITLES[]=_('Files');
+			$TABS_TOOLTIPS[count($TABS_DIRS)-1]=_('File Release System');
 			(($toptab == 'frs') ? $selected=(count($TABS_TITLES)-1) : '' );
 		}
 
 		// groupmenu hook
 		$hookParams['DIRS'] = &$TABS_DIRS;
 		$hookParams['TITLES'] = &$TABS_TITLES;
+		$hookParams['TOOLTIPS'] = &$TABS_TOOLTIPS;
 		$hookParams['toptab'] = &$toptab;
 		$hookParams['selected'] = &$selected;
 		$hookParams['group'] = $group;
 
 		plugin_hook ("groupmenu", $hookParams) ;
 
-		return $this->tabGenerator($TABS_DIRS,$TABS_TITLES,true,$selected,'white','100%','projectTab');
+		return $this->tabGenerator($TABS_DIRS,$TABS_TITLES,true,$selected,'white','100%','projectTab',$TABS_TOOLTIPS);
 	}
 
 	/**



More information about the evolvis-commits mailing list