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']);
20 if (!$params['title']) {
21 $params['title'] = "$sys_name";
23 $params['title'] = "$sys_name: " . $params['title'];
25 print '<?xml version="1.0" encoding="utf-8"';
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="<?php echo _('en') ?>" lang="<?php echo _('en') ?>">
32 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
33 <title><?php echo $params['title']; ?></title>
38 <?php echo util_make_link ('/',_('Home')); ?></h2></a>
42 if (session_loggedin()) {
44 <b><?php echo util_make_link ('/account/logout.php',_('Log Out')); ?></b>
45 <b><?php echo util_make_link ('/account/',_('My Account')); ?></b>
49 <b><?php echo util_make_link ('/account/login.php',_('Log In')); ?></b>
50 <b><?php echo util_make_link ('/account/register.php',_('New Account')); ?></b>
53 $params['template'] = '<b>{menu}</b>';
54 plugin_hook ('headermenu', $params);
59 <?php echo $this->searchBox(); ?>
63 <?php echo $this->outerTabs($params); ?>
65 if (isset($params['group']) && $params['group']) {
68 echo $this->projectTabs($params['toptab'],$params['group']);
77 function searchBox() {
78 global $words,$forum_id,$group_id,$group_project_id,$atid,$exact,$type_of_search;
80 // if there is no search currently, set the default
81 if ( ! isset($type_of_search) ) {
86 <form action="/search/" method="post">
87 <select name="type_of_search">';
88 if ($atid && $group_id) {
89 $group =& group_get_object($group_id);
90 if ($group && is_object($group)) {
91 $ath = new ArtifactTypeHtml($group,$atid);
92 if ($ath && is_object($ath)) {
94 <option value="'.SEARCH__TYPE_IS_ARTIFACT.'"'.( $type_of_search == SEARCH__TYPE_IS_ARTIFACT ? ' selected="selected"' : '' ).'>'. $ath->getName() .'</option>';
97 } else if ($group_id && $forum_id) {
99 <option value="'.SEARCH__TYPE_IS_FORUM.'"'.( $type_of_search == SEARCH__TYPE_IS_FORUM ? ' selected="selected"' : '' ).'>'._('This forum').'</option>';
100 } else if ($group_id && $group_project_id) {
102 <option value="task"'. ( $type_of_search == 'tasks' ? ' selected="selected"' : '').'>'._('Tasks').'</option>';
106 <option value="'.SEARCH__TYPE_IS_SOFTWARE.'"'.( $type_of_search == SEARCH__TYPE_IS_SOFTWARE ? ' selected="selected"' : '' ).'>'._('Software/Group').'</option>';
108 <option value="'.SEARCH__TYPE_IS_SKILL.'"'.( $type_of_search == SEARCH__TYPE_IS_SKILL ? ' selected="selected"' : '' ).'>'._('Skill').'</option>';
110 <option value="'.SEARCH__TYPE_IS_PEOPLE.'"'.( $type_of_search == SEARCH__TYPE_IS_PEOPLE ? ' selected="selected"' : '' ).'>'._('People').'</option>';
114 if ( isset($forum_id) ) {
116 <input type="hidden" value="'.$forum_id.'" name="forum_id" />';
118 if ( isset($group_id) ) {
120 <input type="hidden" value="'.$group_id.'" name="group_id" />';
122 if ( isset($atid) ) {
124 <input type="hidden" value="'.$atid.'" name="atid" />';
126 if ( isset($group_project_id) ){
128 <input type="hidden" value="'.$group_project_id.'" name="group_project_id" />';
131 <input type="text" size="12" name="words" value="'.$words.'" />';
132 print '<input type="submit" name="Search" value="'._('Search').'" />';
138 function footer($params) {
140 <!-- end main body row -->
141 <!-- PLEASE LEAVE "Powered By GForge" on your site -->
144 <a href="http://gforge.org/">Powered By GForge Collaborative Development Environment</a>
147 global $sys_show_source;
148 if ($sys_show_source) {
149 echo util_make_link ('/source.php?file='.getStringFromServer('SCRIPT_NAME'),_('Show Source'),array('class'=>'showsource'));
160 * boxTop() - Top HTML box
162 * @param string Box title
164 function boxTop($title) {
165 return '<!-- boxTop --><br>'.$title.'<br>';
170 * boxMiddle() - Middle HTML box
172 * @param string Box title
174 function boxMiddle($title) {
175 return '<!-- boxMiddle --><br />'.$title.'<br />';
179 * boxBottom() - Bottom HTML box
181 * @param bool Whether to echo or return the results
183 function boxBottom() {
185 <!-- Box Bottom Start -->
187 <!-- Box Bottom End -->';
191 * listTableTop() - Takes an array of titles and builds the first row of a new table.
193 * @param array The array of titles
194 * @param array The array of title links
196 function listTableTop ($title_arr,$links_arr=false) {
198 <!-- listTableTop -->
203 $count=count($title_arr);
205 for ($i=0; $i<$count; $i++) {
207 <td align="left"><a href="'.$links_arr[$i].'">'.$title_arr[$i].'</a></td>';
210 for ($i=0; $i<$count; $i++) {
212 <td align="left">'.$title_arr[$i].'</td>';
218 <td colspan="'.$count.'" height="1"></td>
223 function listTableBottom() {
224 return '</table></td>
225 <!-- <td valign="top" align="right" width="10"></td> -->
232 * boxGetAltRowStyle() - Get an alternating row style for tables
234 * @param int Row number
236 function boxGetAltRowStyle($i) {
240 function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='WHITE',$total_width='100%') {
241 $count=count($TABS_DIRS);
243 <form name="menuForm" method="POST" action="/">
244 <select name="menuList">';
245 for ($i=0; $i<$count; $i++) {
247 <option '. (($selected==$i)?'selected':'').' value="'.$TABS_DIRS[$i].'"> '.$TABS_TITLES[$i].'</option>';
249 $return .= '</select>
250 <input type="hidden" name="selectmenu" value="yes">
251 <input type="submit" value="GO"></form>
260 // c-file-style: "bsd"