[Fusionforge-commits] r8914 - in trunk/gforge: common/include www/include www/search/include/renderers www/themes/gforge www/themes/gforge/css

Olaf Lenz olenz at libremir.placard.fr.eu.org
Wed Mar 3 11:31:51 CET 2010


Author: olenz
Date: 2010-03-03 11:31:50 +0100 (Wed, 03 Mar 2010)
New Revision: 8914

Added:
   trunk/gforge/common/include/Navigation.class.php
Modified:
   trunk/gforge/common/include/Group.class.php
   trunk/gforge/www/include/Layout.class.php
   trunk/gforge/www/search/include/renderers/AdvancedSearchHtmlSearchRenderer.class.php
   trunk/gforge/www/themes/gforge/Theme.class.php
   trunk/gforge/www/themes/gforge/css/theme.css
Log:
Factored out navigational elements from Layout and gforge/Theme.

Cleaned up Layout and gforge/Theme, made them more configurable.
Moved advancedSearchBox generation to AdvancedSearchHtmlSearchRenderer.

Modified: trunk/gforge/common/include/Group.class.php
===================================================================
--- trunk/gforge/common/include/Group.class.php	2010-03-03 09:45:48 UTC (rev 8913)
+++ trunk/gforge/common/include/Group.class.php	2010-03-03 10:31:50 UTC (rev 8914)
@@ -2516,253 +2516,6 @@
 		
 		return $users;
 	}
-
-	/**
-	 *  getMenu -  get an array that contains data for the group menu
-	 *
-	 *  @param	string	contains the name of the selected menu item
-	 *  @return	array	array containing:
-	 *  		'titles': array that stores the titles of the menu entries
-	 *  		'dirs': array that stores the URLs of the menu entries
-	 *  		'start': URL of the starting page of the project
-	 *  		'admindirs': array that stores the URLs of the admin pages
-	 *    		  for the menu entries, if accessible, false otherwise
-	 *  		'selected': number of the menu entry selected by $toptab
-	 *  		'last_toptab': required internally: stores the
-	 *  		  value of $toptab for the last call to getMenu()
-	 */
-	function &getMenu($toptab = "") {
-		// rebuild menu if it has never been built before, or
-		// if the toptab was set differently
-		if (!isset($this->menu_data)
-		    || ($toptab != "") 
-		    || ($toptab != $this->menu_data['last_toptab']))
-		{
-			$selected = 0;
-			$group = $this->getId();
-
-			$this->menu_data = array () ;
-			$this->menu_data['titles'] = array();
-			$this->menu_data['dirs'] = array();
-			$this->menu_data['admindirs'] = array();
-
-			// Summary
-			$this->menu_data['titles'][] = _('Summary');
-			if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
-				$dir = util_make_url ('/project/?group_id=' . $group);
-			} else {
-				$dir = util_make_url ('/projects/' . $this->getUnixName() .'/');
-			}
-			$this->menu_data['dirs'][] = $dir;
-			$this->menu_data['admindirs'][] = false;
-			if ($toptab == "home") {
-				$selected = (count($this->menu_data['dirs'])-1);
-			}
-			// setting 'start' allows to change the
-			// projects start page
-			$this->menu_data['start'] = $dir;
-			
-			// Project Admin
-			$perm =& $this->getPermission( session_get_user() );
-			if ($perm->isAdmin()) {
-				$this->menu_data['titles'][] = _('Admin');
-				$this->menu_data['dirs'][] = util_make_url ('/project/admin/?group_id=' . $group);
-				$this->menu_data['admindirs'][] = false;
-				if ($toptab == "admin") {
-					$selected = (count($this->menu_data['dirs'])-1);
-				}
-			}
-
-			/* Homepage
-			 // check for use_home_tab?
-			 $TABS_DIRS[]='http://'. $this->getHomePage();
-			 $TABS_TITLES[]=_('Home Page');
-			*/
-
-			// Project Activity tab 
-			$this->menu_data['titles'][] = _('Activity');
-			$this->menu_data['dirs'][] = util_make_url ('/activity/?group_id=' . $group);
-			$this->menu_data['admindirs'][] = false;
-			if ($toptab == "activity") {
-				$selected = (count($this->menu_data['dirs'])-1);
-			}
-
-			// Forums
-			if ($this->usesForum()) {
-				$this->menu_data['titles'][] = _('Forums');
-				$this->menu_data['dirs'][] = util_make_url ('/forum/?group_id=' . $group);
-				if ($perm->isAdmin() || $perm->isForumAdmin()) {
-					$this->menu_data['admindirs'][] = util_make_url('/forum/admin/?group_id='.$group);
-				} else {
-					$this->menu_data['admindirs'][] = false;
-				}
-				if ($toptab == "forums") {
-					$selected = (count($this->menu_data['dirs'])-1);
-				}
-			}
-
-			// Artifact Tracking
-			if ($this->usesTracker()) {
-				$this->menu_data['titles'][] = _('Tracker');
-				$this->menu_data['dirs'][] = util_make_url ('/tracker/?group_id=' . $group);
-				if ($perm->isAdmin() || $perm->isArtifactAdmin()) {
-					$this->menu_data['admindirs'][] = util_make_url('/tracker/admin/?group_id='.$group);
-				} else {
-					$this->menu_data['admindirs'][] = false;
-				}
-				if ($toptab == "tracker" || 
-				    $toptab == "bugs" || 
-				    $toptab == "support" || 
-				    $toptab == "patch") {
-					$selected = (count($this->menu_data['dirs'])-1);
-				}
-			}
-
-			
-			// Mailing Lists
-			if ($this->usesMail()) {
-				$this->menu_data['titles'][] = _('Lists');
-				$this->menu_data['dirs'][] = util_make_url ('/mail/?group_id=' . $group);
-				if ($perm->isAdmin()) {
-					$this->menu_data['admindirs'][] = util_make_url('/mail/admin/?group_id='.$group);
-				} else {
-					$this->menu_data['admindirs'][] = false;
-				}
-				if ($toptab == "mail") {
-					$selected = (count($this->menu_data['dirs'])-1);
-				}
-
-			}
-			
-			// Project/Task Manager
-			if ($this->usesPm()) {
-				$this->menu_data['titles'][] = _('Tasks');
-				$this->menu_data['dirs'][] = util_make_url ('/pm/?group_id=' . $group);
-				if ($perm->isAdmin() || $perm->isPMAdmin()) {
-					$this->menu_data['admindirs'][] = util_make_url ('/pm/admin/?group_id='.$group);
-				} else {
-					$this->menu_data['admindirs'][] = false;
-				}
-				if ($toptab == "pm") {
-					$selected = (count($this->menu_data['dirs'])-1);
-				}
-
-			}
-			
-			// Doc Manager
-			if ($this->usesDocman()) {
-				$this->menu_data['titles'][] = _('Docs');
-				$this->menu_data['dirs'][] = util_make_url ('/docman/?group_id=' . $group);
-				if ($perm->isAdmin() || $perm->isDocEditor()) {
-					$this->menu_data['admindirs'][] = util_make_url ('/docman/admin/?group_id='.$group);
-				} else {
-					$this->menu_data['admindirs'][] = false;
-				}
-				if ($toptab == "docman") {
-					$selected = (count($this->menu_data['dirs'])-1);
-				}
-
-			}
-
-			// Surveys
-			if ($this->usesSurvey()) {
-				$this->menu_data['titles'][] = _('Surveys');
-				$this->menu_data['dirs'][] = util_make_url ('/survey/?group_id=' . $group);
-				if ($perm->isAdmin()) {
-					$this->menu_data['admindirs'][] = util_make_url ('/survey/admin/?group_id='.$group);
-				} else {
-					$this->menu_data['admindirs'][] = false;
-				}
-				if ($toptab == "surveys") {
-					$selected = (count($this->menu_data['dirs'])-1);
-				}
-			}
-
-			// News
-			if ($this->usesNews()) {
-				$this->menu_data['titles'][] = _('News');
-				$this->menu_data['dirs'][] = util_make_url ('/news/?group_id=' . $group);
-				if ($perm->isAdmin()) {
-					$this->menu_data['admindirs'][] = util_make_url ('/news/admin/?group_id='.$group);
-				} else {
-					$this->menu_data['admindirs'][] = false;
-				}
-				if ($toptab == "news") {
-					$selected = (count($this->menu_data['dirs'])-1);
-				}
-			}
-			
-			// SCM systems
-			if ($this->usesSCM()) {
-				$this->menu_data['titles'][] = _('SCM');
-				$this->menu_data['dirs'][] = util_make_url ('/scm/?group_id=' . $group);
-				// eval cvs_flags?
-				if ($perm->isAdmin()) {
-					$this->menu_data['admindirs'][] = util_make_url ('/scm/admin/?group_id='.$group);
-				} else {
-					$this->menu_data['admindirs'][] = false;
-				}
-				if ($toptab == "scm") {
-					$selected = (count($this->menu_data['dirs'])-1);
-				}
-			}
-
-			// groupmenu_after_scm hook
-			$hookParams = array();
-			$hookParams['group_id'] = $group ;
-			$hookParams['DIRS'] =& $this->menu_data['dirs'];
-			$hookParams['TITLES'] =& $this->menu_data['titles'];
-			$hookParams['toptab'] =& $toptab;
-			$hookParams['selected'] =& $selected;
-
-			plugin_hook ("groupmenu_scm", $hookParams) ; 
-
-			// fill up admindirs
-			for ($i = 0; 
-			     $i < count($this->menu_data['dirs']) - count($this->menu_data['admindirs']); 
-			     $i++) {
-				$this->menu_data['admindirs'][] = false;
-			}
-
-			// Downloads
-			if ($this->usesFRS()) {
-				$this->menu_data['titles'][] = _('Files');
-				$this->menu_data['dirs'][] = util_make_url ('/frs/?group_id=' . $group);
-				if ($perm->isAdmin() || $perm->isReleaseTechnician()) {
-					$this->menu_data['admindirs'][] = util_make_url ('/frs/admin/?group_id='.$group);
-				} else {
-					$this->menu_data['admindirs'][] = false;
-				}
-				if ($toptab == "frs") {
-					$selected = (count($this->menu_data['dirs'])-1);
-				}
-			}
-
-			// groupmenu hook
-			$hookParams = array();
-			$hookParams['group'] = $group ;
-			$hookParams['DIRS'] =& $this->menu_data['dirs'];
-			$hookParams['TITLES'] =& $this->menu_data['titles'];
-			$hookParams['toptab'] =& $toptab;
-			$hookParams['selected'] =& $selected;
-				
-			plugin_hook ("groupmenu", $hookParams) ;
-
-			// fill up admindirs
-			for ($i = 0; 
-			     $i < count($this->menu_data['dirs']) - count($this->menu_data['admindirs']); 
-			     $i++) {
-				$this->menu_data['admindirs'][] = false;
-			}
-
-			// store selected menu item (if any)
-			$this->menu_data['selected'] = $selected;
-			if ($toptab != "") {
-				$this->menu_data['last_toptab'] = $toptab;
-			}
-		}
-		return $this->menu_data ;
-	}
 }
 
 /**

Added: trunk/gforge/common/include/Navigation.class.php
===================================================================
--- trunk/gforge/common/include/Navigation.class.php	                        (rev 0)
+++ trunk/gforge/common/include/Navigation.class.php	2010-03-03 10:31:50 UTC (rev 8914)
@@ -0,0 +1,645 @@
+<?php   
+  /**
+   * FusionForge navigation
+   *
+   * Copyright 2009 - 2010, Olaf Lenz
+   *
+   * This file is part of FusionForge.
+   *
+   * FusionForge is free software; you can redistribute it and/or modify
+   * 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
+   * General Public License for more details.
+   *
+   * You should have received a copy of the GNU General Public License
+   * along with FusionForge; if not, write to the Free Software
+   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+   * USA
+   */
+
+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.
+ * Some of the methods return HTML code, some return abstract data
+ * structures, and some methods give you the choice. The HTML code
+ * always tries to be as generic as possible so that it can easily be
+ * styled via CSS.
+ */
+class Navigation extends Error {
+	/**
+	 * Associative array of data for the project menus.
+	 *
+	 * @var array $project_menu_data.
+	 */
+	var $project_menu_data;
+  
+	/** Constructor */
+	function Navigation() {
+		$this->Error();
+		return true;
+	}
+        
+        /** Get the HTML code of the title of the page. If the array
+	 *  $params contains a value for the key 'title', this title
+	 *  is appended to the title generated here. If $asHTML is
+	 *  set to false, it will return only the title in plain
+	 *  text. */
+        function getTitle($params, $asHTML=true) {
+                if (!$asHTML) {
+                        // get the title
+                        if (!$params['title']) {
+                                return $GLOBALS['sys_name'];
+                        } else {
+                                return $GLOBALS['sys_name'] . ': ' . $params['title'];
+                        }
+                } else {
+                        // return HTML code otherwise
+                        return '<title>' . $this->getTitle($params, false) . '</title>';
+                }
+        }
+
+        /** 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) .'" />' 
+				. '<link rel="shortcut icon" type="image/png" href="'
+				. $this->getFavIcon(false) .'" />';
+                }
+        }
+        
+        /** Get the HTML code for the RSS feeds of the site (to be put
+	 *  into the <head>. If $asHTML is false, it will return an
+	 *  array with the following structure: $result['titles']:
+	 *  list of titles of the feeds; $result['urls'] list of urls
+	 *  of the feeds. */
+        function getRSS($asHTML=true) {
+                if (!$asHTML) {
+                        $res = array() ;
+                        $res['titles'] = array();
+                        $res['urls'] = array();
+                        
+                        $res['titles'][] = $GLOBALS['sys_name'].' - Project News Highlights RSS';
+                        $res['urls'][] = util_make_url('/export/rss_sfnews.php'); 
+                        
+                        $res['titles'][] = $GLOBALS['sys_name'].' - Project News Highlights RSS 2.0';
+                        $res['urls'][] = util_make_url('/export/rss20_news.php'); 
+                        
+                        $res['titles'][] = $GLOBALS['sys_name'].' - New Projects RSS';
+                        $res['urls'][] = util_make_url('/export/rss_sfprojects.php'); 
+                        
+                        if (isset($GLOBALS['group_id'])) { 
+                                $res['titles'][] = $GLOBALS['sys_name'] . ' - New Activity RSS';
+                                $res['urls'][] = util_make_url('/export/rss20_activity.php?group_id='.$GLOBALS['group_id']);
+                        }
+                        return $res;
+                } else {
+                        $feeds = $this->getRSS(false);
+                        for ($j = 0; $j < count($feeds['urls']); $j++) {
+                                echo '
+                                <link rel="alternate" title="' . $feeds['titles'][$j] 
+					. '" href="' . $feeds['urls'][$j] 
+					. '" type="application/rss+xml"/>';
+                        }
+                }
+        }
+         
+	/** Get the searchBox HTML code. */
+        function getSearchBox() {
+                global $words,$forum_id,$group_id,$group_project_id,$atid,$exact,$type_of_search;
+                
+                $res = "";
+		if (get_magic_quotes_gpc()) {
+			$defaultWords = stripslashes($words);
+		} else {
+			$defaultWords = $words;
+		}
+                
+		$defaultWords = htmlspecialchars($defaultWords);
+		
+		// if there is no search currently, set the default
+		if (!isset($type_of_search) ) {
+			$exact = 1;
+		}
+                
+		$res .= '<form id="searchBox" action="'.util_make_url ('/search/').'" method="get">
+                         <div>';
+		$parameters = array(
+			SEARCH__PARAMETER_GROUP_ID => $group_id,
+			SEARCH__PARAMETER_ARTIFACT_ID => $atid,
+			SEARCH__PARAMETER_FORUM_ID => $forum_id,
+			SEARCH__PARAMETER_GROUP_PROJECT_ID => $group_project_id
+			);
+
+		$searchManager =& getSearchManager();
+		$searchManager->setParametersValues($parameters);
+		$searchEngines =& $searchManager->getAvailableSearchEngines();
+
+		$res .= '<label for="searchBox-words">
+                           <select name="type_of_search">';
+		for($i = 0, $max = count($searchEngines); $i < $max; $i++) {
+			$searchEngine =& $searchEngines[$i];
+			$res .= '<option value="' . $searchEngine->getType() . '"' 
+				. ( $type_of_search == $searchEngine->getType() ? ' selected="selected"' : '' )
+				. '>' . $searchEngine->getLabel($parameters) . '</option>' . "\n";
+		}
+		$res .= '</select></label>';
+
+		$parameters = $searchManager->getParameters();
+		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="' 
+			. $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=' . 
+					       $group_id, _('Advanced search'));
+		}
+		$res .= '</div>';
+		$res .= '</form>';
+
+		return $res;
+        }
+        
+
+        /** Get an array of the user links (Login/Logout/My
+	 Account/Register) with the following structure:
+	 $result['titles']: list of the titles. $result['urls']: list
+	 of the urls.
+	 */
+        function getUserLinks() {
+                $res = array();
+                if (session_loggedin()) {
+                        $u =& user_get_object(user_getid());
+                        $res['titles'][] = sprintf("%s (%s)", _('Log Out'), $u->getRealName());
+                        $res['urls'][] = util_make_url ('/account/logout.php');
+
+                        $res['titles'][] = _('My Account');
+                        $res['urls'][] = util_make_url ('/account/');
+                } else {
+                        $url = '/account/login.php';
+                        if(getStringFromServer('REQUEST_METHOD') != 'POST') {
+                                $url .= '?return_to=';
+                                $url .= urlencode(getStringFromServer('REQUEST_URI'));
+                        }
+                        $res['titles'][] = _('Log In');
+                        $res['urls'][] = util_make_url($url);
+                        
+                        if (!$GLOBALS['sys_user_reg_restricted']) {
+                                $res['titles'][] = _('New Account');
+                                $res['urls'][] = util_make_url('/account/register.php');
+                        }
+                }
+                return $res;
+        }
+
+        /** Get an array of the menu of the site with the following
+	 *  structure: $result['titles']: list of titles of the
+	 *  links. $result['urls']: list of urls. $result['selected']:
+	 *  number of the selected menu entry.
+	 */
+        function getSiteMenu() {
+                global $sys_use_trove,$sys_use_snippet,$sys_use_people,$sys_use_project_tags, $sys_use_project_full_list;
+
+                $request_uri = getStringFromServer('REQUEST_URI');
+                
+                $menu = array();
+                $menu['titles'] = array();
+                $menu['urls'] = array();
+                $selected = 0;
+                
+                // Home
+                $menu['titles'][] = _('Home');
+                $menu['urls'][] = util_make_url ('/'); 
+                
+                // My Page
+                $menu['titles'][] = _('My&nbsp;Page');
+                $menu['urls'][] = util_make_url ('/my/'); 
+                if (strstr($request_uri, util_make_uri('/my/'))
+                    || strstr($request_uri, util_make_uri('/account/'))
+                    || strstr($request_uri, util_make_uri('/register/'))
+                    || strstr($request_uri, util_make_uri('/themes/'))
+			) 
+                {
+                        $selected=count($menu['urls'])-1;
+                }
+                
+		if ($sys_use_trove || $sys_use_project_tags || $sys_use_project_full_list) {
+			$menu['titles'][] = _('Projects');
+			$menu['urls'][] = util_make_url ('/softwaremap/') ;
+			if (strstr($request_uri, util_make_uri('/softwaremap/'))) {
+				$selected=count($menu['urls'])-1;
+			}
+		}
+                 
+		if ($sys_use_snippet) {
+			$menu['titles'][] = _('Code&nbsp;Snippets');
+			$menu['urls'][] = util_make_url ('/snippet/') ;
+			if (strstr($request_uri, util_make_uri('/snippet/'))) {
+				$selected=count($menu['urls'])-1;
+			}
+		}
+                 
+		if ($sys_use_people) {
+			$menu['titles'][] = _('Project&nbsp;Openings');
+			$menu['urls'][] = util_make_url ('/people/') ;
+			if (strstr($request_uri, util_make_uri('/people/'))) {
+				$selected=count($menu['urls'])-1;
+			}
+		}
+
+		// Outermenu hook
+		$before = count($menu['urls']);
+		$plugin_urls = array();
+		$hookParams['DIRS'] = &$menu['urls'];
+		$hookParams['TITLES'] = &$menu['titles'];
+		plugin_hook ("outermenu", $hookParams) ;
+                 
+		// try to find selected entry
+		for ($j = $before; $j < count($plugin_urls); $j++) {
+			$url = $menu['urls'][$j];
+			if (strstr($request_uri, parse_url ($url, PHP_URL_PATH))) {
+				$selected = $j;
+				break;
+			}
+		}
+                 
+		// Admin and Reporting 
+		$user_is_super=false;
+		if (session_loggedin()) {
+			$projectmaster =& group_get_object(GROUP_IS_MASTER);
+			$projectstats =& group_get_object(GROUP_IS_STATS);
+			$permmaster =& $projectmaster->getPermission( session_get_user() );
+			$permstats =& $projectstats->getPermission( session_get_user() );
+                         
+			if ($permmaster->isAdmin()) {
+				$user_is_super = true;
+				$menu['titles'][] = _('Admin');
+				$menu['urls'][] = util_make_url('/admin/') ;
+				if (strstr($request_uri, util_make_uri('/admin/'))) {
+					$selected=count($menu['urls'])-1;
+				}
+			}
+			if ($permstats->isMember()) {
+				$menu['titles'][] = _('Reporting');
+				$menu['urls'][] = util_make_url ('/reporting/') ;
+				if (strstr($request_uri, util_make_uri('/reporting/'))) {
+					$selected=count($menu['urls'])-1;
+				}
+                        }
+		}
+ 
+		// Project
+		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)) {
+				if ($project->isError()) {                                         
+				} elseif (!$project->isProject()) {
+				} else {
+					$menu['titles'][] = $project->getPublicName();
+					if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
+						$menu['urls'][]=util_make_url ('/project/?group_id') .$project->getId();
+					} else {
+						$menu['urls'][]=util_make_url ('/projects/') .$project->getUnixName().'/';
+					}
+					$selected=count($menu['urls'])-1;
+				}
+			}
+		}
+                 
+
+                $menu['selected'] = $selected;
+                          
+                return $menu;
+        }
+  
+
+        /** Get a reference to an array of the projects menu for the
+	 * project with the id $group_id with the following
+	 * structure: $result['starturl']: URL of the
+	 * projects starting page; $result['name']: public name of
+	 * the project; $result['titles']: list of titles of the menu
+	 * entries; $result['urls']: list of urls of the menu
+	 * entries; $result['adminurls']: list of urls to the admin
+	 * pages of the menu entries. If the user has no admin
+	 * permissions, the correpsonding adminurl is
+	 * false. $result['selected']: number of the menu entry that
+	 * is currently selected.
+	 */
+        function &getProjectMenu ($group_id, $toptab="") {
+                // 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 != $this->project_menu_data[$group_id]['last_toptab'])) 
+                {
+                        // get the group and permission objects
+                        $group =& group_get_object($group_id);
+                        if (!$group || !is_object($group)) {
+                                return;
+                        }
+                        if ($group->isError()) {
+                                //wasn't found or some other problem
+                                return;
+                        }
+                        if (!$group->isProject()) {
+                                return;
+                        }
+                        
+                        $perm =& $group->getPermission( session_get_user() );
+                        
+                        $selected = 0;
+                        
+                        $menu =& $this->project_menu_data[$group_id];
+                        $menu['titles'] = array();
+                        $menu['urls'] = array();
+                        $menu['adminurls'] = array();
+
+			$menu['name'] = $group->getPublicName();
+                        
+                        // Summary
+                        $menu['titles'][] = _('Summary');
+                        if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
+                                $url = util_make_url ('/project/?group_id=' . $group_id);
+                        } else {
+                                $url = util_make_url ('/projects/' . $group->getUnixName() .'/');
+                        }
+                        $menu['urls'][] = $url;
+                        $menu['adminurls'][] = false;
+                        if ($toptab == "home") {
+                                $selected = (count($menu['urls'])-1);
+                        }
+
+                        // setting these allows to change the initial project page
+                        $menu['starturl'] = $url;
+                        
+                        // Project Admin
+                        if ($perm->isAdmin()) {
+                                $menu['titles'][] = _('Admin');
+                                $menu['urls'][] = util_make_url ('/project/admin/?group_id=' . $group_id);
+                                $menu['adminurls'][] = false;
+                                if ($toptab == "admin") {
+                                        $selected = (count($menu['urls'])-1);
+                                }
+                        }
+                        
+                        /* Homepage
+			 // check for use_home_tab?
+			 $TABS_DIRS[]='http://'. $this->getHomePage();
+			 $TABS_TITLES[]=_('Home Page');
+                        */
+                        
+                        // Project Activity tab 
+                        $menu['titles'][] = _('Activity');
+                        $menu['urls'][] = util_make_url ('/activity/?group_id=' . $group_id);
+                        $menu['adminurls'][] = false;
+                        if ($toptab == "activity") {
+                                $selected = (count($menu['urls'])-1);
+                        }
+                        
+                        // Forums
+                        if ($group->usesForum()) {
+                                $menu['titles'][] = _('Forums');
+                                $menu['urls'][] = util_make_url ('/forum/?group_id=' . $group_id);
+                                if ($perm->isAdmin() || $perm->isForumAdmin()) {
+                                        $menu['adminurls'][] = util_make_url('/forum/admin/?group_id='.$group_id);
+                                } else {
+                                        $menu['adminurls'][] = false;
+                                }
+                                if ($toptab == "forums") {
+                                        $selected = (count($menu['urls'])-1);
+                                }
+                        }
+                        
+                        // Artifact Tracking
+                        if ($group->usesTracker()) {
+                                $menu['titles'][] = _('Tracker');
+                                $menu['urls'][] = util_make_url ('/tracker/?group_id=' . $group_id);
+                                if ($perm->isAdmin() || $perm->isArtifcatAdmin()) {
+                                        $menu['adminurls'][] = util_make_url('/tracker/admin/?group_id='.$group_id);
+                                } else {
+                                        $menu['adminurls'][] = false;
+                                }
+                                if ($toptab == "tracker" || 
+                                    $toptab == "bugs" || 
+                                    $toptab == "support" || 
+                                    $toptab == "patch") {
+					$selected = (count($menu['urls'])-1);
+				}
+                        }
+                        
+                        
+                        // Mailing Lists
+                        if ($group->usesMail()) {
+                                $menu['titles'][] = _('Lists');
+                                $menu['urls'][] = util_make_url ('/mail/?group_id=' . $group_id);
+                                if ($perm->isAdmin()) {
+                                        $menu['adminurls'][] = util_make_url('/mail/admin/?group_id='.$group_id);
+                                } else {
+                                        $menu['adminurls'][] = false;
+                                }
+                                if ($toptab == "mail") {
+                                        $selected = (count($menu['urls'])-1);
+                                }
+                                
+                        }
+                        
+                        // Project/Task Manager
+                        if ($group->usesPm()) {
+                                $menu['titles'][] = _('Tasks');
+                                $menu['urls'][] = util_make_url ('/pm/?group_id=' . $group_id);
+                                if ($perm->isAdmin() || $perm->isPMAdmin()) {
+                                        $menu['adminurls'][] = util_make_url ('/pm/admin/?group_id='.$group_id);
+                                } else {
+                                        $menu['adminurls'][] = false;
+                                }
+                                if ($toptab == "pm") {
+                                        $selected = (count($menu['urls'])-1);
+                                }
+                                
+                        }
+                        
+                        // Doc Manager
+                        if ($group->usesDocman()) {
+                                $menu['titles'][] = _('Docs');
+                                $menu['urls'][] = util_make_url ('/docman/?group_id=' . $group_id);
+                                if ($perm->isAdmin() || $perm->isDocEditor()) {
+                                        $menu['adminurls'][] = util_make_url ('/docman/admin/?group_id='.$group_id);
+                                } else {
+                                        $menu['adminurls'][] = false;
+                                }
+                                if ($toptab == "docman") {
+                                        $selected = (count($menu['urls'])-1);
+                                }
+                                
+                        }
+                        
+                        // Surveys
+                        if ($group->usesSurvey()) {
+                                $menu['titles'][] = _('Surveys');
+                                $menu['urls'][] = util_make_url ('/survey/?group_id=' . $group_id);
+                                if ($perm->isAdmin()) {
+                                        $menu['adminurls'][] = util_make_url ('/survey/admin/?group_id='.$group_id);
+                                } else {
+                                        $menu['adminurls'][] = false;
+                                }
+                                if ($toptab == "surveys") {
+                                        $selected = (count($menu['urls'])-1);
+                                }
+                        }
+                        
+                        // News
+                        if ($group->usesNews()) {
+                                $menu['titles'][] = _('News');
+                                $menu['urls'][] = util_make_url ('/news/?group_id=' . $group_id);
+                                if ($perm->isAdmin()) {
+                                        $menu['adminurls'][] = util_make_url ('/news/admin/?group_id='.$group_id);
+                                } else {
+                                        $menu['adminurls'][] = false;
+                                }
+                                if ($toptab == "news") {
+                                        $selected = (count($menu['urls'])-1);
+                                }
+                        }
+                        
+                        // SCM systems
+                        if ($group->usesSCM()) {
+                                $menu['titles'][] = _('SCM');
+                                $menu['urls'][] = util_make_url ('/scm/?group_id=' . $group_id);
+                                // eval cvs_flags?
+                                if ($perm->isAdmin()) {
+                                        $menu['adminurls'][] = util_make_url ('/scm/admin/?group_id='.$group_id);
+                                } else {
+                                        $menu['adminurls'][] = false;
+                                }
+                                if ($toptab == "scm") {
+                                        $selected = (count($menu['urls'])-1);
+                                }
+                        }
+                        
+                        // groupmenu_after_scm hook
+                        $hookParams = array();
+                        $hookParams['group_id'] = $group_id ;
+                        $hookParams['DIRS'] =& $menu['urls'];
+                        $hookParams['TITLES'] =& $menu['titles'];
+                        $hookParams['toptab'] =& $toptab;
+                        $hookParams['selected'] =& $selected;
+                        
+                        plugin_hook ("groupmenu_scm", $hookParams) ; 
+                        
+                        // fill up adminurls
+                        for ($i = 0; $i < count($menu['urls']) - count($menu['adminurls']); $i++) {
+                                $menu['adminurls'][] = false;
+                        }
+                        
+                        // Downloads
+                        if ($group->usesFRS()) {
+                                $menu['titles'][] = _('Files');
+                                $menu['urls'][] = util_make_url ('/frs/?group_id=' . $group_id);
+                                if ($perm->isAdmin() || $perm->isReleaseTechnician()) {
+                                        $menu['adminurls'][] = util_make_url ('/frs/admin/?group_id='.$group_id);
+                                } else {
+                                        $menu['adminurls'][] = false;
+                                }
+                                if ($toptab == "frs") {
+                                        $selected = (count($menu['urls'])-1);
+                                }
+                        }
+                        
+                        // groupmenu hook
+                        $hookParams = array();
+                        $hookParams['group'] = $group_id ;
+                        $hookParams['DIRS'] =& $menu['urls'];
+                        $hookParams['TITLES'] =& $menu['titles'];
+                        $hookParams['toptab'] =& $toptab;
+                        $hookParams['selected'] =& $selected;
+                        
+                        plugin_hook ("groupmenu", $hookParams) ;
+                        
+                        // fill up adminurls
+                        for ($i = 0; 
+                             $i < count($menu['urls']) - count($menu['adminurls']); 
+                             $i++) 
+                        {
+                                $menu['adminurls'][] = false;
+                        }
+                        
+                        // store selected menu item (if any)
+                        $menu['selected'] = $selected;
+                        if ($toptab != "") {
+                                $menu['last_toptab'] = $toptab;
+                        }
+                }
+                return $this->project_menu_data[$group_id] ;
+        }
+        
+        /**
+	 * Create the HTML code for the banner "Powered By
+	 * FusionForge". If $asHTML is set to false, it will return an
+	 * array with the following structure: $result['url']: URL for
+	 * the link on the banner; $result['image']: URL of the banner
+	 * image; $result['title']: HTML code that outputs the banner;
+	 * $result['html']: HTML code that creates the banner and the link.
+	 */
+        function getPoweredBy($asHTML=true) {
+                $res['url'] = 'http://fusionforge.org/';
+                $res['image'] = util_make_url ('/images/pow-fusionforge.png');
+                $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) {
+                        return $res['html'];
+                } else {
+                        return $res;
+                }
+        }
+        
+        /** Create the HTML code for the "Show Source" link if
+	 *  $sys_show_source is set, otherwise "". If $asHTML is set
+	 *  to false, it returns NULL when $sys_show_source is not
+	 *  set, otherwise an array with the following structure:
+	 *  $result['url']: URL of the link to the source code viewer;
+	 *  $result['title']: Title of the link.
+	 */
+        function getShowSource($asHTML=true) {
+                global $sys_show_source;
+                if ($sys_show_source) {
+                        $res['url'] = util_make_url('/source.php?file='.getStringFromServer('SCRIPT_NAME'));
+                        $res['title'] = _('Show source');
+                } else {
+                        return ($asHTML ? "" : NULL); 
+                }
+                if (!$asHTML) {
+                        return $res;
+                } else {
+                        return util_make_link($res['url'], $res['title'], 
+                                              array('class' => 'showsource'), 
+                                              true);
+                }
+        }
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>
\ No newline at end of file

Modified: trunk/gforge/www/include/Layout.class.php
===================================================================
--- trunk/gforge/www/include/Layout.class.php	2010-03-03 09:45:48 UTC (rev 8913)
+++ trunk/gforge/www/include/Layout.class.php	2010-03-03 10:31:50 UTC (rev 8914)
@@ -1,302 +1,469 @@
 <?php
-/**
- * Base layout class.
- *
- * Extends the basic Error class to add HTML functions
- * for displaying all site dependent HTML, while allowing
- * extendibility/overriding by themes via the Theme class.
- *
- * Make sure browser.php is included _before_ you create an instance
- * of this object.
- *
- * Geoffrey Herteg, August 29, 2000
- *
- */
+  /**
+   * Base layout class.
+   *
+   * Extends the basic Error class to add HTML functions
+   * for displaying all site dependent HTML, while allowing
+   * extendibility/overriding by themes via the Theme class.
+   *
+   * Make sure browser.php is included _before_ you create an instance
+   * of this object.
+   *
+   * Geoffrey Herteg, August 29, 2000
+   *
+   */
  
 require_once $gfcommon.'include/constants.php';
-require_once $gfwww.'search/include/SearchManager.class.php';
+require_once $gfcommon.'include/Navigation.class.php';
 
 class Layout extends Error {
 
+        /**
+	 * Which doctype to use. Can be configured in the
+	 * constructor. If set to 'strict', headerHTMLDeclaration will
+	 * create a doctype definition that uses the strict doctype,
+	 * otherwise it will use the transitional doctype.  
+	 * @var string $doctype
+	 */
+        var $doctype = 'transitional';
+        
 	/**
-	 * The default main page content */
+	 * Which cssfiles to use. Can be configured in the
+	 * constructor. 
+	 *
+	 * @var array $cssurls is a list of urls that should point to
+	 * the used stylesheets.
+	 */
+	var $cssurls;
+
+	/**
+	 * The default main page content 
+	 * @var      string $rootindex
+         */
 	var $rootindex = 'index_std.php';
 
+	/**
+	 * The base directory of the theme in the servers file system
+	 * @var      string $themedir
+	 */ 
+        var $themedir;
+         
+	/**
+	 * The base url of the theme
+	 * @var      string $themeurl
+	 */ 
+	var $themeurl;
+
+	/**
+	 * The base directory of the css files in the servers file system
+	 * @var      string $cssdir
+	 */ 
+        var $cssdir;
+
+	/**
+	 * The base url of the css files
+	 * @var      string $cssbaseurl
+	 */ 
+        var $cssbaseurl;
+
+	/**
+	 * The base directory of the image files in the servers file system
+	 * @var      string $imgdir
+	 */ 
+        var $imgdir;
+
+	/**
+	 * The base url of the image files
+	 * @var      string $imgbaseurl
+	 */ 
+        var $imgbaseurl;
+
+	/**
+	 * The base directory of the js files in the servers file system
+	 * @var      string $jsdir
+	 */ 
+        var $jsdir;
+         
+	/**
+	 * The base url of the js files
+	 * @var      string $jsbaseurl
+	 */ 
+        var $jsbaseurl;
+         
 	/*
-     * The root location of the theme
-     * @var      string $themeroot
-	 */
-	 
-	var $themeroot;  	 
+         * kept for backwards compatibility
+         */
 	/**
-	 * The root location for images
-	 *
-	 * @var		string	$imgroot
-	 */
+         * The base directory of the theme
+         * @var string $themeroot
+         * @todo: remove in 5.0
+         * @deprecated deprecated since 4.9
+         */
+	var $themeroot;
 
+	/**
+         * The base directory of the theme
+         * @var string $themeroot
+         * @todo: remove in 5.0
+         * @deprecated deprecated since 4.9
+         */
 	var $imgroot;
+         
+        /**
+         * The navigation object that provides the basic links. Should
+         * not be modified.
+         */
+        var $navigation;
+        
 
-
 	/**
 	 * Layout() - Constructor
 	 */
 	function Layout() {
+                // parent constructor
+                $this->Error();
+
+                $this->navigation = new Navigation();
+                
 		// determine rootindex
-		if ( file_exists($GLOBALS['sys_custom_path'] . '/index_std.php') )
+		if ( file_exists($GLOBALS['sys_custom_path'] . '/index_std.php') ) {
 			$this->rootindex = $GLOBALS['sys_custom_path'] . '/index_std.php';
-		else
+		} else {
 			$this->rootindex = $GLOBALS['gfwww'].'index_std.php';
+		}
 
-		// determine themeroot
-		$this->themeroot = $GLOBALS['sys_themeroot'].$GLOBALS['sys_theme'];
-		/* if images directory exists in theme, then use it as imgroot */
-		if (file_exists ($this->themeroot.'/images')){
-			$this->imgroot = util_make_uri ('/themes/'.$GLOBALS['sys_theme'].'/images/');
+		// determine theme{dir,url}
+		$this->themedir = $GLOBALS['sys_themeroot'] . $GLOBALS['sys_theme'] . '/';
+		if (!file_exists ($this->themedir)) {
+			html_error_top(_("Can't find theme directory!"));
+			return;
 		}
-        
-		$this->Error();
+		$this->themeurl = util_make_url('themes/' . $GLOBALS['sys_theme'] . '/');
+                 
+		// determine {css,img,js}{url,dir}
+		if (file_exists ($this->themedir . 'css/')) {
+			$this->cssdir = $this->themedir . 'css/';
+			$this->cssbaseurl = $this->themeurl . 'css/';
+		} else {
+			$this->cssdir = $this->themedir;
+			$this->cssbaseurl = $this->themeurl;
+		}
+                 
+		if (file_exists ($this->themedir . 'images/')) {
+			$this->imgdir = $this->themedir . 'images/';
+			$this->imgbaseurl = $this->themeurl . 'images/';
+		} else {
+			$this->imgdir = $this->themedir;
+			$this->imgbaseurl = $this->themeurl;
+		}
+                 
+		if (file_exists ($this->themedir . 'js/')) {
+			$this->jsdir = $this->themedir . 'js/';
+			$this->jsbaseurl = $this->themeurl . 'js/';
+		} else {
+			$this->jsdir = $this->themedir;
+			$this->jsbaseurl = $this->themeurl;
+		}
+
+		// determine CSS stylesheets
+		$this->cssurls[] = util_make_url ('/themes/css/fusionforge.css');
+
+		/* check if a personalized css stylesheet exist, if yes include only
+		 this stylesheet. New stylesheets should use the <themename>.css file.
+		*/
+		$theme_cssfile = $GLOBALS['sys_theme'] . '.css';
+		if (file_exists($this->cssdir . $theme_cssfile)) {
+			$this->cssurls[] = $this->cssbaseurl . $theme_cssfile;
+		} else {
+			/* if this is not the case, then include the compatibility stylesheet
+			 that contains all removed styles from the code and check if a
+			 custom stylesheet exists. 
+			 Used for compatibility with existing stylesheets
+			*/
+			$this->cssurls[] = util_make_url('/themes/css/gforge-compat.css');
+			if (file_exists($this->cssdir . 'theme.css')) {
+				$this->cssurls[] = $this->cssbaseurl . 'theme.css';
+			}
+		}
+
+		// for backward compatibility 
+		$this->themeroot = $this->themedir;
+		$this->imgroot = $this->imgbaseurl;
 	}
 
-	/**
-	 *	headerLink() - common code for all themes
-	 *
+        /** 
+	 * header() - generates the complete header of page by calling 
+	 * headerStart() and bodyHeader().
 	 */
-	function headerLink() {
-		echo '<link rel="alternate" title="'.$GLOBALS['sys_name'].' - Project News Highlights RSS" href="'.util_make_url ('/export/rss_sfnews.php').'" type="application/rss+xml"/>';
-		echo '<link rel="alternate" title="'.$GLOBALS['sys_name'].' - Project News Highlights RSS 2.0" href="'.util_make_url ('/export/rss20_news.php').'" type="application/rss+xml"/>';
-		echo '<link rel="alternate" title="'.$GLOBALS['sys_name'].' - New Projects RSS" href="'.util_make_url ('/export/rss_sfprojects.php').'" type="application/rss+xml"/>';
-		echo '<link rel="search"  title="'.$GLOBALS['sys_name'].'" href="'.util_make_url ('/export/search_plugin.php').'" type="application/opensearchdescription+xml"/>';
+	function header($params) {
+		$this->headerStart($params); ?>
+			<body>
+				 <?php
+				 $this->bodyHeader($params);
 	}
 
+               
 	/**
-	 *	headerStart() - common code for all themes
+	 * headerStart() - generates the header code for all themes up to the 
+	 * closing </head>.
+	 * Override any of the methods headerHTMLDeclaration(), headerTitle(), 
+	 * headerFavIcon(), headerRSS(), headerSearch(), headerCSS(), or 
+	 * headerJS() to adapt your theme. 
 	 *
 	 * @param	array	Header parameters array
 	 */
 	function headerStart($params) {
-		if (!$params['title']) {
-			$params['title'] =  $GLOBALS['sys_name'];
-		} else {
-			$params['title'] =  $GLOBALS['sys_name'] . ': ' . $params['title'];
-		}
-		print '<?xml version="1.0" encoding="utf-8"';
+                $this->headerHTMLDeclaration();
+                ?>		
+			<head>
+				 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+				 <?php 
+				 $this->headerTitle($params);
+                $this->headerFavIcon();
+                $this->headerRSS();
+                $this->headerSearch();
+                $this->headerCSS();
+                $this->headerJS(); 
 		?>
+			</head>
+				  <?php 
+				  } 
 
-<!DOCTYPE html
-	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+        /**
+	 * headerLink() - creates the link headers of the page (FavIcon, RSS and Search)
+	 * @deprecated deprecated since 4.9, use the individual header-functions
+	 * @todo remove in 5.0
+	 */
+	function headerLink() {
+                $this->headerFavIcon();
+                $this->headerRSS();
+                $this->headerSearch();
+	}
 
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo _('en') ?>" lang="<?php echo _('en') ?>">
+	/**
+	 * headerHTMLDeclaration() - generates the HTML declaration, i.e. the
+	 * XML declaration, the doctype definition, and the opening <html>. 
+	 *
+	 */
+        function headerHTMLDeclaration() {
+		print '<?xml version="1.0" encoding="utf-8"?>';
+		if ($this->doctype=='strict') { 
+			echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
+		} else {
+			echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
+		} 
+		echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' 
+			. _('en') . '" lang="' . _('en') . '">';
+        }
 
-  <head>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-	<title><?php echo $params['title']; ?></title>
-	<?php $this->headerLink(); ?>
-	
-	<?php	if (isset($GLOBALS['group_id'])) { 
-			$activity = '<link rel="alternate" title="' . $GLOBALS['sys_name'] . ' - New Activity RSS" href="'. util_make_url ('/export/rss20_activity.php?group_id='.$GLOBALS['group_id']).'" type="application/rss+xml"/>';
-			echo $activity;
-		}
-	?>
-	<?php $this->headerCSS(); ?>
+	/**
+	 * headerTitle() - creates the <title> header 
+	 *
+	 * @param	array	Header parameters array
+	 */
+	function headerTitle($params) {
+		echo $this->navigation->getTitle($params);
+	}
+        
+        
+	/**
+	 * headerFavIcon() - creates the favicon <link> headers 
+	 *
+	 */
+	function headerFavIcon() {
+		echo $this->navigation->getFavIcon();
+	}
 
-	<script language="JavaScript" type="text/javascript">
-	<!--
+        /**
+	 * headerRSS() - creates the RSS <link> headers 
+	 *
+	 */
+	function headerRSS() {
+		echo $this->navigation->getRSS();
+	}
 
-	function admin_window(adminurl) {
-		AdminWin = window.open( adminurl, 'AdminWindow','scrollbars=yes,resizable=yes, toolbar=yes, height=400, width=400, top=2, left=2');
-		AdminWin.focus();
+        /**
+	 * headerSearch() - creates the search <link> header 
+	 *
+	 */
+	function headerSearch() {
+		echo '<link rel="search" title="' 
+			. $GLOBALS['sys_name'].'" href="' 
+			. util_make_url ('/export/search_plugin.php') 
+			. '" type="application/opensearchdescription+xml"/>';
 	}
-	function help_window(helpurl) {
-		HelpWin = window.open( helpurl,'HelpWindow','scrollbars=yes,resizable=yes,toolbar=no,height=400,width=400');
-	}
-	// -->
-	<?php plugin_hook ("javascript",false) ; ?>
-	</script>
-</head>
-<?php 
-	} 
-	
+
+        /** 
+	 * Create the CSS headers for all cssfiles in $cssfiles and
+	 * calls the plugin cssfile hook.
+	 */
 	function headerCSS() {
-		/* check if a personalized css stylesheet exist, if yes include only
-   		this stylesheet
-   		new stylesheets should use the <themename>.css file
-		*/
-		$theme_cssfile = $this->themeroot . '/css/'.$GLOBALS['sys_theme'].'.css';
-		if (file_exists($theme_cssfile)){
-			echo '
-	<link rel="stylesheet" type="text/css" href="'.util_make_uri ('/themes/'.$GLOBALS['sys_theme'].'/css/'.$GLOBALS['sys_theme'].'.css').'"/>';
-		} else {
-		/* if this is not our case, then include the compatibility stylesheet
-   		that contains all removed styles from the code and check if a
-   		custom stylesheet exists. 
-   		Used for compatibility with existing stylesheets
-		*/
-			echo '
-	<link rel="stylesheet" type="text/css" href="'.util_make_uri ('/themes/css/gforge-compat.css').'" />';
-			$theme_cssfile = $this->themeroot . '/css/theme.css';
-			if (file_exists($theme_cssfile)){
-				echo '
-	<link rel="stylesheet" type="text/css" href="'.util_make_uri ('/themes/'.$GLOBALS['sys_theme'].'/css/theme.css').'" />';
-			}
+                // include the common css
+		foreach ($this->cssurls as $cssurl) {
+			echo '<link rel="stylesheet" type="text/css" href="' . $cssurl . '" />';
 		}
+
 		plugin_hook ('cssfile',$this);
 	}
 
-	function header($params) {
-		$this->headerStart($params); ?>
-<body>
-		<?php
-		$this->bodyHeader($params);
-	}
-
-	function bodyHeader($params){
+        /** 
+	 * headerJS() - creates the JS headers and calls the plugin javascript hook
+	 * @todo generalize this
+	 */
+	function headerJS() { 
 		?>
-<div class="header">
-<table border="0" width="100%" cellspacing="0" cellpadding="0" id="headertable">
+                
+		<script language="JavaScript" type="text/javascript">
+			<!--
 
-	<tr>
-		<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()) {
-				$u =& user_get_object(user_getid());
-				echo util_make_link ('/account/logout.php', sprintf("%s (%s)", _('Log Out'), $u->getRealName()),array('class'=>'lnkutility'));
-				echo util_make_link ('/account/',_('My Account'),array('class'=>'lnkutility'));
-			} else {
-				echo util_make_link ('/account/login.php',_('Log In'),array('class'=>'lnkutility'));
-				if (!$GLOBALS['sys_user_reg_restricted']) {
-					echo util_make_link ('/account/register.php',_('New Account'),array('class'=>'lnkutility'));
-				}
-			}
+			function admin_window(adminurl) {
+			AdminWin = window.open( adminurl, 'AdminWindow','scrollbars=yes,resizable=yes, toolbar=yes, height=400, width=400, top=2, left=2');
+			AdminWin.focus();
+		}
+		function help_window(helpurl) {
+			HelpWin = window.open( helpurl,'HelpWindow','scrollbars=yes,resizable=yes,toolbar=no,height=400,width=400');
+		}
+		// -->
+		<?php plugin_hook ("javascript",false) ; ?>
+			  </script> 
+				    <?php
+				    }
+               
+        function bodyHeader($params){
+		?>
+		<div class="header">
+			<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><?php $this->searchBox(); ?></td>
+																							      <td align="right"><?php
+																							      $items = $this->navigation->getUserLinks();
+                for ($j = 0; $j < count($items['titles']); $j++) {
+                        echo util_make_link($items['urls'][$j], $items['titles'][$j], array('class'=>'lnkutility'), true);
+                }
 			
-			$params['template'] = ' {menu}';
-			plugin_hook ('headermenu', $params);
+                $params['template'] = ' {menu}';
+                plugin_hook ('headermenu', $params);
 			
-			echo $this->quickNav();
+                $this->quickNav();
 
 		?></td>
-		<td>&nbsp;&nbsp;</td>
-	</tr>
+			    <td>&nbsp;&nbsp;</td>
+						      </tr>
 
-</table>
+						      </table>
 
-<table border="0" width="100%" cellspacing="0" cellpadding="0">
+						      <table border="0" width="100%" cellspacing="0" cellpadding="0">
 
-	<tr>
-		<td>&nbsp;</td>
-		<td colspan="3">
+						      <tr>
+						      <td>&nbsp;</td>
+									  <td colspan="3">
 
-<?php echo $this->outerTabs($params); ?>
+									  <?php echo $this->outerTabs($params); ?>
 
-		</td>
-		<td>&nbsp;</td>
-	</tr>
+									  </td>
+										    <td>&nbsp;</td>
+													</tr>
 
-	<tr>
-		<td align="left" class="toptab" width="9"><img src="<?php echo $this->imgroot; ?>tabs/topleft.png" height="9" width="9" alt="" /></td>
-		<td class="toptab" width="30"><img src="<?php echo $this->imgroot; ?>clear.png" width="30" height="1" alt="" /></td>
-		<td class="toptab"><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td>
-		<td class="toptab" width="30"><img src="<?php echo $this->imgroot; ?>clear.png" width="30" height="1" alt="" /></td>
-		<td align="right" class="toptab" width="9"><img src="<?php echo $this->imgroot; ?>tabs/topright.png" height="9" width="9" alt="" /></td>
-	</tr>
+													<tr>
+													<td align="left" class="toptab" width="9"><img src="<?php echo $this->imgbaseurl; ?>tabs/topleft.png" height="9" width="9" alt="" /></td>
+													<td class="toptab" width="30"><img src="<?php echo $this->imgbaseurl; ?>clear.png" width="30" height="1" alt="" /></td>
+													<td class="toptab"><img src="<?php echo $this->imgbaseurl; ?>clear.png" width="1" height="1" alt="" /></td>
+													<td class="toptab" width="30"><img src="<?php echo $this->imgbaseurl; ?>clear.png" width="30" height="1" alt="" /></td>
+													<td align="right" class="toptab" width="9"><img src="<?php echo $this->imgbaseurl; ?>tabs/topright.png" height="9" width="9" alt="" /></td>
+													</tr>
 
-	<tr>
+													<tr>
 
-		<!-- Outer body row -->
+													<!-- Outer body row -->
 
-		<td class="toptab"><img src="<?php echo $this->imgroot; ?>clear.png" width="10" height="1" alt="" /></td>
-		<td valign="top" width="99%" class="toptab" colspan="3">
+													<td class="toptab"><img src="<?php echo $this->imgbaseurl; ?>clear.png" width="10" height="1" alt="" /></td>
+													<td valign="top" width="99%" class="toptab" colspan="3">
 
-			<!-- Inner Tabs / Shell -->
+													<!-- Inner Tabs / Shell -->
 
-			<table border="0" width="100%" cellspacing="0" cellpadding="0">
-<?php
+													<table border="0" width="100%" cellspacing="0" cellpadding="0">
+													<?php
 
 
-if (isset($params['group']) && $params['group']) {
+													if (isset($params['group']) && $params['group']) {
 
-			?>
-			<tr>
-				<td>&nbsp;</td>
-				<td>
-				<?php
+														?>
+														<tr>
+														<td>&nbsp;</td>
+														<td>
+														<?php
 
-				echo $this->projectTabs($params['toptab'],$params['group']);
+														echo $this->projectTabs($params['toptab'],$params['group']);
 
-				?>
-				</td>
-				<td>&nbsp;</td>
-			</tr>
-			<?php
-}
-?>
-			<tr>
-				<td align="left" class="projecttab" width="9"><img src="<?php echo $this->imgroot; ?>tabs/topleft-inner.png" height="9" width="9" alt="" /></td>
-				<td class="projecttab" ><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td>
-				<td align="right" class="projecttab"  width="9"><img src="<?php echo $this->imgroot; ?>tabs/topright-inner.png" height="9" width="9" alt="" /></td>
-			</tr>
+														?>
+														</td>
+														<td>&nbsp;</td>
+														</tr>
+														<?php
+													}
+		?>
+													<tr>
+														 <td align="left" class="projecttab" width="9"><img src="<?php echo $this->imgbaseurl; ?>tabs/topleft-inner.png" height="9" width="9" alt="" /></td>
+														 <td class="projecttab" ><img src="<?php echo $this->imgbaseurl; ?>clear.png" width="1" height="1" alt="" /></td>
+														 <td align="right" class="projecttab"  width="9"><img src="<?php echo $this->imgbaseurl; ?>tabs/topright-inner.png" height="9" width="9" alt="" /></td>
+														 </tr>
 
-			<tr>
-				<td class="projecttab" ><img src="<?php echo $this->imgroot; ?>clear.png" width="10" height="1" alt="" /></td>
-				<td valign="top" width="99%" class="projecttab">
+														 <tr>
+														 <td class="projecttab" ><img src="<?php echo $this->imgbaseurl; ?>clear.png" width="10" height="1" alt="" /></td>
+														 <td valign="top" width="99%" class="projecttab">
 
-	<?php
+														 <?php
 
-				 }
+														 }
 	
 	function footer($params) {
 
-	?>
+		?>
 
-			<!-- end main body row -->
+		<!-- end main body row -->
 
 
-				</td>
-				<td width="10" class="footer3" ><img src="<?php echo $this->imgroot; ?>clear.png" width="2" height="1" alt="" /></td>
+			</td>
+			<td width="10" class="footer3" ><img src="<?php echo $this->imgbaseurl; ?>clear.png" width="2" height="1" alt="" /></td>
 			</tr>
 			<tr>
-				<td align="left" class="footer1" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomleft-inner.png" height="11" width="11" alt="" /></td>
-				<td class="footer3"><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td>
-				<td align="right" class="footer1" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomright-inner.png" height="11" width="11" alt="" /></td>
+			<td align="left" class="footer1" width="9"><img src="<?php echo $this->imgbaseurl; ?>tabs/bottomleft-inner.png" height="11" width="11" alt="" /></td>
+			<td class="footer3"><img src="<?php echo $this->imgbaseurl; ?>clear.png" width="1" height="1" alt="" /></td>
+			<td align="right" class="footer1" width="9"><img src="<?php echo $this->imgbaseurl; ?>tabs/bottomright-inner.png" height="11" width="11" alt="" /></td>
 			</tr>
 			</table>
 
-		<!-- end inner body row -->
+			<!-- end inner body row -->
 
-		</td>
-		<td width="10" class="footer2"><img src="<?php echo $this->imgroot; ?>clear.png" width="2" height="1" alt="" /></td>
-	</tr>
-	<tr>
-		<td align="left" class="footer2" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomleft.png" height="9" width="9" alt="" /></td>
-		<td class="footer2" colspan="3"><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td>
-		<td align="right" class="footer2" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomright.png" height="9" width="9" alt="" /></td>
-	</tr>
-</table>
-<?php
-		$this->footerEnd($params);
+			</td>
+			<td width="10" class="footer2"><img src="<?php echo $this->imgbaseurl; ?>clear.png" width="2" height="1" alt="" /></td>
+			</tr>
+			<tr>
+			<td align="left" class="footer2" width="9"><img src="<?php echo $this->imgbaseurl; ?>tabs/bottomleft.png" height="9" width="9" alt="" /></td>
+			<td class="footer2" colspan="3"><img src="<?php echo $this->imgbaseurl; ?>clear.png" width="1" height="1" alt="" /></td>
+			<td align="right" class="footer2" width="9"><img src="<?php echo $this->imgbaseurl; ?>tabs/bottomright.png" height="9" width="9" alt="" /></td>
+			</tr>
+			</table>
+			<?php
+			$this->footerEnd($params);
 	}
 
 	function footerEnd($params) { ?>
 
-<!-- PLEASE LEAVE "Powered By FusionForge" on your site -->
-<div align="right">
-<a href="http://fusionforge.org/"><img src="<?php echo util_make_uri ('/images/pow-fusionforge.png'); ?>" alt="Powered By FusionForge" border="0" /></a>
-</div>
+		<!-- PLEASE LEAVE "Powered By FusionForge" on your site -->
+			<div align="right">
+			<?php echo $this->navigation->getPoweredBy(); ?>
+			</div>
 
-<?php
-	global $sys_show_source;
-	if ($sys_show_source) {
-		echo util_make_link ('/source.php?file='.getStringFromServer('SCRIPT_NAME'),_('Show source'),array('class'=>'showsource'));
-	}
-?>
+				  <?php echo $this->navigation->getShowSource(); ?> 
 
-</body>
-</div>
-</html>
-<?php
+				  </body>
+					    </div>
+					    </html>
+					    <?php
 
-	}
+					    }
 
 	function getRootIndex() {
 		return $this->rootindex;
@@ -313,11 +480,11 @@
 		return '
 		<!-- Box Top Start -->
 
-		<table cellspacing="0" cellpadding="0" width="100%" border="0" style="background:url('.$this->imgroot.'vert-grad.png)">
+		<table cellspacing="0" cellpadding="0" width="100%" border="0" style="background:url('.$this->imgbaseurl.'vert-grad.png)">
 		<tr class="align-center">
-			<td valign="top" align="right" width="10" style="background:url('.$this->imgroot.'box-topleft.png)"><img src="'.$this->imgroot.'clear.png" width="10" height="20" alt="" /></td>
-			<td width="100%" style="background:url('.$this->imgroot.'box-grad.png)"><span class="titlebar">'.$title.'</span></td>
-			<td valign="top" width="10" style="background:url('.$this->imgroot.'box-topright.png)"><img src="'.$this->imgroot.'clear.png" width="10" height="20" alt="" /></td>
+			<td valign="top" align="right" width="10" style="background:url('.$this->imgbaseurl.'box-topleft.png)"><img src="'.$this->imgbaseurl.'clear.png" width="10" height="20" alt="" /></td>
+			<td width="100%" style="background:url('.$this->imgbaseurl.'box-grad.png)"><span class="titlebar">'.$title.'</span></td>
+			<td valign="top" width="10" style="background:url('.$this->imgbaseurl.'box-topright.png)"><img src="'.$this->imgbaseurl.'clear.png" width="10" height="20" alt="" /></td>
 		</tr>
 		<tr>
 			<td colspan="3">
@@ -340,7 +507,7 @@
 					</td>
 				</tr>
 				<tr class="align-center">
-					<td colspan="2" style="background:url('.$this->imgroot.'box-grad.png)"><span class="titlebar">'.$title.'</span></td>
+					<td colspan="2" style="background:url('.$this->imgbaseurl.'box-grad.png)"><span class="titlebar">'.$title.'</span></td>
 				</tr>
 				<tr align="left">
 					<td colspan="2">
@@ -387,8 +554,8 @@
 		$return = '
 		<table cellspacing="0" cellpadding="0" width="100%" border="0">
 		<tr class="align-center">
-	<!--		<td valign="top" align="right" width="10" style="background:url('.$this->imgroot.'box-grad.png)"><img src="'.$this->imgroot.'box-topleft.png" width="10" height="75" alt="" /></td> -->
-			<td style="background:url('.$this->imgroot.'box-grad.png)">
+	<!--		<td valign="top" align="right" width="10" style="background:url('.$this->imgbaseurl.'box-grad.png)"><img src="'.$this->imgbaseurl.'box-topleft.png" width="10" height="75" alt="" /></td> -->
+			<td style="background:url('.$this->imgbaseurl.'box-grad.png)">
 		<table width="100%" border="0" cellspacing="1" cellpadding="2" >
 			<tr class="tableheading">';
 		$count=count($title_arr);
@@ -407,116 +574,24 @@
 
 	function listTableBottom() {
 		return '</table></td>
-			<!-- <td valign="top" align="right" width="10" style="background:url('.$this->imgroot.'box-grad.png)"><img src="'.$this->imgroot.'box-topright.png" width="10" height="75" alt="" /></td> -->
+			<!-- <td valign="top" align="right" width="10" style="background:url('.$this->imgbaseurl.'box-grad.png)"><img src="'.$this->imgbaseurl.'box-topright.png" width="10" height="75" alt="" /></td> -->
 			</tr></table>';
 	}
 
 	function outerTabs($params) {
-		global $sys_use_trove,$sys_use_snippet,$sys_use_people,$sys_use_project_tags, $sys_use_project_full_list;
+                $menu =& $this->navigation->getSiteMenu();
 
-		$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[]=util_make_url ('/softwaremap/') ;
-		}
-		if ($sys_use_snippet) {
-			$TABS_DIRS[]=util_make_url ('/snippet/') ;
-		}
-		if ($sys_use_people) {
-			$TABS_DIRS[]=util_make_url ('/people/') ;
-		}
-		$TABS_TITLES[]=_('Home');
-		$TABS_TITLES[]=_('My&nbsp;Page');
-		if ($sys_use_trove || $sys_use_project_tags || $sys_use_project_full_list) {
-			$TABS_TITLES[]=_('Projects');
-		}
-		if ($sys_use_snippet) {
-			$TABS_TITLES[]=_('Code&nbsp;Snippets');
-		}
-		if ($sys_use_people) {
-			$TABS_TITLES[]=_('Project&nbsp;Openings');
-		}
+		echo $this->tabGenerator($menu['urls'], $menu['titles'], false, $menu['selected'], '');
 
-		// outermenu hook
-		$PLUGIN_TABS_DIRS = Array();
-		$hookParams['DIRS'] = &$PLUGIN_TABS_DIRS;
-		$hookParams['TITLES'] = &$TABS_TITLES;
-		plugin_hook ("outermenu", $hookParams) ;
-		$TABS_DIRS = array_merge($TABS_DIRS, $PLUGIN_TABS_DIRS);
-
-		$user_is_super=false;
-		if (session_loggedin()) {
-			$projectmaster =& group_get_object(GROUP_IS_MASTER);
-			$projectstats =& group_get_object(GROUP_IS_STATS);
-			$permmaster =& $projectmaster->getPermission( session_get_user() );
-			$permstats =& $projectstats->getPermission( session_get_user() );
-
-			if ($permmaster->isAdmin()) {
-				$user_is_super=true;
-				$TABS_DIRS[]=util_make_url ('/admin/') ;
-				$TABS_TITLES[]=_('Admin');
-			}
-			if ($permstats->isMember()) {
-				$TABS_DIRS[]=util_make_url ('/reporting/') ;
-				$TABS_TITLES[]=_('Reporting');
-			}
-		}
-		if(isset($params['group']) && $params['group']) {
-			// get group info using the common result set
-			$project =& group_get_object($params['group']);
-			if ($project && is_object($project)) {
-				if ($project->isError()) {
-
-				} elseif (!$project->isProject()) {
-
-				} else {
-					if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
-						$TABS_DIRS[]=util_make_url ('/project/?group_id') .$project->getId();
-					} else {
-						$TABS_DIRS[]=util_make_url ('/projects/') .$project->getUnixName().'/';
-					}
-					$TABS_TITLES[]=$project->getPublicName();
-					$selected=count($TABS_DIRS)-1;
-				}
-			}
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_uri ('/my/') ) || 
-			  strstr(getStringFromServer('REQUEST_URI'),util_make_uri ('/account/') ) || 
-			  strstr(getStringFromServer('REQUEST_URI'),util_make_uri ('/register/') ) ||  
-			  strstr(getStringFromServer('REQUEST_URI'),util_make_uri ('/themes/') ) ) {
-			$selected=array_search(util_make_url ('/my/'), $TABS_DIRS);
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_uri ('softwaremap') )) {
-			$selected=array_search(util_make_url ('/softwaremap/'), $TABS_DIRS);
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_uri ('/snippet/') )) {
-			$selected=array_search(util_make_url ('/snippet/'), $TABS_DIRS);
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_uri ('/people/') )) {
-			$selected=array_search(util_make_url ('/people/'), $TABS_DIRS);
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_uri ('/reporting/') )) {
-			$selected=array_search(util_make_url ('/reporting/'),$TABS_DIRS);
-		} elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_uri ('/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'), parse_url ($PLUGIN_TABS_DIRS_VALUE, PHP_URL_PATH))) {
-					$selected=array_search($PLUGIN_TABS_DIRS_VALUE, $TABS_DIRS);
-					break;
-				}
-			}
-		} else {
-			$selected=0;
-		}
-		echo $this->tabGenerator($TABS_DIRS, $TABS_TITLES, false, $selected, '');
-
 	}
 
 	/**
-	 *	quicknav() - Prints out the quicknav menu, contained
-	 *		here in case we want to allow it to be
-	 *		overridden.
-	 *
+	 * Prints out the quicknav menu, contained here in case we
+	 * want to allow it to be overridden.
 	 */
 	function quickNav() {
 		if (!session_loggedin()) {
-			return '';
+			return;
 		} else {
 			// get all projects that the user belongs to
 			$res = db_query_params ('SELECT group_id FROM groups JOIN user_group USING (group_id) WHERE user_group.user_id=$1 AND groups.status=$2 ORDER BY group_name',
@@ -524,50 +599,38 @@
 						       'A'));
 			echo db_error();
 			if (!$res || db_numrows($res) < 1) {
-				return '';
+				return;
 			} else {
-				$ret = '
+				echo '
 		<form id="quicknavform" name="quicknavform" action=""><div>
 			<select name="quicknav" id="quicknav" onChange="location.href=document.quicknavform.quicknav.value">
 				<option value="">'._('Quick Jump To...').'</option>';
 
 				for ($i = 0; $i < db_numrows($res); $i++) {
 					$group_id = db_result($res, $i, 'group_id');
-					$project =& group_get_object($group_id);
-					if (!$project || !is_object($project)) {
-						return;
-					}
-					if ($project->isError()) {
-						//wasn't found or some other problem
-						return;
-					}
-					if (!$project->isProject()) {
-						return;
-					}
-			
-					$menu = $project->getMenu();
-					$ret .= '
-				<option value="' . $menu['start'] . '">' 
-						. $project->getPublicName() .'</option>';
+					$menu =& $this->navigation->getProjectMenu($group_id);
+                                        
+					echo '
+				<option value="' . $menu['starturl'] . '">' 
+						. $menu['name'] .'</option>';
 
-					for ($j = 0; $j < count($menu['dirs']); $j++) {
-						$ret .= '
-				<option value="' . $menu['dirs'][$j] .'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' 
+					for ($j = 0; $j < count($menu['urls']); $j++) {
+						echo '
+				<option value="' . $menu['urls'][$j] .'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' 
 							. $menu['titles'][$j] . '</option>';
-						if ($menu['admindirs'][$j]) {
-							$ret .= '
-				<option value="' . $menu['admindirs'][$j] 
-					. '">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' 
-					. _('Admin') . '</option>';
+						if ($menu['adminurls'][$j]) {
+							echo  '
+				<option value="' . $menu['adminurls'][$j] 
+								. '">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' 
+								. _('Admin') . '</option>';
 						}
 					}
 				}
-				$ret .= '
+				echo '
 			</select>
 		</div></form>';
 			}
 		}
-		return $ret;
 	}
 
 	/**
@@ -577,23 +640,11 @@
 	 *	@param	string	Is the tab currently selected
 	 *	@param	string	Is the group we should look up get title info
 	 */
-	function projectTabs($toptab, $group) {
+	function projectTabs($toptab, $group_id) {
 		// get group info using the common result set
-		$project =& group_get_object($group);
-		if (!$project || !is_object($project)) {
-			return;
-		}
-		if ($project->isError()) {
-			//wasn't found or some other problem
-			return;
-		}
-		if (!$project->isProject()) {
-			return;
-		}
+		$menu =& $this->navigation->getProjectMenu($group_id, $toptab);
 
-		$menu = $project->getMenu($toptab);
-
-		echo $this->tabGenerator($menu['dirs'], $menu['titles'], true, $menu['selected'], 'white');
+		echo $this->tabGenerator($menu['urls'], $menu['titles'], true, $menu['selected'], 'white');
 	}
 
 	function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='white',$total_width='100%') {
@@ -625,12 +676,12 @@
 				$wassel=false;
 				$issel=($selected==$i);
 				$bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png');
-		//		$rowspan=(($issel)?'rowspan="2" ' : '');
+				//		$rowspan=(($issel)?'rowspan="2" ' : '');
 
 				$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')),true).'</td>';
+					<td '.$rowspan.'valign="top" width="10" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-end-'.(($issel) ? '' : 'not').'selected.png)">'.
+					'<img src="'.$this->imgbaseurl . 'clear.png" height="25" width="10" alt="" /></td>'.
+					'<td '.$rowspan.'style="background:url('.$this->imgbaseurl . $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
@@ -638,20 +689,20 @@
 				$wassel=($selected==$i-1);
 				$issel=($selected==$i);
 				$bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png');
-		//		$rowspan=(($issel)?'rowspan="2" ' : '');
+				//		$rowspan=(($issel)?'rowspan="2" ' : '');
 				//
 				//	Build image between current and prior tab
 				//
 				$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')),true).'</td>';
+					<td '.$rowspan.'colspan="2" valign="top" width="20" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png)">'.
+					'<img src="'.$this->imgbaseurl . 'clear.png" height="2" width="20" alt="" /></td>'.
+					'<td '.$rowspan.'style="background:url('.$this->imgbaseurl . $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
 				//
 				$return .= '
-					<td '.$rowspan.'valign="top" width="10" style="background:url('.$this->imgroot . 'theme-'.$inner.'-'.(($issel) ? '' : 'not').'selected-end.png)">'.
-						'<img src="'.$this->imgroot . 'clear.png" height="2" width="10" alt="" /></td>';
+					<td '.$rowspan.'valign="top" width="10" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-'.(($issel) ? '' : 'not').'selected-end.png)">'.
+					'<img src="'.$this->imgbaseurl . 'clear.png" height="2" width="10" alt="" /></td>';
 
 			} else {
 				//
@@ -660,14 +711,14 @@
 				$wassel=($selected==$i-1);
 				$issel=($selected==$i);
 				$bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png');
-		//		$rowspan=(($issel)?'rowspan="2" ' : '');
+				//		$rowspan=(($issel)?'rowspan="2" ' : '');
 				//
 				//	Build image between current and prior tab
 				//
 				$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')),true).'</td>';
+					<td '.$rowspan.'colspan="2" valign="top" width="20" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png)">'.
+					'<img src="'.$this->imgbaseurl . 'clear.png" height="2" width="20" alt="" /></td>'.
+					'<td '.$rowspan.'style="background:url('.$this->imgbaseurl . $bgimg.')" width="'.$width.'%" align="center">'.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink')),true).'</td>';
 
 			}
 		}
@@ -688,11 +739,11 @@
 		}
 		$return .= '<tr>';
 		if ($beg_cols > 0) {
-			$return .= '<td colspan="'.$beg_cols.'" height="1" class="notSelTab"><img src="'.$this->imgroot.'clear.png" height="1" width="10" alt="" /></td>';
+			$return .= '<td colspan="'.$beg_cols.'" height="1" class="notSelTab"><img src="'.$this->imgbaseurl.'clear.png" height="1" width="10" alt="" /></td>';
 		}
-		$return .= '<td colspan="3" height="1" class="selTab"><img src="'.$this->imgroot.'clear.png" height="1" width="10" alt="" /></td>';
+		$return .= '<td colspan="3" height="1" class="selTab"><img src="'.$this->imgbaseurl.'clear.png" height="1" width="10" alt="" /></td>';
 		if ($end_cols > 0) {
-			$return .= '<td colspan="'.$end_cols.'" height="1" class="notSelTab"><img src="'.$this->imgroot.'clear.png" height="1" width="10" alt="" /></td>';
+			$return .= '<td colspan="'.$end_cols.'" height="1" class="notSelTab"><img src="'.$this->imgbaseurl.'clear.png" height="1" width="10" alt="" /></td>';
 		}
 		$return .= '</tr>';
 
@@ -705,201 +756,9 @@
 	}
 
 	function searchBox() {
-		global $words,$forum_id,$group_id,$group_project_id,$atid,$exact,$type_of_search;
-
-		if(get_magic_quotes_gpc()) {
-			$defaultWords = stripslashes($words);
-		} else {
-			$defaultWords = $words;
-		}
-
-		//Fix CVE-2007-0176
-		$defaultWords = htmlspecialchars($defaultWords);
-		
-		// if there is no search currently, set the default
-		if ( ! isset($type_of_search) ) {
-			$exact = 1;
-		}
-	
-		print '<form action="/search/" method="get" id="search-box-form">';
-		print '<div class="searchbox">';
-		$parameters = array(
-			SEARCH__PARAMETER_GROUP_ID => $group_id,
-			SEARCH__PARAMETER_ARTIFACT_ID => $atid,
-			SEARCH__PARAMETER_FORUM_ID => $forum_id,
-			SEARCH__PARAMETER_GROUP_PROJECT_ID => $group_project_id
-		);
-		
-		$searchManager =& getSearchManager();
-		$searchManager->setParametersValues($parameters);
-		$searchEngines =& $searchManager->getAvailableSearchEngines();
-		
-		echo '<select name="type_of_search">';
-		for($i = 0, $max = count($searchEngines); $i < $max; $i++) {
-			$searchEngine =& $searchEngines[$i];
-			echo '<option value="'.$searchEngine->getType().'"'.( $type_of_search == $searchEngine->getType() ? ' selected="selected"' : '' ).'>'.$searchEngine->getLabel($parameters).'</option>'."\n";
-		}
-		echo '</select>';
-		
-		$parameters = $searchManager->getParameters();
-		foreach($parameters AS $name => $value) {
-			print '<input type="hidden" value="'.$value.'" name="'.$name.'" id="'.$name.'"/>';
-		}
-		print '<label for="search-words" class="skip">' . html_image('pixel-transparent.gif', 1, 1, array('alt' => "")) . '</label>';
-		print '<input type="text" name="words" size="12" id="search-words" value="'.$defaultWords.'" />';
-		
-		print '<label for="search-submit" class="skip">' . html_image('pixel-transparent.gif', 1, 1, array('alt' => "")) . '</label>';
-		print '<input type="image" name="Search" id="search-submit" src="' . util_make_url('/images/magnifier.png') . '" alt="'._('Search').'" title="'._('Search').'" />';
-		
-		if (isset($group_id) && $group_id) {
-			$link_content = html_image('notes.png','21','21',array('alt'=>_('Advanced search'), 'title'=>_('Advanced search')));
-			print '&nbsp;'.util_make_link ('/search/advanced_search.php?group_id='.$group_id, $link_content, array('class'=>'lnkutility', 'id'=>'advanced-search'));
-		}
-		print '</div>';
-		print '</form>';
+		echo $this->navigation->getSearchBox();
 	}
 
-	function advancedSearchBox($sectionsArray, $group_id, $words, $isExact) {
-		// display the searchmask
-		print '
-		<form name="advancedsearch" action="'.getStringFromServer('PHP_SELF').'" method="post">
-		<input type="hidden" name="search" value="1"/>
-		<input type="hidden" name="group_id" value="'.$group_id.'"/>
-		<div class="align-center"><br />
-			<table border="0">
-				<tr>
-					<td colspan ="2">
-						<input type="text" size="60" name="words" value="'.stripslashes(htmlspecialchars($words)).'" />
-						<input type="submit" name="submitbutton" value="'._('Search').'" />
-					</td>
-				</tr>
-				<tr>
-					<td valign="top">
-						<input type="radio" name="mode" value="'.SEARCH__MODE_AND.'" '.($isExact ? 'checked="checked"' : '').' />'._('with all words').'
-					</td>
-					<td>
-						<input type="radio" name="mode" value="'.SEARCH__MODE_OR.'" '.(!$isExact ? 'checked="checked"' : '').' />'._('with one word').'
-					</td>
-				</tr>
-			</table><br /></div>'
-		.$this->createUnderSections($sectionsArray).'
-		</form>';
-
-
-		//create javascript methods for select none/all
-		print '
-		<script type="text/javascript">
-			<!-- method for disable/enable checkboxes
-			function setCheckBoxes(parent, checked) {
-
-
-				for (var i = 0; i < document.advancedsearch.elements.length; i++)
-					if (document.advancedsearch.elements[i].type == "checkbox") 
-							if (document.advancedsearch.elements[i].name.substr(0, parent.length) == parent)
-								document.advancedsearch.elements[i].checked = checked;
-				}
-			//-->
-		</script>
-		';
-
-	}
-	
-	function createUnderSections($sectionsArray) {
-		global $group_subsection_names;
-
-		$countLines = 0;
-		foreach ($sectionsArray as $section) {
-			if(is_array($section)) {
-				$countLines += (3 + count ($section));
-			} else {
-				//2 lines one for section name and one for checkbox
-				$countLines += 3;
-			}
-		}
-
- 		$maxCol = 3;
- 		$breakLimit = ceil($countLines/$maxCol);
-		$break = $breakLimit;
-		$countLines = 0;
- 		$countCol = 1;
- 
-		$return = '
-			<table width="100%" border="0" cellspacing="0" cellpadding="1">
-				<tr class="tableheader">
-					<td>
-						<table width="100%" cellspacing="0" border="0">
-							<tr class="tablecontent">
-								<!--<td colspan="2">'._('Search in').':</td-->
-								<td align="right">'._('Select').' <a href="javascript:setCheckBoxes(\'\', true)">'._('all').'</a> / <a href="javascript:setCheckBoxes(\'\', false)">'._('none').'</a></td>
-							</tr>
-							<tr class="tablecontent">
-								<td colspan="3">&nbsp;</td>
-							</tr>
-							<tr valign="top" class="tablecontent align-center">
-								<td>';
-		foreach($sectionsArray as $key => $section) {
-			$oldcountlines = $countLines;
-			if (is_array($section)) {
-				$countLines += (3 + count ($section));
-			} else {
-				$countLines += 3;
-			}
-				
-			if ($countLines >= $break) {
- 				// if we are closer to the limit with this one included, then
- 				// it's better to include it.
- 				if (($countCol < $maxCol) && ($countLines - $break) >= ($break - $oldcountlines)) {
-					$return .= '</td><td>';
- 					$countCol++;
-					$break += $breakLimit;
-				}
-			}
-		
-			$return .= '<table width="90%" border="0" cellpadding="1" cellspacing="0">
-							<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="3">
-							<tr>
-								<td cellspacing="0">
-									<a href="#'.$key.'">'.$group_subsection_names[$key].'</a>'
-							.'	</td>
-								<td align="right">'
-								._('Select').' <a href="javascript:setCheckBoxes(\''.$key.'\', true)">'._('all').'</a> / <a href="javascript:setCheckBoxes(\''.$key.'\', false)">'._('none').'</a>
-								</td>
-							</tr>
-							<tr class="tablecontent">
-								<td colspan="2">';
-								
-			if (!is_array($section)) {
-				$return .= '		<input type="checkbox" name="'.urlencode($key).'"';
-				if (isset($GLOBALS[urlencode($key)]))
-					$return .= ' checked="checked" ';
-				$return .= ' /></input>'.$group_subsection_names[$key].'<br />';
-			}
-			else
-				foreach($section as $underkey => $undersection) {
-					$return .= '	<input type="checkbox" name="'.urlencode($key.$underkey).'"';
-					if (isset($GLOBALS[urlencode($key.$underkey)]))
-						$return .= ' checked="checked" ';
-					$return .= ' />'.$undersection.'<br />';				
-					
-				}
-				
-			$return .=		'	</td>
-							</tr>
-						</table></td></tr></table><br />';
-						
-			if ($countLines >= $break) {
-				if (($countLines - $break) < ($break - $countLines)) {
-					$return .= '</td><td width="33%">';
-					$break += $breakLimit;
-				}
-			}
-		}
-		
-		return $return.'		</td>
-							</tr>
-						</table></td></tr></table>';
-	}
-
 	/**
 	 * beginSubMenu() - Opening a submenu.
 	 *
@@ -966,7 +825,7 @@
 	 * @param	boolean is this row part of the title ?
 	 *
 	 */
-	 function multiTableRow($row_attr, $cell_data, $istitle) {
+	function multiTableRow($row_attr, $cell_data, $istitle) {
 		$return= '
 		<tr '.$row_attr;
 		if ( $istitle ) {
@@ -1166,7 +1025,7 @@
 			}
 		}
 		$return .= '/>
-        <input type="image" id="' . $id . '_submit" src="' . $this->imgroot . $img_src . '" alt="' . $img_alt . '" title="' . $img_title . '"';
+        <input type="image" id="' . $id . '_submit" src="' . $this->imgbaseurl . $img_src . '" alt="' . $img_alt . '" title="' . $img_title . '"';
 		if (is_array($img_extra_params)) {
 			foreach ($img_extra_params as $key => $img_extra_params_value) {
 				$return .= $key . '="' . $img_extra_params_value . '" ';

Modified: trunk/gforge/www/search/include/renderers/AdvancedSearchHtmlSearchRenderer.class.php
===================================================================
--- trunk/gforge/www/search/include/renderers/AdvancedSearchHtmlSearchRenderer.class.php	2010-03-03 09:45:48 UTC (rev 8913)
+++ trunk/gforge/www/search/include/renderers/AdvancedSearchHtmlSearchRenderer.class.php	2010-03-03 10:31:50 UTC (rev 8914)
@@ -77,7 +77,7 @@
 		$sectionarray = $this->getSectionArray();
 		$this->handleTransferInformation($sectionarray);
 
-		$GLOBALS['HTML']->advancedSearchBox($sectionarray, $this->groupId, $this->words, $this->isExact);
+		echo $this->getAdvancedSearchBox($sectionarray, $this->groupId, $this->words, $this->isExact);
 	}
 	
 	/**
@@ -302,6 +302,150 @@
 		}
 		return $sections;
 	}
+
+	function getAdvancedSearchBox($sectionsArray, $group_id, $words, $isExact) {
+		$res = '';
+		// display the searchmask
+		$res .= '
+        <form class="ff" name="advancedsearch" action="'.getStringFromServer('PHP_SELF').'" method="post">
+        <input class="ff" type="hidden" name="search" value="1"/>
+        <input class="ff" type="hidden" name="group_id" value="'.$group_id.'"/>
+        <div align="center"><br />
+            <table border="0">
+                <tr class="ff">
+                    <td class="ff" colspan ="2">
+                        <input class="ff" type="text" size="60" name="words" value="'.stripslashes(htmlspecialchars($words)).'" />
+                        <input class="ff" type="submit" name="submitbutton" value="'._('Search').'" />
+                    </td>
+                </tr>
+                <tr class="ff">
+                    <td class="ff" valign="top">
+                        <input class="ff" type="radio" name="mode" value="'.SEARCH__MODE_AND.'" '.($isExact ? 'checked="checked"' : '').' />'._('with all words').'
+                    </td>
+                    <td class="ff">
+                        <input class="ff" type="radio" name="mode" value="'.SEARCH__MODE_OR.'" '.(!$isExact ? 'checked="checked"' : '').' />'._('with one word').'
+                    </td>
+                </tr>
+            </table><br /></div>'
+			. $this->createSubSections($sectionsArray) .'
+        </form>';
+
+
+		//create javascript methods for select none/all
+		$res .= '
+        <script type="text/javascript">
+            <!-- method for disable/enable checkboxes
+            function setCheckBoxes(parent, checked) {
+
+
+                for (var i = 0; i < document.advancedsearch.elements.length; i++)
+                    if (document.advancedsearch.elements[i].type == "checkbox") 
+                            if (document.advancedsearch.elements[i].name.substr(0, parent.length) == parent)
+                                document.advancedsearch.elements[i].checked = checked;
+                }
+            //-->
+        </script>
+        ';
+		return $res;
+	}
+
+	function createSubSections($sectionsArray) {
+		global $group_subsection_names;
+
+		$countLines = 0;
+		foreach ($sectionsArray as $section) {
+			if(is_array($section)) {
+				$countLines += (3 + count ($section));
+			} else {
+				//2 lines one for section name and one for checkbox
+				$countLines += 3;
+			}
+		}
+
+ 		$maxCol = 3;
+ 		$breakLimit = ceil($countLines/$maxCol);
+		$break = $breakLimit;
+		$countLines = 0;
+ 		$countCol = 1;
+ 
+		$return = '
+			<table width="100%" border="0" cellspacing="0" cellpadding="1">
+				<tr class="tableheader">
+					<td>
+						<table width="100%" cellspacing="0" border="0">
+							<tr class="tablecontent">
+								<!--<td colspan="2">'._('Search in').':</td-->
+								<td align="right">'._('Select').' <a href="javascript:setCheckBoxes(\'\', true)">'._('all').'</a> / <a href="javascript:setCheckBoxes(\'\', false)">'._('none').'</a></td>
+							</tr>
+							<tr class="tablecontent">
+								<td colspan="3">&nbsp;</td>
+							</tr>
+							<tr valign="top" class="tablecontent align-center">
+								<td>';
+		foreach($sectionsArray as $key => $section) {
+			$oldcountlines = $countLines;
+			if (is_array($section)) {
+				$countLines += (3 + count ($section));
+			} else {
+				$countLines += 3;
+			}
+				
+			if ($countLines >= $break) {
+ 				// if we are closer to the limit with this one included, then
+ 				// it's better to include it.
+ 				if (($countCol < $maxCol) && ($countLines - $break) >= ($break - $oldcountlines)) {
+					$return .= '</td><td>';
+ 					$countCol++;
+					$break += $breakLimit;
+				}
+			}
+		
+			$return .= '<table width="90%" border="0" cellpadding="1" cellspacing="0">
+							<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="3">
+							<tr>
+								<td cellspacing="0">
+									<a href="#'.$key.'">'.$group_subsection_names[$key].'</a>'
+				.'	</td>
+								<td align="right">'
+				._('Select').' <a href="javascript:setCheckBoxes(\''.$key.'\', true)">'._('all').'</a> / <a href="javascript:setCheckBoxes(\''.$key.'\', false)">'._('none').'</a>
+								</td>
+							</tr>
+							<tr class="tablecontent">
+								<td colspan="2">';
+								
+			if (!is_array($section)) {
+				$return .= '		<input type="checkbox" name="'.urlencode($key).'"';
+				if (isset($GLOBALS[urlencode($key)]))
+					$return .= ' checked="checked" ';
+				$return .= ' /></input>'.$group_subsection_names[$key].'<br />';
+			}
+			else
+				foreach($section as $underkey => $undersection) {
+					$return .= '	<input type="checkbox" name="'.urlencode($key.$underkey).'"';
+					if (isset($GLOBALS[urlencode($key.$underkey)]))
+						$return .= ' checked="checked" ';
+					$return .= ' />'.$undersection.'<br />';				
+					
+				}
+				
+			$return .=		'	</td>
+							</tr>
+						</table></td></tr></table><br />';
+						
+			if ($countLines >= $break) {
+				if (($countLines - $break) < ($break - $countLines)) {
+					$return .= '</td><td width="33%">';
+					$break += $breakLimit;
+				}
+			}
+		}
+		
+		return $return.'		</td>
+							</tr>
+						</table></td></tr></table>';
+
+	}
+
 }
 
 // Local Variables:

Modified: trunk/gforge/www/themes/gforge/Theme.class.php
===================================================================
--- trunk/gforge/www/themes/gforge/Theme.class.php	2010-03-03 09:45:48 UTC (rev 8913)
+++ trunk/gforge/www/themes/gforge/Theme.class.php	2010-03-03 10:31:50 UTC (rev 8914)
@@ -2,178 +2,103 @@
 
 require_once $gfwww.'include/Layout.class.php';
 
-define('THEME_DIR', util_make_uri ('/themes/gforge'));
-
 define('TOP_TAB_HEIGHT', 30);
 define('BOTTOM_TAB_HEIGHT', 22);
 
 class Theme extends Layout {
 
-    function Theme() {
-        // Parent constructor
-        $this->Layout();
-
-        $this->imgroot = THEME_DIR.'/images/';
-        $this->jsroot  = THEME_DIR.'/js/';
-    }
-
-    /**
-     * Layout() - Constructor
-     */
-    function Layout() {
-        // Constructor for parent class...
-        if ( file_exists($GLOBALS['sys_custom_path'] . '/index_std.php') ) {
-            $this->rootindex = $GLOBALS['sys_custom_path'] . '/index_std.php';
-        } else {
-            $this->rootindex = $GLOBALS['gfwww'].'index_std.php';
+        function Theme() {
+                // Parent constructor
+                $this->Layout();
+                $this->doctype = 'strict';
+		$this->cssurls = array(
+			'http://yui.yahooapis.com/2.6.0/build/reset-fonts-grids/reset-fonts-grids.css',
+			'http://yui.yahooapis.com/2.6.0/build/base/base-min.css',
+			util_make_url ('/themes/css/fusionforge.css'),
+			$this->cssbaseurl .'theme.css',
+			$this->cssbaseurl .'theme-pages.css',
+			);
         }
-        $this->Error();
-    }
 
-    /**
-     *    header() - "steel theme" top of page
-     *
-     * @param    array    Header parameters array
-     */
-    function header($params) {
-        if (!isset($params['title'])) {
-            $params['title'] =  $GLOBALS['sys_name'];
-        } else {
-            $params['title'] =  $GLOBALS['sys_name'] . ': ' . $params['title'];
+        function headerJS() {
+                echo '
+        <script type="text/javascript" src="'. $this->jsbaseurl .'gforge.js"></script>
+        <script type="text/javascript">';
+                plugin_hook ("javascript",false);
+                echo '
+        </script>';
         }
+        
+        function bodyHeader($params) {
+                global $user_guide;
 
-        print '<?xml version="1.0" encoding="utf-8"?>';
-        echo '
-		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-		<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . _('en') . '" lang="' . _('en') . '">
-		<head>
-		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-		<title>'. $params['title'] . '</title>
-		<link rel="icon" type="image/png" href="'. util_make_uri('/images/icon.png') .'" />
-		<link rel="shortcut icon" type="image/png" href="'. util_make_uri('/images/icon.png') .'" />';
-
-        echo $this->headerLink();
-
-        echo '
-		<script type="text/javascript" src="'. $this->jsroot .'gforge.js"></script>
-		<script type="text/javascript">';
-        plugin_hook ("javascript",false);
-        echo '</script>';
-
-        $this->headerCSS();
-
-        echo '
-		</head>
-		<body id="mydoc">
-		';
-
-        $this->bodyHeader($params);
-    }
-
-    function bodyHeader($params) {
-        global $user_guide;
-
-        echo '
+                echo '
 			<table id="header" class="width-100p100">
 				<tr>
 					<td id="header-col1">
 					<h1>'.  util_make_link ('/', html_image('header/top-logo.png',192,54,array('alt'=>'FusionForge Home'))) .'</h1>
 					</td>
 					<td id="header-col2">';
-        echo $this->searchBox();
-        echo '
+                $this->searchBox();
+                echo '
 					</td>
 					<td id="header-col3">
 			';
-        if (session_loggedin()) {
-            $u =& user_get_object(user_getid());
-            echo util_make_link ('/account/logout.php', sprintf("%s (%s)", _('Log Out'), $u->getRealName()), array('class'=>'userlink'));
-            echo ' ';
-            echo util_make_link ('/account/', _('My Account'), array('class'=>'userlink'));
-        } else {
-		$url = '/account/login.php';
-        	if(getStringFromServer('REQUEST_METHOD') != 'POST') {
-        		$url .= '?return_to=';
-        		$url .= urlencode(getStringFromServer('REQUEST_URI'));
-        	}
-		
-        	echo util_make_link ($url, _('Log In'),array('class'=>'userlink'));
-        	echo ' ';
-        	if (!$GLOBALS['sys_user_reg_restricted']) {
-        		echo util_make_link ('/account/register.php', _('New Account'),array('class'=>'userlink'));
-		}
-        }
+                $items = $this->navigation->getUserLinks();
+                for ($j = 0; $j < count($items['titles']); $j++) {
+                        $links[] = util_make_link($items['urls'][$j], $items['titles'][$j], 
+                                                  array('class'=>'userlink'), true);
+                }
+                echo implode(' | ', $links);
+                
+                plugin_hook ('headermenu', $params);
 
-        plugin_hook ('headermenu', $params);
-
-        echo $this->quickNav();
-        echo '
+                $this->quickNav();
+                echo '
 					</td>
 				</tr>
 			</table>
 			
 			<!-- outer tabs -->
 			';
-        echo $this->outerTabs($params);
-        echo '<!-- inner tabs -->';
-        if (isset($params['group']) && $params['group']) {
-            echo $this->projectTabs($params['toptab'],$params['group']);
-        }
-	echo '<div id="maindiv">
+                echo $this->outerTabs($params);
+                echo '<!-- inner tabs -->';
+                if (isset($params['group']) && $params['group']) {
+                        echo $this->projectTabs($params['toptab'],$params['group']);
+                }
+                echo '<div id="maindiv">
 ';
-    }
+        }
 
-     function bodyFooter($params) {
-        echo '</div>
+        function bodyFooter($params) {
+                echo '</div>
 ';
-    }
+        }
 
-    function footer($params) {
-        echo '
+        function footer($params) {
+                echo '
 			<!-- PLEASE LEAVE "Powered By FusionForge" on your site -->
 			<div class="align-right">
-			<a href="http://fusionforge.org/">
-			<img src="'. util_make_uri ('/images/pow-fusionforge.png') .'" alt="Powered By FusionForge" />
-			</a></div>
+                       ' . $this->navigation->getPoweredBy() . '
+			</div>
+                       ' . $this->navigation->getShowSource() . '
 			';
 
-        global $sys_show_source;
-        if ($sys_show_source) {
-            global $SCRIPT_NAME;
-            print util_make_link ('/source.php?file=' . $SCRIPT_NAME, _('Show source'), array ("class" => "showsource"));
-        }
-
-        echo '
+                echo '
 		</body>
 		</html>
 		';
-    }
+        }
 
-    function headerCSS() {
-        echo '
-		<link href="http://yui.yahooapis.com/2.6.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css" rel="stylesheet" />
-		<link href="http://yui.yahooapis.com/2.6.0/build/base/base-min.css"	type="text/css" rel="stylesheet" />
-		<link rel="stylesheet" type="text/css" href="'. util_make_uri ('/themes/css/fusionforge.css') .'" />
-		<link rel="stylesheet" type="text/css" href="'. THEME_DIR .'/css/theme.css" />
-		<link rel="stylesheet" type="text/css" href="'. THEME_DIR .'/css/theme-pages.css" />
-		';
-
-	plugin_hook ('cssfile',$this);
-    }
-
-    function getRootIndex() {
-        return $this->rootindex;
-    }
-
-    /**
-     * boxTop() - Top HTML box
-     *
-     * @param   string  Box title
-     * @param   bool    Whether to echo or return the results
-     * @param   string  The box background color
-     */
-    function boxTop($title, $id = '') {
-        $t_result = '
+	/**
+	 * boxTop() - Top HTML box
+	 *
+	 * @param   string  Box title
+	 * @param   bool    Whether to echo or return the results
+	 * @param   string  The box background color
+	 */
+	function boxTop($title, $id = '') {
+		$t_result = '
         	<div id="' . $this->toSlug($id) . '" class="box-surround">
             	<div id="'. $this->toSlug($id) . '-title" class="box-title">
             		<div class="box-title-left">
@@ -184,504 +109,319 @@
                 </div> 
             	<div id="'. $this->toSlug($id) .'-content" class="box-content">
             ';
-        return $t_result;
-    }
+		return $t_result;
+	}
 
-    /**
-     * boxMiddle() - Middle HTML box
-     *
-     * @param   string  Box title
-     * @param   string  The box background color
-     */
-    function boxMiddle($title, $id = '') {
-	    $t_result ='
+	/**
+	 * boxMiddle() - Middle HTML box
+	 *
+	 * @param   string  Box title
+	 * @param   string  The box background color
+	 */
+	function boxMiddle($title, $id = '') {
+		$t_result ='
 	        	</div> <!-- class="box-content" -->
 	        <h3 id="title-'. $this->toSlug($id).'" class="box-middle">'.$title.'</h3>
 	       	<div class="box-content">
         ';
-	    return $t_result;
-    }
+		return $t_result;
+	}
 
-    /**
-     * boxBottom() - Bottom HTML box
-     *
-     */
-    function boxBottom() {
-	    $t_result='
+	/**
+	 * boxBottom() - Bottom HTML box
+	 *
+	 */
+	function boxBottom() {
+		$t_result='
                 </div>
             </div> <!-- class="box-surround" -->
 		';
-	    return $t_result;
-    }
+		return $t_result;
+	}
 
-    /**
-     * boxGetAltRowStyle() - Get an alternating row style for tables
-     *
-     * @param               int             Row number
-     */
-    function boxGetAltRowStyle($i) {
-        if ($i % 2 == 0) {
-            return 'class="bgcolor-white"';
-        } else {
-            return 'class="bgcolor-grey"';
-        }
-    }
+	/**
+	 * boxGetAltRowStyle() - Get an alternating row style for tables
+	 *
+	 * @param               int             Row number
+	 */
+	function boxGetAltRowStyle($i) {
+		if ($i % 2 == 0) {
+			return 'class="bgcolor-white"';
+		} else {
+			return 'class="bgcolor-grey"';
+		}
+	}
 
-    /**
-     * listTableTop() - Takes an array of titles and builds the first row of a new table.
-     *
-     * @param       array   The array of titles
-     * @param       array   The array of title links
-     * @param       boolean Whether to highlight or not the entry
-     */
-    function listTableTop ($title_arr,$links_arr=false,$selected=false) {
-	    $return = '<table class="width-100p100 listTable';
-	    if ($selected == true) {
-		    $return .= ' selected';
-	    }
-	    $return .= '">
+	/**
+	 * listTableTop() - Takes an array of titles and builds the first row of a new table.
+	 *
+	 * @param       array   The array of titles
+	 * @param       array   The array of title links
+	 * @param       boolean Whether to highlight or not the entry
+	 */
+	function listTableTop ($title_arr,$links_arr=false,$selected=false) {
+		$return = '<table class="width-100p100 listTable';
+		if ($selected == true) {
+			$return .= ' selected';
+		}
+		$return .= '">
             <tr>';
 
-        $count=count($title_arr);
-        if ($links_arr) {
-            for ($i=0; $i<$count; $i++) {
-                $return .= '
+		$count=count($title_arr);
+		if ($links_arr) {
+			for ($i=0; $i<$count; $i++) {
+				$return .= '
                 <th scope="col"><a class="sortbutton" href="'.util_make_url ($links_arr[$i]).'"><strong>'.$title_arr[$i].'</strong></a></th>';
-            }
-        } else {
-            for ($i=0; $i<$count; $i++) {
-                $return .= '
+			}
+		} else {
+			for ($i=0; $i<$count; $i++) {
+				$return .= '
                 <th scope="col"><strong>'.$title_arr[$i].'</strong></th>';
-            }
-        }
-        return $return.'</tr>';
-    }
+			}
+		}
+		return $return.'</tr>';
+	}
 
-    function listTableBottom() {
-	    return '
+	function listTableBottom() {
+		return '
             </table>';
-    }
+	}
 
 
-    function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='WHITE',$total_width='100%') {
-        $count=count($TABS_DIRS);
-        $width=intval((100/$count));
-	$rest_width=100-$count*$width;
+	function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='WHITE',$total_width='100%') {
+		$count=count($TABS_DIRS);
+		if ($count < 1) {
+			return;
+		}
+		$width=intval((100/$count));
+		$rest_width=100-$count*$width;
 
-        $return = '
+		$return = '
 		<!-- start tabs -->
 		<table class="tabGenerator width-100p100" summary="" ';
 
-        if ($total_width != '100%') {
-		$return .= 'style="width:' . $total_width . ';"';
-        }
-        $return .= ">\n";
-        $return .= '<tr>';
+		if ($total_width != '100%') {
+			$return .= 'style="width:' . $total_width . ';"';
+		}
+		$return .= ">\n";
+		$return .= '<tr>';
  
-        $folder = $this->imgroot.($nested ? 'bottomtab-new/' : 'toptab-new/');
+		$folder = $this->imgurl.($nested ? 'bottomtab-new/' : 'toptab-new/');
 
-        for ($i=0; $i<$count; $i++) {
-            if ($selected == $i) {
-                $left_img   = $folder.'selected-left.gif';
-                $middle_img = $folder.'selected-middle.gif';
-                $right_img  = $folder.'selected-right.gif';
-                $separ_img  = $folder.'selected-separator.gif';
-                $css_class  = $nested ? 'bottomTabSelected' : 'topTabSelected';
-            } else {
-                $left_img   = $folder.'left.gif';
-                $middle_img = $folder.'middle.gif';
-                $right_img  = $folder.'right.gif';
-                $separ_img  = $folder.'separator.gif';
-                $css_class  = $nested ? 'bottomTab' : 'topTab';
-            }
+		for ($i=0; $i<$count; $i++) {
+			if ($selected == $i) {
+				$left_img   = $folder.'selected-left.gif';
+				$middle_img = $folder.'selected-middle.gif';
+				$right_img  = $folder.'selected-right.gif';
+				$separ_img  = $folder.'selected-separator.gif';
+				$css_class  = $nested ? 'bottomTabSelected' : 'topTabSelected';
+			} else {
+				$left_img   = $folder.'left.gif';
+				$middle_img = $folder.'middle.gif';
+				$right_img  = $folder.'right.gif';
+				$separ_img  = $folder.'separator.gif';
+				$css_class  = $nested ? 'bottomTab' : 'topTab';
+			}
             
-            $clear_img = $this->imgroot.'clear.png';
+			$clear_img = $this->imgurl.'clear.png';
 
-            $return .= "\n";
+			$return .= "\n";
 
-            // left part
-            $return .= '<td class="tg-left">' . "\n";
-            $return .= '<div';
-            if ($selected == $i) {
-                $return .= ' class="selected"';
-            }
-            $return .= '>';
-            $return .= '<div';
+			// left part
+			$return .= '<td class="tg-left">' . "\n";
+			$return .= '<div';
+			if ($selected == $i) {
+				$return .= ' class="selected"';
+			}
+			$return .= '>';
+			$return .= '<div';
             
-            if ($nested) {
-		    $return .= ' class="nested"';
-            }
-            $return .= '>' . "\n";
-            $return .= '</div>';
-            $return .= '</div>' . "\n";
-            $return .= '</td>' . "\n";
+			if ($nested) {
+				$return .= ' class="nested"';
+			}
+			$return .= '>' . "\n";
+			$return .= '</div>';
+			$return .= '</div>' . "\n";
+			$return .= '</td>' . "\n";
 
-            // middle part
-            $return .= '<td class="tg-middle" style="width:'.$width.'%;">' . "\n";
-            $return .= '<div';
-            if ($selected == $i) {
-		    $return .= ' class="selected"';
-            }
-            $return .= '>';
-            $return .= '<div';
-            if ($nested) {
-		    $return .= ' class="nested"';
-            }
-            $return .= '>' . "\n";
-            $return .= '<a href="'.$TABS_DIRS[$i].'">'.$TABS_TITLES[$i].'</a>' . "\n";
-            $return .= '</div>';
-            $return .= '</div>' . "\n";
-            $return .= '</td>' . "\n";
+			// middle part
+			$return .= '<td class="tg-middle" style="width:'.$width.'%;">' . "\n";
+			$return .= '<div';
+			if ($selected == $i) {
+				$return .= ' class="selected"';
+			}
+			$return .= '>';
+			$return .= '<div';
+			if ($nested) {
+				$return .= ' class="nested"';
+			}
+			$return .= '>' . "\n";
+			$return .= '<a href="'.$TABS_DIRS[$i].'">'.$TABS_TITLES[$i].'</a>' . "\n";
+			$return .= '</div>';
+			$return .= '</div>' . "\n";
+			$return .= '</td>' . "\n";
 
-            // right part
-            // if the next tab is not selected, close this tab
-            if ($selected != $i+1) {
-		    $return .= '<td class="tg-right">' . "\n";
-		    $return .= '<div';
-		    if ($selected == $i) {
-			    $return .= ' class="selected"';
-		    }
-		    $return .= '>';
-		    $return .= '<div';
-		    if ($nested) {
-			    $return .= ' class="nested"';
-		    }
-		    $return .= '>' . "\n";
-		    $return .= '</div>';
-		    $return .= '</div>' . "\n";
-		    $return .= '</td>' . "\n";
-	    }
-	}
+			// right part
+			// if the next tab is not selected, close this tab
+			if ($selected != $i+1) {
+				$return .= '<td class="tg-right">' . "\n";
+				$return .= '<div';
+				if ($selected == $i) {
+					$return .= ' class="selected"';
+				}
+				$return .= '>';
+				$return .= '<div';
+				if ($nested) {
+					$return .= ' class="nested"';
+				}
+				$return .= '>' . "\n";
+				$return .= '</div>';
+				$return .= '</div>' . "\n";
+				$return .= '</td>' . "\n";
+			}
+		}
 
-	if ($rest_width > 0) {
-		$return .= '<td class="tg-middle" style="width:'.$rest_width.'%;">' . "\n";
-		$return .= '<div><div';
-		if ($nested) {
-			$return .= ' class="nested"';
+		if ($rest_width > 0) {
+			$return .= '<td class="tg-middle" style="width:'.$rest_width.'%;">' . "\n";
+			$return .= '<div><div';
+			if ($nested) {
+				$return .= ' class="nested"';
+			}
+			$return .= '>' . "\n";
+			$return .= '</div></div>' . "\n";
+			$return .= '</td>' . "\n";
 		}
-		$return .= '>' . "\n";
-		$return .= '</div></div>' . "\n";
-		$return .= '</td>' . "\n";
-	}
 
-        $return .= '</tr>
+		$return .= '</tr>
         </table>
         <!-- end tabs -->';
 
-	return $return;
-    }
+		return $return;
+	}
 
-    function searchBox() {
-        global $words,$forum_id,$group_id,$group_project_id,$atid,$exact,$type_of_search;
 
-        if(get_magic_quotes_gpc()) {
-            $defaultWords = stripslashes($words);
-        } else {
-            $defaultWords = $words;
-        }
-        
-        // if there is no search currently, set the default
-        if ( ! isset($type_of_search) ) {
-            $exact = 1;
-        }
-
-        print '
-        <form id="searchBox" action="'.util_make_url ('/search/').'" method="get">
-        <div>';
-        $parameters = array(
-		SEARCH__PARAMETER_GROUP_ID => $group_id,
-		SEARCH__PARAMETER_ARTIFACT_ID => $atid,
-		SEARCH__PARAMETER_FORUM_ID => $forum_id,
-		SEARCH__PARAMETER_GROUP_PROJECT_ID => $group_project_id
-        );
-
-        $searchManager =& getSearchManager();
-        $searchManager->setParametersValues($parameters);
-        $searchEngines =& $searchManager->getAvailableSearchEngines();
-
-        echo '
-        <label for="searchBox-words">
-        <select name="type_of_search">';
-        for($i = 0, $max = count($searchEngines); $i < $max; $i++) {
-            $searchEngine =& $searchEngines[$i];
-            echo '<option class="ff" value="'.$searchEngine->getType().'"'.( $type_of_search == $searchEngine->getType() ? ' selected="selected"' : '' ).'>'.$searchEngine->getLabel($parameters).'</option>'."\n";
-        }
-        echo '</select></label>';
-
-        $parameters = $searchManager->getParameters();
-        foreach($parameters AS $name => $value) {
-            print '<input class="ff" type="hidden" value="'.$value.'" name="'.$name.'" />';
-        }
-        print '<input type="text" size="12" id="searchBox-words" name="words" value="'.$defaultWords.'" />';
-	print '<input type="submit" name="Search" value="'._('Search').'" />';
-
-        if (isset($group_id) && $group_id) {
-		print util_make_link ('/search/advanced_search.php?group_id='.$group_id, _('Advanced search'), array('class'=>'userlink'));
-        }
-        print '</div>';
-        print '</form>';
-
-    }
-    
-    function advancedSearchBox($sectionsArray, $group_id, $words, $isExact) {
-         // display the searchmask
-        print '
-        <form class="ff" name="advancedsearch" action="'.getStringFromServer('PHP_SELF').'" method="post">
-        <input class="ff" type="hidden" name="search" value="1"/>
-        <input class="ff" type="hidden" name="group_id" value="'.$group_id.'"/>
-        <div align="center"><br />
-            <table border="0">
-                <tr class="ff">
-                    <td class="ff" colspan ="2">
-                        <input class="ff" type="text" size="60" name="words" value="'.stripslashes(htmlspecialchars($words)).'" />
-                        <input class="ff" type="submit" name="submitbutton" value="'._('Search').'" />
-                    </td>
-                </tr>
-                <tr class="ff">
-                    <td class="ff" valign="top">
-                        <input class="ff" type="radio" name="mode" value="'.SEARCH__MODE_AND.'" '.($isExact ? 'checked="checked"' : '').' />'._('with all words').'
-                    </td>
-                    <td class="ff">
-                        <input class="ff" type="radio" name="mode" value="'.SEARCH__MODE_OR.'" '.(!$isExact ? 'checked="checked"' : '').' />'._('with one word').'
-                    </td>
-                </tr>
-            </table><br /></div>'
-            .$this->createUnderSections($sectionsArray).'
-        </form>';
-
-
-        //create javascript methods for select none/all
-        print '
-        <script type="text/javascript">
-            <!-- method for disable/enable checkboxes
-            function setCheckBoxes(parent, checked) {
-
-
-                for (var i = 0; i < document.advancedsearch.elements.length; i++)
-                    if (document.advancedsearch.elements[i].type == "checkbox") 
-                            if (document.advancedsearch.elements[i].name.substr(0, parent.length) == parent)
-                                document.advancedsearch.elements[i].checked = checked;
-                }
-            //-->
-        </script>
-        ';
-
-    }
-
-    function createUnderSections($sectionsArray) {
-        global $group_subsection_names;
-        $countLines = 0;
-        foreach ($sectionsArray as $section) {
-            if(is_array($section)) {
-                $countLines += (3 + count ($section));
-            } else {
-                //2 lines one for section name and one for checkbox
-                $countLines += 3;
-            }
-        }
-        $breakLimit = round($countLines/3);
-        $break = $breakLimit;
-        $countLines = 0;
-        $return = '
-            <table width="99%" border="0" cellspacing="0" cellpadding="1" style="background-color:'. $this->COLOR_LTBACK2.'">
-                <tr class="ff">
-                    <td class="ff">
-                        <table width="100%" cellspacing="0" border="0" style="background-color:'. $this->COLOR_LTBACK1.'">
-                            <tr class="ff" style="font-weight: bold;background-color:'. $this->COLOR_LTBACK2 .'">
-                                <td class="ff" colspan="2">'._('Search in').'</td>
-                                <td class="ff" style="text-align:right">'._('Select').' <a href="javascript:setCheckBoxes(\'\', true)">'._('all').'</a> / <a href="javascript:setCheckBoxes(\'\', false)">'._('none').'</a></td>
-                            </tr>
-                            <tr class="ff" height="20">
-                                <td class="ff" colspan="3">&nbsp;</td>
-                            </tr>
-                            <tr class="ff" align="center" valign="top">
-                                <td class="ff">';
-        foreach($sectionsArray as $key => $section) {
-            $oldcountlines = $countLines;
-            if (is_array($section)) {
-                $countLines += (3 + count ($section));
-            } else {
-                $countLines += 3;
-            }
-
-            if ($countLines >= $break) {
-                //if the next block is so large that shifting it to the next column hits the breakpoint better
-                //the second part of statement (behind &&) proofs, that no 4th column is added
-                if ((($countLines - $break) >= ($break - $countLines)) && ((($break + $breakLimit)/$breakLimit) <= 3)) {
-                    $return .= '</td><td class="ff">';
-                    $break += $breakLimit;
-                }
-            }
-            
-            $return .= '<table  style="width:90%; background-color:'. $this->COLOR_LTBACK2.'">
-                            <tr class="ff">
-                            <td class="ff">
-                            	<table style="width:100%;">
-                            	<tr class="ff" style="background-color:'. $this->COLOR_LTBACK2 .'; font-weight: bold">
-                                <td class="ff">
-                                    <a href="#'.$key.'">'.$group_subsection_names[$key].'</a>'
-            .'    </td>
-                                <td class="ff" style="text-align:right">'
-            ._('Select').' <a href="javascript:setCheckBoxes(\''.$key.'\', true)">'._('all').'</a> / <a href="javascript:setCheckBoxes(\''.$key.'\', false)">'._('none').'</a>
-                                </td>
-                            </tr>
-                            <tr class="ff" style="background-color:'. $this->COLOR_LTBACK1.'">
-                                <td class="ff" colspan="2">';
-
-            if (!is_array($section)) {
-                $return .= '        <input class="ff" type="checkbox" name="'.urlencode($key).'"';
-                if (isset($GLOBALS[urlencode($key)]))
-			$return .= ' checked="checked" ';
-                $return .= ' /></input>'.$group_subsection_names[$key].'<br />';
-            }
-            else
-            foreach($section as $underkey => $undersection) {
-                $return .= '    <input class="ff" type="checkbox" name="'.urlencode($key.$underkey).'"';
-                if (isset($GLOBALS[urlencode($key.$underkey)]))
-                $return .= ' checked ';
-                $return .= '></input>'.$undersection.'<br />';
-
-            }
-            
-            $return .=        '    </td>
-                            </tr>
-                        </table></td></tr></table><br />';
-
-            if ($countLines >= $break) {
-                if (($countLines - $break) < ($break - $countLines)) {
-                    $return .= '</td><td class="ff" width="33%">';
-                    $break += $breakLimit;
-                }
-            }
-        }
-
-        return $return.'        </td>
-                            </tr>
-                        </table></td></tr></table>';
-    }
-
-    /**
-     * beginSubMenu() - Opening a submenu.
-     *
-     * @return    string    Html to start a submenu.
-     */
-    function beginSubMenu () {
-        $return = '
+	/**
+	 * beginSubMenu() - Opening a submenu.
+	 *
+	 * @return    string    Html to start a submenu.
+	 */
+	function beginSubMenu () {
+		$return = '
             <p><strong>';
-        return $return;
-    }
+		return $return;
+	}
 
-    /**
-     * endSubMenu() - Closing a submenu.
-     *
-     * @return    string    Html to end a submenu.
-     */
-    function endSubMenu () {
-        $return = '</strong></p>';
-        return $return;
-    }
+	/**
+	 * endSubMenu() - Closing a submenu.
+	 *
+	 * @return    string    Html to end a submenu.
+	 */
+	function endSubMenu () {
+		$return = '</strong></p>';
+		return $return;
+	}
 
-    /**
-     * printSubMenu() - Takes two array of titles and links and builds the contents of a menu.
-     *
-     * @param       array   The array of titles.
-     * @param       array   The array of title links.
-     * @return    string    Html to build a submenu.
-     */
-    function printSubMenu ($title_arr,$links_arr) {
-        $count=count($title_arr);
-        $count--;
+	/**
+	 * printSubMenu() - Takes two array of titles and links and builds the contents of a menu.
+	 *
+	 * @param       array   The array of titles.
+	 * @param       array   The array of title links.
+	 * @return    string    Html to build a submenu.
+	 */
+	function printSubMenu ($title_arr,$links_arr) {
+		$count=count($title_arr);
+		$count--;
 
-        $return = '';
+		$return = '';
 
-        for ($i=0; $i<$count; $i++) {
-            $return .= util_make_link ($links_arr[$i], $title_arr[$i]) . ' | ';
-        }
-        $return .= util_make_link ($links_arr[$i], $title_arr[$i]);
-        return $return;
-    }
+		for ($i=0; $i<$count; $i++) {
+			$return .= util_make_link ($links_arr[$i], $title_arr[$i]) . ' | ';
+		}
+		$return .= util_make_link ($links_arr[$i], $title_arr[$i]);
+		return $return;
+	}
 
-    /**
-     * subMenu() - Takes two array of titles and links and build a menu.
-     *
-     * @param       array   The array of titles.
-     * @param       array   The array of title links.
-     * @return    string    Html to build a submenu.
-     */
-    function subMenu ($title_arr,$links_arr) {
-        $return  = $this->beginSubMenu () ;
-        $return .= $this->printSubMenu ($title_arr,$links_arr) ;
-        $return .= $this->endSubMenu () ;
-        return $return;
-    }
+	/**
+	 * subMenu() - Takes two array of titles and links and build a menu.
+	 *
+	 * @param       array   The array of titles.
+	 * @param       array   The array of title links.
+	 * @return    string    Html to build a submenu.
+	 */
+	function subMenu ($title_arr,$links_arr) {
+		$return  = $this->beginSubMenu () ;
+		$return .= $this->printSubMenu ($title_arr,$links_arr) ;
+		$return .= $this->endSubMenu () ;
+		return $return;
+	}
 
-    /**
-     * multiTableRow() - create a mutlilevel row in a table
-     *
-     * @param    string    the row attributes
-     * @param    array    the array of cell data, each element is an array,
-     *                      the first item being the text,
-     *                    the subsequent items are attributes (dont include
-     *                    the bgcolor for the title here, that will be
-     *                    handled by $istitle
-     * @param    boolean is this row part of the title ?
-     *
-     */
-    function multiTableRow($row_attr, $cell_data, $istitle) {
-        $return= '
+	/**
+	 * multiTableRow() - create a mutlilevel row in a table
+	 *
+	 * @param    string    the row attributes
+	 * @param    array    the array of cell data, each element is an array,
+	 *                      the first item being the text,
+	 *                    the subsequent items are attributes (dont include
+	 *                    the bgcolor for the title here, that will be
+	 *                    handled by $istitle
+	 * @param    boolean is this row part of the title ?
+	 *
+	 */
+	function multiTableRow($row_attr, $cell_data, $istitle) {
+		$return= '
         <tr class="ff" '.$row_attr;
-        if ( $istitle ) {
-            $return .=' align="center" bgcolor="'. $this->COLOR_HTMLBOX_TITLE .'"';
-        }
-        $return .= '>';
-        for ( $c = 0; $c < count($cell_data); $c++ ) {
-            $return .='<td class="ff" ';
-            for ( $a=1; $a < count($cell_data[$c]); $a++) {
-                $return .= $cell_data[$c][$a].' ';
-            }
-            $return .= '>';
-            if ( $istitle ) {
-                $return .='<font color="'.$this->FONTCOLOR_HTMLBOX_TITLE.'"><strong>';
-            }
-            $return .= $cell_data[$c][0];
-            if ( $istitle ) {
-                $return .='</strong></font>';
-            }
-            $return .= '</td>';
+		if ( $istitle ) {
+			$return .=' align="center" bgcolor="'. $this->COLOR_HTMLBOX_TITLE .'"';
+		}
+		$return .= '>';
+		for ( $c = 0; $c < count($cell_data); $c++ ) {
+			$return .='<td class="ff" ';
+			for ( $a=1; $a < count($cell_data[$c]); $a++) {
+				$return .= $cell_data[$c][$a].' ';
+			}
+			$return .= '>';
+			if ( $istitle ) {
+				$return .='<font color="'.$this->FONTCOLOR_HTMLBOX_TITLE.'"><strong>';
+			}
+			$return .= $cell_data[$c][0];
+			if ( $istitle ) {
+				$return .='</strong></font>';
+			}
+			$return .= '</td>';
 
-        }
-        $return .= '</tr>
+		}
+		$return .= '</tr>
         ';
 
-        return $return;
-    }
+		return $return;
+	}
 
-    /**
-     * feedback() - returns the htmlized feedback string when an action is performed.
-     *
-     * @param string feedback string
-     * @return string htmlized feedback
-     */
-    function feedback($feedback) {
-        if (!$feedback) {
-            return '';
-        } else {
-            return '
+	/**
+	 * feedback() - returns the htmlized feedback string when an action is performed.
+	 *
+	 * @param string feedback string
+	 * @return string htmlized feedback
+	 */
+	function feedback($feedback) {
+		if (!$feedback) {
+			return '';
+		} else {
+			return '
                 <h3 style="color:red">'.strip_tags($feedback, '<br>').'</h3>';
-        }
-    }
+		}
+	}
 
-    /**
-     * getThemeIdFromName()
-     *
-     * @param    string  the dirname of the theme
-     * @return    integer the theme id
-     */
-    function getThemeIdFromName($dirname) {
-        $res=db_query_params ('SELECT theme_id FROM themes WHERE dirname=$1',
-			array($dirname));
-        return db_result($res,0,'theme_id');
-    }
+	/**
+	 * getThemeIdFromName()
+	 *
+	 * @param    string  the dirname of the theme
+	 * @return    integer the theme id
+	 */
+	function getThemeIdFromName($dirname) {
+		$res=db_query_params ('SELECT theme_id FROM themes WHERE dirname=$1',
+				      array($dirname));
+		return db_result($res,0,'theme_id');
+	}
 }
 
 // Local Variables:

Modified: trunk/gforge/www/themes/gforge/css/theme.css
===================================================================
--- trunk/gforge/www/themes/gforge/css/theme.css	2010-03-03 09:45:48 UTC (rev 8913)
+++ trunk/gforge/www/themes/gforge/css/theme.css	2010-03-03 10:31:50 UTC (rev 8914)
@@ -7,7 +7,7 @@
  */
 
 /* HTML elements */
-body {color: rgb(68, 68, 68); background-color: rgb(247, 247, 247); }
+body {color: rgb(68, 68, 68); background-color: rgb(247, 247, 247); text-align: left; }
 form {margin:0; }
 img {border:0; }
 h1 {margin:0; }
@@ -15,11 +15,10 @@
 
 a {text-decoration:none; color:rgb(1, 73, 144); }
 a:hover {text-decoration: underline; color: rgb(247, 0, 0); }
-a.userlink {color: white; }
-a.userlink:hover {text-decoration: underline; color: white;}
-a.userlink:visited {text-decoration: none; color: white; }
+a.userlink, #searchBox a {color: white; }
+a.userlink:hover, #searchBox a:hover {text-decoration: underline; color: white;}
+a.userlink:visited, #searchBox a:visited {text-decoration: none; color: white; }
 th, td {text-align:left; border:none; }
-#mydoc {text-align: left;}
 input[type="text"], input[type="password"], textarea {
 	width: auto;
 }




More information about the Fusionforge-commits mailing list