2 class Theme extends Layout {
4 * Theme() - Constructor
10 * header() - "steel theme" top of page
12 * @param array Header parameters array
14 function header($params) {
15 if ($_POST['selectmenu'] == "yes")
17 header("Location:".$_POST['menuList']);
19 global $Language, $sys_name;
20 if (!$params['title']) {
21 $params['title'] = "$sys_name";
23 $params['title'] = "$sys_name: " . $params['title'];
25 print '<?xml version="1.0" encoding="' . $Language->getEncoding(). '"?>';
28 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
29 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
30 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="<?php echo $Language->getLanguageCode(); ?>">
32 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Language->getEncoding(); ?>" />
33 <title><?php echo $params['title']; ?></title>
38 <a href="<?php echo $GLOBALS['sys_urlprefix']; ?>/"><h2>GForge</h2></a>
42 if (session_loggedin()) {
44 <b><a href="<?php echo $GLOBALS['sys_urlprefix']; ?>/account/logout.php"><?php echo $Language->getText('common','logout'); ?></a></b>
45 <b><a href="<?php echo $GLOBALS['sys_urlprefix']; ?>/account/"><?php echo $Language->getText('common','myaccount'); ?></a></b>
49 <b><a href="<?php echo $GLOBALS['sys_urlprefix']; ?>/account/login.php"><?php echo $Language->getText('common','login'); ?></a></b>
50 <b><a href="<?php echo $GLOBALS['sys_urlprefix']; ?>/account/register.php"><?php echo $Language->getText('common','newaccount'); ?></a></b>
57 <?php echo $this->searchBox(); ?>
61 <?php echo $this->outerTabs($params); ?>
63 if ($params['group']) {
66 echo $this->projectTabs($params['toptab'],$params['group']);
75 function searchBox() {
76 global $Language,$words,$forum_id,$group_id,$group_project_id,$atid,$exact,$type_of_search;
78 // if there is no search currently, set the default
79 if ( ! isset($type_of_search) ) {
84 <form action="/search/" method="post">
85 <select name="type_of_search">';
86 if ($atid && $group_id) {
87 $group =& group_get_object($group_id);
88 if ($group && is_object($group)) {
89 $ath = new ArtifactTypeHtml($group,$atid);
90 if ($ath && is_object($ath)) {
92 <option value="'.SEARCH__TYPE_IS_ARTIFACT.'"'.( $type_of_search == SEARCH__TYPE_IS_ARTIFACT ? ' selected="selected"' : '' ).'>'. $ath->getName() .'</option>';
95 } else if ($group_id && $forum_id) {
97 <option value="'.SEARCH__TYPE_IS_FORUM.'"'.( $type_of_search == SEARCH__TYPE_IS_FORUM ? ' selected="selected"' : '' ).'>'.$Language->getText('searchbox','forum').'</option>';
98 } else if ($group_id && $group_project_id) {
100 <option value="task"'. ( $type_of_search == 'tasks' ? ' selected="selected"' : '').'>'.$Language->getText('searchbox','task').'</option>';
104 <option value="'.SEARCH__TYPE_IS_SOFTWARE.'"'.( $type_of_search == SEARCH__TYPE_IS_SOFTWARE ? ' selected="selected"' : '' ).'>'.$Language->getText('searchbox','softwaregroup').'</option>';
106 <option value="'.SEARCH__TYPE_IS_SKILL.'"'.( $type_of_search == SEARCH__TYPE_IS_SKILL ? ' selected="selected"' : '' ).'>'.$Language->getText('searchbox','skill').'</option>';
108 <option value="'.SEARCH__TYPE_IS_PEOPLE.'"'.( $type_of_search == SEARCH__TYPE_IS_PEOPLE ? ' selected="selected"' : '' ).'>'.$Language->getText('searchbox','people').'</option>';
112 if ( isset($forum_id) ) {
114 <input type="hidden" value="'.$forum_id.'" name="forum_id" />';
116 if ( isset($group_id) ) {
118 <input type="hidden" value="'.$group_id.'" name="group_id" />';
120 if ( isset($atid) ) {
122 <input type="hidden" value="'.$atid.'" name="atid" />';
124 if ( isset($group_project_id) ){
126 <input type="hidden" value="'.$group_project_id.'" name="group_project_id" />';
129 <input type="text" size="12" name="words" value="'.$words.'" />';
130 print '<input type="submit" name="Search" value="'.$Language->getText('searchbox','search').'" />';
136 function footer($params) {
138 <!-- end main body row -->
139 <!-- PLEASE LEAVE "Powered By GForge" on your site -->
142 <a href="http://gforge.org/">Powered By GForge Collaborative Development Environment</a>
145 global $sys_show_source;
146 if ($sys_show_source) {
147 print '<a class="showsource" href="'.$GLOBALS['sys_urlprefix'].'/source.php?file=' . getStringFromServer('SCRIPT_NAME') . '">Show Source</a>';
158 * boxTop() - Top HTML box
160 * @param string Box title
162 function boxTop($title) {
163 return '<!-- boxTop --><br>'.$title.'<br>';
168 * boxMiddle() - Middle HTML box
170 * @param string Box title
172 function boxMiddle($title) {
173 return '<!-- boxMiddle --><br />'.$title.'<br />';
177 * boxBottom() - Bottom HTML box
179 * @param bool Whether to echo or return the results
181 function boxBottom() {
183 <!-- Box Bottom Start -->
185 <!-- Box Bottom End -->';
189 * listTableTop() - Takes an array of titles and builds the first row of a new table.
191 * @param array The array of titles
192 * @param array The array of title links
194 function listTableTop ($title_arr,$links_arr=false) {
196 <!-- listTableTop -->
201 $count=count($title_arr);
203 for ($i=0; $i<$count; $i++) {
205 <td align="left"><a href="'.$links_arr[$i].'">'.$title_arr[$i].'</a></td>';
208 for ($i=0; $i<$count; $i++) {
210 <td align="left">'.$title_arr[$i].'</td>';
216 <td colspan="'.$count.'" height="1"></td>
221 function listTableBottom() {
222 return '</table></td>
223 <!-- <td valign="top" align="right" width="10"></td> -->
230 * boxGetAltRowStyle() - Get an alternating row style for tables
232 * @param int Row number
234 function boxGetAltRowStyle($i) {
238 function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='WHITE',$total_width='100%') {
239 $count=count($TABS_DIRS);
241 <form name="menuForm" method="POST" action="/">
242 <select name="menuList">';
243 for ($i=0; $i<$count; $i++) {
245 <option '. (($selected==$i)?'selected':'').' value="'.$TABS_DIRS[$i].'"> '.$TABS_TITLES[$i].'</option>';
247 $return .= '</select>
248 <input type="hidden" name="selectmenu" value="yes">
249 <input type="submit" value="GO"></form>