5 * Extends the basic Error class to add HTML functions
6 * for displaying all site dependent HTML, while allowing
7 * extendibility/overriding by themes via the Theme class.
9 * Make sure browser.php is included _before_ you create an instance of this object.
11 * Geoffrey Herteg, August 29, 2000
15 require_once $gfwww.'search/include/SearchManager.class.php';
17 class Theme extends Layout {
20 * The default main page content
22 var $rootindex = 'index_std.php';
25 * The root location of the theme
26 * @var string $themeroot
31 * The root location for images
33 * @var string $imgroot
36 var $imgroot = '/themes/gforge/images/';
44 * Layout() - Constructor
48 $this->themeroot=$GLOBALS['sys_themeroot'].$GLOBALS['sys_theme'];
49 /* if images directory exists in theme, then use it as imgroot */
50 if (file_exists ($this->themeroot.'/images')){
51 $this->imgroot='/themes/'.$GLOBALS['sys_theme'].'/images/';
53 // Constructor for parent class...
54 if ( file_exists($GLOBALS['sys_custom_path'] . '/index_std.php') )
55 $this->rootindex = $GLOBALS['sys_custom_path'] . '/index_std.php';
61 * headerStart() - common code for all themes
63 * @param array Header parameters array
65 function headerStart($params) {
66 if (!$params['title']) {
67 $params['title'] = forge_get_config ('forge_name');
69 $params['title'] = forge_get_config ('forge_name') . ': ' . $params['title'];
71 print '<?xml version="1.0" encoding="utf-8"';
75 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
76 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
78 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo _('en') ?>"
79 lang="<?php echo _('en') ?>">
82 <meta http-equiv="Content-Type"
83 content="text/html; charset=utf-8" />
84 <title><?php echo $params['title']; ?></title>
85 <?php $this->headerLink(); ?>
86 <?php if (isset($GLOBALS['group_id'])) {
87 $activity = '<link rel="alternate" title="'.forge_get_config ('forge_name').' - New Activity RSS" href="'.
88 util_make_url ('/export/rss20_activity.php?group_id='.$GLOBALS['group_id']).
89 '" type="application/rss+xml"/>';
95 /* check if a personalized css stylesheet exist, if yes include only
97 new stylesheets should use the <themename>.css file
99 $theme_cssfile=$GLOBALS['sys_themeroot'].$GLOBALS['sys_theme'].'/css/'.$GLOBALS['sys_theme'].'.css';
100 if (file_exists($theme_cssfile)){
102 <link rel="stylesheet" type="text/css" href="'.util_make_uri ('/themes/'.$GLOBALS['sys_theme'].'/css/'.$GLOBALS['sys_theme'].'.css').'"/>';
106 <script language="JavaScript" type="text/javascript">
109 function admin_window(adminurl) {
110 AdminWin = window.open( adminurl, 'AdminWindow','scrollbars=yes,resizable=yes, toolbar=yes, height=400, width=400, top=2, left=2');
113 function help_window(helpurl) {
114 HelpWin = window.open( helpurl,'HelpWindow','scrollbars=yes,resizable=yes,toolbar=no,height=400,width=400');
117 <?php plugin_hook ("javascript",false) ; ?>
119 <?php plugin_hook ('cssfile',$this); ?>
126 function header($params) {
127 $this->headerStart($params); ?>
134 <h1><?php echo util_make_link ('/',_('Home')); ?></h1>
138 if (session_loggedin()) {
139 $u =& user_get_object(user_getid());
140 echo util_make_link ('/account/logout.php', sprintf("%s (%s)", _('Log Out'), $u->getRealName()));
142 echo util_make_link ('/account/',_('My Account'));
145 echo util_make_link ('/account/login.php',_('Log In'));
147 if (!forge_get_config ('user_registration_restricted')) {
148 echo util_make_link ('/account/register.php',_('New Account'));
155 <div id="headercontent"><br />
156 <?php echo $this->searchBox();
162 <div id="outertabscontainer">
163 <div id="outertabs-left"></div>
164 <div id="outertabs-content"><?php echo $this->outerTabs($params);
166 <div id="outertabs-right"></div>
171 if (isset($params['group']) && $params['group']) {
173 <div id="projecttabscontainer">
174 <div id="projecttabs-left"></div>
175 <div id="projecttabs-content"><?php echo $this->projectTabs($params['toptab'],$params['group']);?>
177 <div id="projecttabs-right"></div>
184 <div id="gforge-content">
185 <div id="<?php echo "gforge-content-".$this->selected_id;
187 <fieldset><legend><?php
188 echo '<a href="'.$this->selected_dir.'">'.$this->selected_title.'</a>';
193 function footer($params){
194 echo '</fieldset></div></div>';
195 $this->footerEnd($params);
198 function footerEnd($params) { ?> <!-- PLEASE LEAVE "Powered By FusionForge" on your site -->
199 <div id="footer"><a href="http://fusionforge.org/"><img
200 src="<?php echo util_make_uri ('/images/pow-fusionforge.png'); ?>"
201 alt="Powered By FusionForge"
205 global $sys_show_source;
206 if ($sys_show_source) {
207 echo util_make_link ('/source.php?file='.getStringFromServer('SCRIPT_NAME'),_('Show source'),array('class'=>'showsource'));
217 function getRootIndex() {
218 return $this->rootindex;
222 * boxTop() - Top HTML box
224 * @param string Box title
225 * @param bool Whether to echo or return the results
226 * @param string The box background color
228 function boxTop($title) {
230 <!-- Box Top Start -->
232 <table cellspacing="0" cellpadding="0" width="100%" border="0">
233 <tr class="tableheading">
234 <td valign="top" align="right" width="10"><img src="'.$this->imgroot.'clear.png'.'" width="10" height="20" alt="" /></td>
235 <td width="100%"><span class="titlebar">'.$title.'</span></td>
236 <td valign="top" width="10"><img src="'.$this->imgroot.'clear.png'.'" width="10" height="20" alt=""/></td>
240 <table cellspacing="2" cellpadding="2" width="100%" border="0" class="tablecontent">
244 <!-- Box Top End -->';
248 * boxMiddle() - Middle HTML box
250 * @param string Box title
251 * @param string The box background color
253 function boxMiddle($title) {
255 <!-- Box Middle Start -->
258 <tr class="tableheading">
259 <td colspan="2">'.$title.'</td>
261 <tr align="left" class="tablecontent">
263 <!-- Box Middle End -->';
267 * boxBottom() - Bottom HTML box
269 * @param bool Whether to echo or return the results
271 function boxBottom() {
273 <!-- Box Bottom Start -->
280 <!-- Box Bottom End -->';
284 * boxGetAltRowStyle() - Get an alternating row style for tables
286 * @param int Row number
288 function boxGetAltRowStyle($i) {
290 return ' class="altRowStyleEven"';
292 return ' class="altRowStyleOdd"';
297 * listTableTop() - Takes an array of titles and builds the first row of a new table.
299 * @param array The array of titles
300 * @param array The array of title links
302 function listTableTop ($title_arr,$links_arr=false,$cnt=0) {
306 $return='<div id="tabletop">';
309 $return='<div id="tabletop'.$cnt.'">';
315 $count=count($title_arr);
317 for ($i=0; $i<$count; $i++) {
319 <td><a href="'.$links_arr[$i].'">'.$title_arr[$i].'</a></td>';
322 for ($i=0; $i<$count; $i++) {
324 <td>'.$title_arr[$i].'</td>';
327 return $return.'</tr></thead>';
332 function listTableBottom() {
340 function outerTabs($params) {
341 global $sys_use_trove,$sys_use_snippet,$sys_use_people;
344 $TABS_DIRS[]=util_make_url ('/') ;
346 $TABS_TITLES[]=_('Home');
349 $TABS_DIRS[]=util_make_url ('/my/') ;
350 $TABS_TITLES[]=_('My Page');
351 if (strstr(getStringFromServer('REQUEST_URI'),'/my/') || strstr(getStringFromServer('REQUEST_URI'),'/account/') ) {
352 $selected=count($TABS_DIRS)-1;
355 if ($sys_use_trove) {
356 $TABS_IDS[]='softwaremap';
357 $TABS_DIRS[]=util_make_url ('/softwaremap/') ;
358 $TABS_TITLES[]=_('Project Tree');
359 if (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/softwaremap/'))) {
360 $selected=count($TABS_DIRS)-1;
363 if ($sys_use_snippet) {
364 $TABS_IDS[]='snippet';
365 $TABS_DIRS[]=util_make_url ('/snippet/') ;
366 $TABS_TITLES[]=_('Code Snippets');
367 if (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/snippet/'))) {
368 $selected=count($TABS_DIRS)-1;
371 if ($sys_use_people) {
372 $TABS_IDS[]='people';
373 $TABS_DIRS[]=util_make_url ('/people/') ;
374 $TABS_TITLES[]=_('Project Openings');
375 if (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/people/'))) {
376 $selected=count($TABS_DIRS)-1;
380 $PLUGIN_TABS_DIRS = Array();
381 $hookParams['DIRS'] = &$PLUGIN_TABS_DIRS;
382 $hookParams['TITLES'] = &$TABS_TITLES;
383 plugin_hook ("outermenu", $hookParams) ;
384 $TABS_DIRS = array_merge($TABS_DIRS, $PLUGIN_TABS_DIRS);
386 if (user_ismember(1,'A')) {
388 $TABS_DIRS[]=util_make_url ('/admin/') ;
389 $TABS_TITLES[]=_('Admin');
390 if (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/admin/'))) {
391 $selected=count($TABS_DIRS)-1;
395 if (user_ismember($GLOBALS['sys_stats_group'])) {
396 $TABS_IDS[]='reporting';
397 $TABS_DIRS[]=util_make_url ('/reporting/') ;
398 $TABS_TITLES[]=_('Reporting');
399 if (strstr(getStringFromServer('REQUEST_URI'),util_make_url ('/reporting/'))) {
400 $selected=count($TABS_DIRS)-1;
404 if(isset($params['group']) && $params['group']) {
405 // get group info using the common result set
406 $project =& group_get_object($params['group']);
407 if ($project && is_object($project)) {
408 if ($project->isError()) {
410 } elseif (!$project->isProject()) {
413 $TABS_DIRS[]=util_make_url_g ($project->getUnixName(),$params['group']);
414 $TABS_TITLES[]=$project->getPublicName();
415 $selected=count($TABS_DIRS)-1;
418 } elseif (count($PLUGIN_TABS_DIRS)>0) {
419 foreach ($PLUGIN_TABS_DIRS as $PLUGIN_TABS_DIRS_VALUE) {
420 if (strstr($GLOBALS['REQUEST_URI'],$PLUGIN_TABS_DIRS_VALUE)) {
421 $selected=array_search($PLUGIN_TABS_DIRS_VALUE,$TABS_DIRS);
426 $c=(count($TABS_TITLES)-1);
427 if(isset($params['group']) && $params['group']) {
428 /* project is selected */
431 for ($i=0; $i<=$c; $i++) {
432 if ($selected == $i){
433 $this->selected_title = $TABS_TITLES[$i];
434 $this->selected_dir = $TABS_DIRS[$i];
435 $this->selected_id = $TABS_IDS[$i];
436 @$return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>'gforge-selected','title'=>$TABS_TITLES[$i]));
439 @$return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>'gforge-'.$TABS_IDS[$i],'title'=>$TABS_TITLES[$i]));
442 if(isset($params['group']) && $params['group']) {
443 $return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>'gforge-selected','title'=>$TABS_TITLES[$i]));
444 $this->selected_title = $TABS_TITLES[$i];
450 * projectTabs() - Prints out the project tabs, contained here in case
451 * we want to allow it to be overriden
453 * @param string Is the tab currently selected
454 * @param string Is the group we should look up get title info
456 function projectTabs($toptab,$group) {
457 // get group info using the common result set
458 $project =& group_get_object($group);
459 if (!$project || !is_object($project)) {
462 if ($project->isError()) {
463 //wasn't found or some other problem
466 if (!$project->isProject()) {
470 // $TABS_DIRS[]='/projects/'.$project->getUnixName().'/';
471 // $TABS_TITLES[]=$project->getPublicName();
474 if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
475 $TABS_DIRS[]=util_make_url('/project/?group_id='.$group);
477 $TABS_DIRS[]=util_make_url('/projects/'.$project->getUnixName());
479 $TABS_IDS[]='gforge-project-summary';
480 $TABS_TITLES[]=_('Summary');
481 (($toptab == 'home') ? $selected=(count($TABS_TITLES)-1) : '' );
483 if (user_ismember($group,'A')) {
485 $TABS_DIRS[]=util_make_url('/project/admin/?group_id='. $group);
486 $TABS_IDS[]='gforge-project-admin';
487 $TABS_TITLES[]=_('Admin');
488 (($toptab == 'admin') ? $selected=(count($TABS_TITLES)-1) : '' );
491 /* $TABS_DIRS[]='http://'. $project->getHomePage();
492 $TABS_TITLES[]=_('Home Page');
495 $TABS_DIRS[]=util_make_url('/activity/?group_id='. $group);
496 $TABS_IDS[]='gforge-project-activity';
497 $TABS_TITLES[]=_('Activity');
498 (($toptab == 'activity') ? $selected=(count($TABS_TITLES)-1) : '' );
501 if ($project->usesForum()) {
502 $TABS_DIRS[]=util_make_url ('/forum/?group_id='.$group) ;
503 $TABS_IDS[]='gforge-project-forum';
504 $TABS_TITLES[]=_('Forums');
505 (($toptab == 'forums') ? $selected=(count($TABS_TITLES)-1) : '' );
509 if ($project->usesTracker()) {
510 $TABS_DIRS[]=util_make_url ('/tracker/?group_id='.$group) ;
511 $TABS_IDS[]='gforge-project-tracker';
512 $TABS_TITLES[]=_('Tracker');
513 (($toptab == 'tracker' || $toptab == 'bugs' || $toptab == 'support' || $toptab == 'patch')
514 ? $selected=(count($TABS_TITLES)-1) : '' );
518 if ($project->usesMail()) {
519 $TABS_DIRS[]=util_make_url ('/mail/?group_id='.$group) ;
520 $TABS_IDS[]='gforge-project-mail';
521 $TABS_TITLES[]=_('Lists');
522 (($toptab == 'mail') ? $selected=(count($TABS_TITLES)-1) : '' );
526 if ($project->usesPm()) {
527 $TABS_DIRS[]=util_make_url ('/pm/?group_id='.$group) ;
528 $TABS_IDS[]='gforge-project-task';
529 $TABS_TITLES[]=_('Tasks');
530 (($toptab == 'pm') ? $selected=(count($TABS_TITLES)-1) : '' );
534 if ($project->usesDocman()) {
535 $TABS_DIRS[]=util_make_url ('/docman/?group_id='.$group) ;
536 $TABS_IDS[]='gforge-project-docman';
537 $TABS_TITLES[]=_('Docs');
538 (($toptab == 'docman') ? $selected=(count($TABS_TITLES)-1) : '' );
542 if ($project->usesSurvey()) {
543 $TABS_DIRS[]=util_make_url ('/survey/?group_id='.$group) ;
544 $TABS_IDS[]='gforge-project-survey';
545 $TABS_TITLES[]=_('Surveys');
546 (($toptab == 'surveys') ? $selected=(count($TABS_TITLES)-1) : '' );
550 if ($project->usesNews()) {
551 $TABS_DIRS[]=util_make_url ('/news/?group_id='.$group) ;
552 $TABS_IDS[]='gforge-project-news';
553 $TABS_TITLES[]=_('News');
554 (($toptab == 'news') ? $selected=(count($TABS_TITLES)-1) : '' );
558 if ($project->usesSCM()) {
559 $TABS_DIRS[]=util_make_url ('/scm/?group_id='.$group) ;
560 $TABS_IDS[]='gforge-project-scm';
561 $TABS_TITLES[]=_('SCM');
562 (($toptab == 'scm') ? $selected=(count($TABS_TITLES)-1) : '' );
565 // groupmenu_after_scm hook
566 $hookParams['DIRS'] = &$TABS_DIRS;
567 $hookParams['TITLES'] = &$TABS_TITLES;
568 $hookParams['toptab'] = &$toptab;
569 $hookParams['selected'] = &$selected;
570 $hookParams['group_id'] = $group ;
572 plugin_hook ("groupmenu_scm", $hookParams) ;
575 if ($project->usesFRS()) {
576 $TABS_DIRS[]=util_make_url ('/frs/?group_id='.$group) ;
577 $TABS_IDS[]='gforge-project-frs';
578 $TABS_TITLES[]=_('Files');
579 (($toptab == 'frs') ? $selected=(count($TABS_TITLES)-1) : '' );
583 $hookParams['DIRS'] = &$TABS_DIRS;
584 $hookParams['TITLES'] = &$TABS_TITLES;
585 $hookParams['toptab'] = &$toptab;
586 $hookParams['selected'] = &$selected;
587 $hookParams['group'] = $group;
589 plugin_hook ("groupmenu", $hookParams) ;
592 $c=(count($TABS_TITLES)-1);
593 for ($i=0; $i<=$c; $i++) {
595 $this->selected_title = $TABS_TITLES[$i];
596 $this->selected_dir = $TABS_DIRS[$i];
597 //$this->selected_id = $TABS_IDS[$i];
598 $return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>'gforge-project-selected'),true);
602 if (!isset($TABS_IDS[$i]) || $TABS_IDS[$i]==''){
603 $return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>'gforge-project-std','title'=>$TABS_TITLES[$i]),true);
607 $return .= util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('id'=>$TABS_IDS[$i],'title'=>$TABS_TITLES[$i]),true);
616 function searchBox() {
617 global $words,$forum_id,$group_id,$group_project_id,$atid,$exact,$type_of_search;
619 if(get_magic_quotes_gpc()) {
620 $defaultWords = stripslashes($words);
622 $defaultWords = $words;
625 // if there is no search currently, set the default
626 if ( ! isset($type_of_search) ) {
631 <form action="/search/" method="get">';
635 SEARCH__PARAMETER_GROUP_ID => $group_id,
636 SEARCH__PARAMETER_ARTIFACT_ID => $atid,
637 SEARCH__PARAMETER_FORUM_ID => $forum_id,
638 SEARCH__PARAMETER_GROUP_PROJECT_ID => $group_project_id
641 $searchManager =& getSearchManager();
642 $searchManager->setParametersValues($parameters);
643 $searchEngines =& $searchManager->getAvailableSearchEngines();
644 echo '<select name="type_of_search">';
645 for($i = 0, $max = count($searchEngines); $i < $max; $i++) {
646 $searchEngine =& $searchEngines[$i];
647 echo '<option value="'.$searchEngine->getType().'"'.( $type_of_search == $searchEngine->getType() ? ' selected="selected"' : '' ).'>'.$searchEngine->getLabel($parameters).'</option>'."\n";
650 $parameters = $searchManager->getParameters();
651 foreach($parameters AS $name => $value) {
652 print '<input type="hidden" value="'.$value.'" name="'.$name.'" />';
655 print '<input type="text" size="12" name="words" value="'.$defaultWords.'" />';
658 print '<input type="submit" name="Search" value="'._('Search').'" />';
661 if (isset($group_id)&& $group_id) {
662 echo util_make_link ('/search/advanced_search.php?group_id='.$group_id,_('Advanced search'),array('class'=>'lnkutility'));
668 function advancedSearchBox($sectionsArray, $group_id, $words, $isExact) {
669 // display the searchmask
671 <form name="advancedsearch" action="'.getStringFromServer('PHP_SELF').'" method="post">
672 <input type="hidden" name="search" value="1"/>
673 <input type="hidden" name="group_id" value="'.$group_id.'"/>
674 <div id="advancedsearchtext">
675 <input type="text" size="60" name="words" value="'.stripslashes(htmlspecialchars($words)).'" />
676 <input type="submit" name="submitbutton" value="'._('Search').'" />
677 <input type="radio" name="mode" value="'.SEARCH__MODE_AND.'" '.($isExact ? 'checked="checked"' : '').' />'._('with all words').'
678 <input type="radio" name="mode" value="'.SEARCH__MODE_OR.'" '.(!$isExact ? 'checked="checked"' : '').' />'._('with one word').'
680 print '<br/> '._('Select').' <a href="javascript:setCheckBoxes(\'\',true)">'._('all').'</a> / <a href="javascript:setCheckBoxes(\'\', false)">'._('none').'</a>';
682 print $this->createUnderSections($sectionsArray).'
686 //create javascript methods for select none/all
688 <script type="text/javascript">
689 <!-- method for disable/enable checkboxes
690 function setCheckBoxes(parent, checked) {
693 for (var i = 0; i < document.advancedsearch.elements.length; i++)
694 if (document.advancedsearch.elements[i].type == "checkbox")
695 if (document.advancedsearch.elements[i].name.substr(0, parent.length) == parent)
696 document.advancedsearch.elements[i].checked = checked;
704 function createUnderSections($sectionsArray) {
706 foreach ($sectionsArray as $section) {
707 if(is_array($section)) {
708 $countLines += (3 + count ($section));
710 //2 lines one for section name and one for checkbox
714 $breakLimit = round($countLines/3);
715 $break = $breakLimit;
718 <div id="advancedsearch"><ul>';
719 foreach($sectionsArray as $key => $section) {
720 $oldcountlines = $countLines;
721 if (is_array($section)) {
722 $countLines += (3 + count ($section));
727 if ($countLines >= $break) {
728 //if the next block is so large that shifting it to the next column hits the breakpoint better
729 //the second part of statement (behind &&) proofs, that no 4th column is added
730 if ((($countLines - $break) >= ($break - $countLines)) && ((($break + $breakLimit)/$breakLimit) <= 3)) {
731 $break += $breakLimit;
735 $return .= '<li><fieldset><legend>'.$group_subsection_names[$key].'</legend>'
736 ._('Select').' <a href="javascript:setCheckBoxes(\''.$key.'\', true)">'._('all').'</a> / <a href="javascript:setCheckBoxes(\''.$key.'\', false)">'._('none').'</a>
740 if (!is_array($section)) {
741 $return .= '<li><input type="checkbox" name="'.urlencode($key).'"';
742 if (isset($GLOBALS[urlencode($key)]))
743 $return .= ' checked="checked" ';
744 $return .= ' /></input>'.$group_subsection_names[$key].'</li>';
747 foreach($section as $underkey => $undersection) {
748 $return .= ' <li><input type="checkbox" name="'.urlencode($key.$underkey).'"';
749 if (isset($GLOBALS[urlencode($key.$underkey)]))
750 $return .= ' checked ';
751 $return .= '></input>'.$undersection.'</li>';
754 $return .= '</ul></div></fieldset></li>';
756 if ($countLines >= $break) {
757 if (($countLines - $break) < ($break - $countLines)) {
758 $break += $breakLimit;
762 $return.='</div></ul>';
767 * beginSubMenu() - Opening a submenu.
769 * @return string Html to start a submenu.
771 function beginSubMenu () {
778 * endSubMenu() - Closing a submenu.
780 * @return string Html to end a submenu.
782 function endSubMenu () {
783 $return = '</strong></p>';
788 * printSubMenu() - Takes two array of titles and links and builds the contents of a menu.
790 * @param array The array of titles.
791 * @param array The array of title links.
792 * @return string Html to build a submenu.
794 function printSubMenu ($title_arr,$links_arr) {
795 $count=count($title_arr);
800 for ($i=0; $i<$count; $i++) {
801 $return .= util_make_link ($links_arr[$i],$title_arr[$i]).' | ';
803 $return .= util_make_link ($links_arr[$i],$title_arr[$i]);
808 * subMenu() - Takes two array of titles and links and build a menu.
810 * @param array The array of titles.
811 * @param array The array of title links.
812 * @return string Html to build a submenu.
814 function subMenu ($title_arr,$links_arr) {
815 $return = $this->beginSubMenu () ;
816 $return .= $this->printSubMenu ($title_arr,$links_arr) ;
817 $return .= $this->endSubMenu () ;
822 * multiTableRow() - create a mutlilevel row in a table
824 * @param string the row attributes
825 * @param array the array of cell data, each element is an array,
826 * the first item being the text,
827 * the subsequent items are attributes (dont include
828 * the bgcolor for the title here, that will be
829 * handled by $istitle
830 * @param boolean is this row part of the title ?
833 function multiTableRow($row_attr, $cell_data, $istitle) {
837 $return .=' align="center" class="multiTableRowTitle"';
840 for ( $c = 0; $c < count($cell_data); $c++ ) {
842 for ( $a=1; $a < count($cell_data[$c]); $a++) {
843 $return .= $cell_data[$c][$a].' ';
847 $return .='<span class="multiTableRowTitle">';
849 $return .= $cell_data[$c][0];
863 * feedback() - returns the htmlized feedback string when an action is performed.
865 * @param string feedback string
866 * @return string htmlized feedback
868 function feedback($feedback) {
873 <span class="feedback">'.strip_tags($feedback, '<br>').'</span>';
878 * getThemeIdFromName()
880 * @param string the dirname of the theme
881 * @return integer the theme id
883 function getThemeIdFromName($dirname) {
884 $res = db_query_params ('SELECT theme_id FROM themes WHERE dirname=$1',
886 return db_result($res,0,'theme_id');
889 function quickNav() {
890 if (!session_loggedin()) {
893 $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',
897 if (!$res || db_numrows($res) < 1) {
901 <form name="quicknavform" action="" >
902 <select name="quicknav" onChange="location.href=document.quicknavform.quicknav.value">';
904 <option value="">Quick Jump To...</option>';
905 for ($i=0; $i<db_numrows($res); $i++) {
907 <option value="/projects/'.db_result($res,$i,'unix_group_name').'/">'.db_result($res,$i,'group_name').'</option>';
908 if (trim(db_result($res,$i,'admin_flags'))=='A') {
910 <option value="/project/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
913 if (db_result($res,$i,'use_tracker')) {
915 <option value="/tracker/?group_id='.db_result($res,$i,'group_id').'"> Tracker</option>';
916 if (db_result($res,$i,'admin_flags') || db_result($res,$i,'artifact_flags')) {
918 <option value="/tracker/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
922 if (db_result($res,$i,'use_pm')) {
924 <option value="/pm/?group_id='.db_result($res,$i,'group_id').'"> Task Manager</option>';
925 if (trim(db_result($res,$i,'admin_flags')) =='A' || db_result($res,$i,'project_flags')) {
927 <option value="/pm/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
931 if (db_result($res,$i,'use_frs')) {
933 <option value="/frs/?group_id='.db_result($res,$i,'group_id').'"> Files</option>';
934 if (trim(db_result($res,$i,'admin_flags'))=='A' || db_result($res,$i,'release_flags')) {
936 <option value="/frs/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
940 if (db_result($res,$i,'use_scm')) {
942 <option value="/scm/?group_id='.db_result($res,$i,'group_id').'"> SCM</option>';
943 /*if (db_result($res,$i,'admin_flags') || db_result($res,$i,'project_flags')) {
945 <option value="/pm/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
949 if (db_result($res,$i,'use_forum')) {
951 <option value="/forum/?group_id='.db_result($res,$i,'group_id').'"> Forum</option>';
952 if (trim(db_result($res,$i,'admin_flags'))=='A' || db_result($res,$i,'forum_flags')) {
954 <option value="/forum/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
958 if (db_result($res,$i,'use_mail')) {
960 <option value="/mail/?group_id='.db_result($res,$i,'group_id').'"> Lists</option>';
961 if (trim(db_result($res,$i,'admin_flags'))=='A') {
963 <option value="/mail/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
967 if (db_result($res,$i,'use_docman')) {
969 <option value="/docman/?group_id='.db_result($res,$i,'group_id').'"> Docs</option>';
970 if (trim(db_result($res,$i,'admin_flags'))=='A' || db_result($res,$i,'doc_flags')) {
972 <option value="/docman/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
976 if (db_result($res,$i,'use_news')) {
978 <option value="/news/?group_id='.db_result($res,$i,'group_id').'"> News</option>';
979 if (trim(db_result($res,$i,'admin_flags'))=='A') {
981 <option value="/news/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
985 if (db_result($res,$i,'use_survey')) {
987 <option value="/survey/?group_id='.db_result($res,$i,'group_id').'"> Surveys</option>';
988 if (trim(db_result($res,$i,'admin_flags'))=='A') {
990 <option value="/survey/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
1006 // c-file-style: "bsd"