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_url ('/themes/'.$GLOBALS['sys_theme'].'/images/'); } // 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(); } /** * headerLink() - common code for all themes * */ function headerLink() { echo ''; echo ''; echo ''; echo ''; } /** * headerStart() - common code for all themes * * @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 ' <?php echo $params['title']; ?> headerLink(); ?> '; echo $activity; } ?> headerCSS(); ?> .css file */ $theme_cssfile=$GLOBALS['sys_themeroot'].$GLOBALS['sys_theme'].'/css/'.$GLOBALS['sys_theme'].'.css'; if (file_exists($theme_cssfile)){ echo ' '; } 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 ' '; $theme_cssfile=$GLOBALS['sys_themeroot'].$GLOBALS['sys_theme'].'/css/theme.css'; if (file_exists($theme_cssfile)){ echo ' '; } } plugin_hook ('cssfile',$this); } function header($params) { $this->headerStart($params); ?> bodyHeader($params); } function bodyHeader($params){ ?>
'0')); ?> searchBox(); ?> 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')); } } $params['template'] = ' {menu}'; plugin_hook ('headermenu', $params); echo $this->quickNav(); ?>   
  outerTabs($params); ?>  
  projectTabs($params['toptab'],$params['group']); ?>  
footerEnd($params); } function footerEnd($params) { ?>
Powered By FusionForge
'showsource')); } ?>
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 ' class="altRowStyleEven"'; } else { return ' class="altRowStyleOdd"'; } } /** * 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 '
'.util_make_link ($links_arr[$i],$title_arr[$i],array('class'=>'sortbutton')).''.$title_arr[$i].'
'; } function outerTabs($params) { global $sys_use_trove,$sys_use_snippet,$sys_use_people,$sys_use_project_tags, $sys_use_project_full_list; $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 Page'); if ($sys_use_trove || $sys_use_project_tags || $sys_use_project_full_list) { $TABS_TITLES[]=_('Projects'); } 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[]=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_url ('/my/') ) || strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/account/') ) || strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/register/') ) || strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/themes/') ) ) { $selected=array_search(util_make_url ('/my/'), $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('softwaremap') )) { $selected=array_search(util_make_url ('/softwaremap/'), $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/snippet/') )) { $selected=array_search(util_make_url ('/snippet/'), $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/people/') )) { $selected=array_search(util_make_url ('/people/'), $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/reporting/') )) { $selected=array_search(util_make_url ('/reporting/'),$TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/admin/') ) && $user_is_super) { $selected=array_search(util_make_url ('/admin/'),$TABS_DIRS); } elseif (count($PLUGIN_TABS_DIRS)>0) { foreach ($PLUGIN_TABS_DIRS as $PLUGIN_TABS_DIRS_VALUE) { if (strstr(getStringFromServer('REQUEST_URI'),$PLUGIN_TABS_DIRS_VALUE)) { $selected=array_search($PLUGIN_TABS_DIRS_VALUE,$TABS_DIRS); break; } } } else { $selected=0; } echo $this->tabGenerator($TABS_DIRS,$TABS_TITLES,false,$selected,'','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 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[]=_('Summary'); (($toptab == 'home') ? $selected=(count($TABS_TITLES)-1) : '' ); // Project Admin $perm =& $project->getPermission( session_get_user() ); if ($perm->isAdmin()) { $TABS_DIRS[]=util_make_url ('/project/admin/?group_id=' . $group); $TABS_TITLES[]=_('Admin'); (($toptab == 'admin') ? $selected=(count($TABS_TITLES)-1) : '' ); } /* Homepage $TABS_DIRS[]='http://'. $project->getHomePage(); $TABS_TITLES[]=_('Home Page'); */ // Project Activity tab $TABS_DIRS[]=util_make_url ('/activity/?group_id=' . $group); $TABS_TITLES[]=_('Activity'); (($toptab == 'activity') ? $selected=(count($TABS_TITLES)-1) : '' ); // Forums if ($project->usesForum()) { $TABS_DIRS[]=util_make_url ('/forum/?group_id='.$group); $TABS_TITLES[]=_('Forums'); (($toptab == 'forums') ? $selected=(count($TABS_TITLES)-1) : '' ); } // Artifact Tracking if ($project->usesTracker()) { $TABS_DIRS[]=util_make_url ('/tracker/?group_id='.$group); $TABS_TITLES[]=_('Tracker'); (($toptab == 'tracker' || $toptab == 'bugs' || $toptab == 'support' || $toptab == 'patch') ? $selected=(count($TABS_TITLES)-1) : '' ); } // Mailing Lists if ($project->usesMail()) { $TABS_DIRS[]=util_make_url ('/mail/?group_id='.$group); $TABS_TITLES[]=_('Lists'); (($toptab == 'mail') ? $selected=(count($TABS_TITLES)-1) : '' ); } // Project Manager if ($project->usesPm()) { $TABS_DIRS[]=util_make_url ('/pm/?group_id='.$group); $TABS_TITLES[]=_('Tasks'); (($toptab == 'pm') ? $selected=(count($TABS_TITLES)-1) : '' ); } // Doc Manager if ($project->usesDocman()) { $TABS_DIRS[]=util_make_url ('/docman/?group_id='.$group); $TABS_TITLES[]=_('Docs'); (($toptab == 'docman') ? $selected=(count($TABS_TITLES)-1) : '' ); } // Surveys if ($project->usesSurvey()) { $TABS_DIRS[]=util_make_url ('/survey/?group_id='.$group); $TABS_TITLES[]=_('Surveys'); (($toptab == 'surveys') ? $selected=(count($TABS_TITLES)-1) : '' ); } //newsbytes if ($project->usesNews()) { $TABS_DIRS[]=util_make_url ('/news/?group_id='.$group); $TABS_TITLES[]=_('News'); (($toptab == 'news') ? $selected=(count($TABS_TITLES)-1) : '' ); } // SCM systems if ($project->usesSCM()) { $TABS_DIRS[]=util_make_url ('/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[]=util_make_url ('/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 = ''; $return .= ' '; if ($nested) { $inner='bottomtab'; } else { $inner='toptab'; } $rowspan = ''; for ($i=0; $i<$count; $i++) { if ($i == 0) { // // this is the first tab, choose an image with end-name // $wassel=false; $issel=($selected==$i); $bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png'); // $rowspan=(($issel)?'rowspan="2" ' : ''); $return .= ' '. ''; } elseif ($i==$count-1) { // // this is the last tab, choose an image with name-end // $wassel=($selected==$i-1); $issel=($selected==$i); $bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png'); // $rowspan=(($issel)?'rowspan="2" ' : ''); // // Build image between current and prior tab // $return .= ' '. ''; // // Last graphic on right-side // $return .= ' '; } else { // // middle tabs // $wassel=($selected==$i-1); $issel=($selected==$i); $bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png'); // $rowspan=(($issel)?'rowspan="2" ' : ''); // // Build image between current and prior tab // $return .= ' '. ''; } } $return .= ''; // // 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.'
'. ''.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink')),true).''. ''.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink')),true).''. ''. ''.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink')),true).'
'; } 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 '
'; if (isset($group_id) && $group_id) { print ' '; } print '
'; // print '
'; // print ' // Require All Words'; print '
 '; $parameters = $searchManager->getParameters(); foreach($parameters AS $name => $value) { print ''; } print ''; print ''; print ' '; print ''; print '  '.util_make_link ('/search/advanced_search.php?group_id='.$group_id,_('Advanced search'),array('class'=>'lnkutility')).'
'; 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) { 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 = '
'._('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 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 .= ''; $countCol++; $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 .= 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; } /** * 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= ' '.strip_tags($feedback, '
').''; } } /** * warning_msg() - returns the htmlized warning string when an action is performed. * * @param string msg string * @return string htmlized warning */ function warning_msg($msg) { if (!$msg) { return ''; } else { return '
'.strip_tags($msg, '
').'
'; } } /** * error_msg() - returns the htmlized error string when an action is performed. * * @param string msg string * @return string htmlized error */ function error_msg($msg) { if (!$msg) { return ''; } else { return '
'.strip_tags($msg, '
').'
'; } } /** * 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'); } function quickNav() { if (!session_loggedin()) { return ''; } else { $res = db_query_params ('SELECT * FROM groups JOIN user_group USING (group_id) WHERE user_group.user_id=$1 AND groups.status=$2 ORDER BY group_name', array (user_getid(), 'A')); echo db_error(); if (!$res || db_numrows($res) < 1) { return ''; } else { $ret = '
'; } } return $ret; } function confirmBox($msg, $params, $buttons, $image='*none*') { if ($image == '*none*') { $image = html_image('stop.png','48','48',array()); } foreach ($params as $b => $v) { $prms[] = ''."\n"; } $prm = join(' ', $prms); foreach ($buttons as $b => $v) { $btns[] = ''."\n"; } $btn = join('    '."\n ", $btns); return '
'.$image.' '.$msg.'

'.$prm.' '.$btn.'
'; } } // Local Variables: // mode: php // c-file-style: "bsd" // End: ?>