'ug_user.html', 'login' => 'ug_getting_started_login.html', 'trove' => 'ug_sitewide_trove.html', 'snippet' => 'ug_sitewide_snippet.html', 'people' => 'ug_sitewide_project_help.html', 'home' => 'ug_project.html', 'admin' => 'ug_project_project_admin.html', 'activity' => 'ug_project_activity.html', 'forums' => 'ug_project_forums.html', 'tracker' => 'ug_project_tracker.html', 'mail' => 'ug_project_mailing_lists.html', 'pm' => 'ug_project_task_manager.html', 'docman' => 'ug_project_docman.html', 'surveys' => 'ug_project_surveys.html', 'news' => 'ug_project_news.html', 'scm' => 'ug_project_subversion.html', 'frs' => 'ug_project_file_releases.html', 'wiki' => 'ug_project_wiki.html', ); class Theme extends Layout { function Theme() { // Parent constructor $this->Layout(); $this->imgroot = THEME_DIR.'/images/'; $this->COLOR_CONTENT_BACK= '#ffffff'; $this->COLOR_LTBACK1= '#eeeeef'; $this->COLOR_LTBACK2= '#fafafa'; $this->COLOR_SELECTED_TAB= '#e0e0e0'; $this->COLOR_HTMLBOX_TITLE = '#bbbbbb'; $this->COLOR_HTMLBOX_BACK = '#eaecef'; $this->FONT_CONTENT = 'helvetica'; $this->FONT_HTMLBOX_TITLE = 'helvetica'; $this->FONTCOLOR_HTMLBOX_TITLE = '#333333'; $this->FONTCOLOR_CONTENT = '#333333'; $this->FONTSIZE = 'small'; $this->FONTSIZE_SMALLER='x-small'; $this->FONTSIZE_SMALLEST='xx-small'; $this->FONTSIZE_HTMLBOX_TITLE = 'small'; $this->bgpri = array(); } /** * Layout() - Constructor */ function Layout() { GLOBAL $bgpri; // Constructor for parent class... if ( file_exists($GLOBALS['sys_custom_path'] . '/index_std.php') ) $this->rootindex = $GLOBALS['sys_custom_path'] . '/index_std.php'; $this->Error(); /* Set up the priority color array one time only */ $bgpri[1] = '#dadada'; $bgpri[2] = '#dacaca'; $bgpri[3] = '#dababa'; $bgpri[4] = '#daaaaa'; $bgpri[5] = '#da8a8a'; //determine font for this platform if (browser_is_windows() && browser_is_ie()) { //ie needs smaller fonts $this->FONTSIZE='x-small'; $this->FONTSIZE_SMALLER='xx-small'; $this->FONTSIZE_SMALLEST='7pt'; } else if (browser_is_windows()) { //netscape on wintel $this->FONTSIZE='small'; $this->FONTSIZE_SMALLER='x-small'; $this->FONTSIZE_SMALLEST='x-small'; } else if (browser_is_mac()){ //mac users need bigger fonts $this->FONTSIZE='medium'; $this->FONTSIZE_SMALLER='small'; $this->FONTSIZE_SMALLEST='x-small'; } else { //linux and other users $this->FONTSIZE='small'; $this->FONTSIZE_SMALLER='x-small'; $this->FONTSIZE_SMALLEST='xx-small'; } $this->FONTSIZE_HTMLBOX_TITLE = $this->FONTSIZE; } /** * createLinkToUserHome() - Creates a link to a user's home page * * @param string The user's user_name * @param string The user's realname */ function createLinkToUserHome($user_name, $realname) { return ''.$realname.''; } /** * header() - "steel theme" top of page * * @param array Header parameters array */ function header($params) { if (!$params['title']) { $params['title'] = $GLOBALS['sys_name']; } else { $params['title'] = $GLOBALS['sys_name'] . ': ' . $params['title']; } print ''; ?> <?php echo $params['title']; ?> headerCSS(); ?> bodyHeader($params); } function bodyHeader($params){ global $user_guide; ?>
'0')); ?> searchBox(); ?> | | | quickNav(); ?>   
outerTabs($params); ?>
projectTabs($params['toptab'],$params['group']); ?>

Powered By GForge Collaborative Development Environment
'._('Show source').' '; } ?> 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) { return '
'.$title.'
'; } /** * boxMiddle() - Middle HTML box * * @param string Box title * @param string The box background color */ function boxMiddle($title) { return '
'.$title.'
'; } /** * boxBottom() - Bottom HTML box * * @param bool Whether to echo or return the results */ function boxBottom() { return '

'; } /** * boxGetAltRowStyle() - Get an alternating row style for tables * * @param int Row number */ function boxGetAltRowStyle($i) { if ($i % 2 == 0) { return ' bgcolor="#EAEAEA"'; } else { return ' bgcolor="#E0E0E0"'; } } /** * 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 */ function listTableTop ($title_arr,$links_arr=false) { $return = '
'; $count=count($title_arr); if ($links_arr) { for ($i=0; $i<$count; $i++) { $return .= ' '; } } else { for ($i=0; $i<$count; $i++) { $return .= ' '; } } return $return.''; } function listTableBottom() { return '
'.$title_arr[$i].''.$title_arr[$i].'
'; } function outerTabs($params) { global $sys_use_trove,$sys_use_snippet,$sys_use_people; $TABS_DIRS[]='/'; $TABS_DIRS[]='/my/'; if ($sys_use_trove) { $TABS_DIRS[]='/softwaremap/'; } if ($sys_use_snippet) { $TABS_DIRS[]='/snippet/'; } if ($sys_use_people) { $TABS_DIRS[]='/people/'; } $TABS_TITLES[]=_('Home'); $TABS_TITLES[]=_('My Page'); if ($sys_use_trove) { $TABS_TITLES[]=_('Project Tree'); } if ($sys_use_snippet) { $TABS_TITLES[]=_('Code Snippets'); } if ($sys_use_people) { $TABS_TITLES[]=_('Project Openings'); } // 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[]='/admin/'; $TABS_TITLES[]=_('Admin'); } if ($permstats->isMember()) { $TABS_DIRS[]='/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 { $TABS_DIRS[]='/projects/'.$project->getUnixName().'/'; $TABS_TITLES[]=$project->getPublicName(); $selected=count($TABS_DIRS)-1; } } } elseif (strstr(getStringFromServer('REQUEST_URI'),'/my/') || strstr(getStringFromServer('REQUEST_URI'),'/account/') || strstr(getStringFromServer('REQUEST_URI'),'/themes/') ) { $selected=array_search("/my/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'),'softwaremap')) { $selected=array_search("/softwaremap/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'),'/snippet/')) { $selected=array_search("/snippet/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'),'/people/')) { $selected=array_search("/people/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'),'/reporting/')) { $selected=array_search('/reporting/',$TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'),'/admin/') && $user_is_super) { $selected=array_search('/admin/',$TABS_DIRS); } else { $selected=0; } if (!$this->COLOR_SELECTED_TAB) { $this->COLOR_SELECTED_TAB= '#e0e0e0'; } echo $this->tabGenerator($TABS_DIRS,$TABS_TITLES,false,$selected,$this->COLOR_SELECTED_TAB,'100%'); } /** * projectTabs() - Prints out the project tabs, contained here in case * we want to allow it to be overriden * * @param string Is the tab currently selected * @param string Is the group we should look up get title info */ function projectTabs($toptab,$group) { // 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; } // Summary $TABS_DIRS[]='/projects/'. $project->getUnixName() .'/'; $TABS_TITLES[]=_('Summary'); (($toptab == 'home') ? $selected=(count($TABS_TITLES)-1) : '' ); // Project Admin $perm =& $project->getPermission( session_get_user() ); if ($perm->isAdmin()) { $TABS_DIRS[]='/project/admin/?group_id='. $group; $TABS_TITLES[]=_('Admin'); (($toptab == 'admin') ? $selected=(count($TABS_TITLES)-1) : '' ); } /* Homepage $TABS_DIRS[]='http://'. $project->getHomePage(); $TABS_TITLES[]=_('Home Page'); */ // Project Activity tab $TABS_DIRS[]='/activity/?group_id='. $group; $TABS_TITLES[]=_('Activity'); (($toptab == 'activity') ? $selected=(count($TABS_TITLES)-1) : '' ); // Forums if ($project->usesForum()) { $TABS_DIRS[]='/forum/?group_id='.$group; $TABS_TITLES[]=_('Forums'); (($toptab == 'forums') ? $selected=(count($TABS_TITLES)-1) : '' ); } // Artifact Tracking if ($project->usesTracker()) { $TABS_DIRS[]='/tracker/?group_id='.$group; $TABS_TITLES[]=_('Tracker'); (($toptab == 'tracker' || $toptab == 'bugs' || $toptab == 'support' || $toptab == 'patch') ? $selected=(count($TABS_TITLES)-1) : '' ); } // Mailing Lists if ($project->usesMail()) { $TABS_DIRS[]='/mail/?group_id='.$group; $TABS_TITLES[]=_('Lists'); (($toptab == 'mail') ? $selected=(count($TABS_TITLES)-1) : '' ); } // Project Manager if ($project->usesPm()) { $TABS_DIRS[]='/pm/?group_id='.$group; $TABS_TITLES[]=_('Tasks'); (($toptab == 'pm') ? $selected=(count($TABS_TITLES)-1) : '' ); } // Doc Manager if ($project->usesDocman()) { $TABS_DIRS[]='/docman/?group_id='.$group; $TABS_TITLES[]=_('Docs'); (($toptab == 'docman') ? $selected=(count($TABS_TITLES)-1) : '' ); } // Surveys if ($project->usesSurvey()) { $TABS_DIRS[]='/survey/?group_id='.$group; $TABS_TITLES[]=_('Surveys'); (($toptab == 'surveys') ? $selected=(count($TABS_TITLES)-1) : '' ); } //newsbytes if ($project->usesNews()) { $TABS_DIRS[]='/news/?group_id='.$group; $TABS_TITLES[]=_('News'); (($toptab == 'news') ? $selected=(count($TABS_TITLES)-1) : '' ); } // SCM systems if ($project->usesSCM()) { $TABS_DIRS[]='/scm/?group_id='.$group; $TABS_TITLES[]=_('SCM'); (($toptab == 'scm') ? $selected=(count($TABS_TITLES)-1) : '' ); } // groupmenu_after_scm hook $hookParams['DIRS'] = &$TABS_DIRS; $hookParams['TITLES'] = &$TABS_TITLES; $hookParams['toptab'] = &$toptab; $hookParams['selected'] = &$selected; $hookParams['group_id'] = $group ; plugin_hook ("groupmenu_scm", $hookParams) ; // Downloads if ($project->usesFRS()) { $TABS_DIRS[]='/frs/?group_id='.$group; $TABS_TITLES[]=_('Files'); (($toptab == 'frs') ? $selected=(count($TABS_TITLES)-1) : '' ); } // groupmenu hook $hookParams['DIRS'] = &$TABS_DIRS; $hookParams['TITLES'] = &$TABS_TITLES; $hookParams['toptab'] = &$toptab; $hookParams['selected'] = &$selected; $hookParams['group'] = $group; plugin_hook ("groupmenu", $hookParams) ; echo $this->tabGenerator($TABS_DIRS,$TABS_TITLES,true,$selected,'white','100%'); } 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)); $return = ' '; $folder = $this->imgroot.($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'; } $clear_img = $this->imgroot.'clear.png'; if ($nested) { $tab_height = BOTTOM_TAB_HEIGHT; $return .= sprintf( '', $middle_img, $clear_img, $tab_height ); $return .= sprintf( '', $middle_img, $css_class, $GLOBALS['sys_urlprefix'].$TABS_DIRS[$i], $TABS_TITLES[$i]); // if the next tab is not last, insert a separator if ($i < $count-1) { $return .= sprintf( '', $separ_img, $clear_img, $tab_height ); } } else { $tab_height = TOP_TAB_HEIGHT; $return .= sprintf( '', $left_img, $clear_img, $tab_height ); $return .= sprintf( '', $middle_img, $css_class, $GLOBALS['sys_urlprefix'].$TABS_DIRS[$i], $TABS_TITLES[$i]); // if the next tab is not selected, close this tab if ($selected != $i+1) { $return .= sprintf( '', $right_img, $clear_img, $tab_height ); } } } // // Building a bottom row in this table, which will be darker // /* if ($selected == 0) { $beg_cols=0; $end_cols=((count($TABS_DIRS)*3)-3); } elseif ($selected == (count($TABS_DIRS)-1)) { $beg_cols=((count($TABS_DIRS)*3)-3); $end_cols=0; } else { $beg_cols=($selected*3); $end_cols=(((count($TABS_DIRS)*3)-3)-$beg_cols); } $return .= ''; if ($beg_cols > 0) { $return .= ''; } $return .= ''; if ($end_cols > 0) { $return .= ''; } */ $return .= ''; return $return.'
%s %s
'; } 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 '
'; if (isset($group_id) && $group_id) { print ' '; } print '
'; $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 '
'; // print '
'; // print ' // Require All Words'; print '
 '; $parameters = $searchManager->getParameters(); foreach($parameters AS $name => $value) { print ''; } print ''; print ''; print ' '; print ''; print '  '._('Advanced search').'
'; print '
'; } function advancedSearchBox($sectionsArray, $group_id, $words, $isExact) { // display the searchmask print '

'._('with all words').' '._('with one word').'

' .$this->createUnderSections($sectionsArray).'
'; //create javascript methods for select none/all print ' '; } function createUnderSections($sectionsArray) { $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 = '
'._('Search in').' '._('Select').' '._('all').' / '._('none').'
 
'; 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 .= ''; $break += $breakLimit; } } $return .= '
'.$group_subsection_names[$key].'' .' ' ._('Select').' '._('all').' / '._('none').'
'; if (!is_array($section)) { $return .= ' '; } else foreach($section as $underkey => $undersection) { $return .= ' '; } $return .= '

'; if ($countLines >= $break) { if (($countLines - $break) < ($break - $countLines)) { $return .= '
'; $break += $breakLimit; } } } return $return.'
'; } /** * beginSubMenu() - Opening a submenu. * * @return string Html to start a submenu. */ function beginSubMenu () { $return = '

'; return $return; } /** * endSubMenu() - Closing a submenu. * * @return string Html to end a submenu. */ function endSubMenu () { $return = '

'; 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--; $return = ''; for ($i=0; $i<$count; $i++) { $return .= ' '.$title_arr[$i].' | '; } $return .= ' '.$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; } /** * 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= ' COLOR_HTMLBOX_TITLE .'"'; } $return .= '>'; for ( $c = 0; $c < count($cell_data); $c++ ) { $return .='FONTCOLOR_HTMLBOX_TITLE.'">'; } $return .= $cell_data[$c][0]; if ( $istitle ) { $return .=''; } $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 '

'.strip_tags($feedback, '
').'

'; } } /** * getThemeIdFromName() * * @param string the dirname of the theme * @return integer the theme id */ function getThemeIdFromName($dirname) { $res=db_query("SELECT theme_id FROM themes WHERE dirname='$dirname'"); return db_result($res,0,'theme_id'); } function quickNav() { if (!session_loggedin()) { return ''; } else { $res=db_query("SELECT * FROM groups NATURAL JOIN user_group WHERE user_id='".user_getid()."' ORDER BY group_name"); echo db_error(); if (!$res || db_numrows($res) < 1) { return ''; } else { $ret = '
'; } } return $ret; } } // Local Variables: // mode: php // c-file-style: "bsd" // End: ?>