3 class Theme extends Layout {
5 * Theme() - Constructor
11 * header() - "steel theme" top of page
13 * @param array Header parameters array
15 function header($params) {
16 if (isset($_POST['selectmenu']) && ($_POST['selectmenu'] == "yes"))
18 header("Location:".$_POST['menuList']);
20 if (!$params['title']) {
21 $params['title'] = forge_get_config ('forge_name');
23 $params['title'] = forge_get_config ('forge_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>
34 <?php $this->headerLink(); ?>
39 <?php echo util_make_link ('/',_('Home')); ?></h2></a>
43 if (session_loggedin()) {
45 <b><?php echo util_make_link ('/account/logout.php',_('Log Out')); ?></b>
46 <b><?php echo util_make_link ('/account/',_('My Account')); ?></b>
50 <b><?php echo util_make_link ('/account/login.php',_('Log In')); ?></b>
51 <b><?php echo util_make_link ('/account/register.php',_('New Account')); ?></b>
54 $params['template'] = '<b>{menu}</b>';
55 plugin_hook ('headermenu', $params);
60 <?php echo $this->searchBox(); ?>
64 <?php echo $this->outerTabs($params); ?>
66 if (isset($params['group']) && $params['group']) {
69 echo $this->projectTabs($params['toptab'],$params['group']);
78 function searchBox() {
79 global $words,$forum_id,$group_id,$group_project_id,$atid,$exact,$type_of_search;
81 // if there is no search currently, set the default
82 if ( ! isset($type_of_search) ) {
87 <form action="/search/" method="post">
88 <select name="type_of_search">';
89 if ($atid && $group_id) {
90 $group =& group_get_object($group_id);
91 if ($group && is_object($group)) {
92 $ath = new ArtifactTypeHtml($group,$atid);
93 if ($ath && is_object($ath)) {
95 <option value="'.SEARCH__TYPE_IS_ARTIFACT.'"'.( $type_of_search == SEARCH__TYPE_IS_ARTIFACT ? ' selected="selected"' : '' ).'>'. $ath->getName() .'</option>';
98 } else if ($group_id && $forum_id) {
100 <option value="'.SEARCH__TYPE_IS_FORUM.'"'.( $type_of_search == SEARCH__TYPE_IS_FORUM ? ' selected="selected"' : '' ).'>'._('This forum').'</option>';
101 } else if ($group_id && $group_project_id) {
103 <option value="task"'. ( $type_of_search == 'tasks' ? ' selected="selected"' : '').'>'._('Tasks').'</option>';
107 <option value="'.SEARCH__TYPE_IS_SOFTWARE.'"'.( $type_of_search == SEARCH__TYPE_IS_SOFTWARE ? ' selected="selected"' : '' ).'>'._('Project').'</option>';
109 <option value="'.SEARCH__TYPE_IS_SKILL.'"'.( $type_of_search == SEARCH__TYPE_IS_SKILL ? ' selected="selected"' : '' ).'>'._('Skill').'</option>';
111 <option value="'.SEARCH__TYPE_IS_PEOPLE.'"'.( $type_of_search == SEARCH__TYPE_IS_PEOPLE ? ' selected="selected"' : '' ).'>'._('People').'</option>';
115 if ( isset($forum_id) ) {
117 <input type="hidden" value="'.$forum_id.'" name="forum_id" />';
119 if ( isset($group_id) ) {
121 <input type="hidden" value="'.$group_id.'" name="group_id" />';
123 if ( isset($atid) ) {
125 <input type="hidden" value="'.$atid.'" name="atid" />';
127 if ( isset($group_project_id) ){
129 <input type="hidden" value="'.$group_project_id.'" name="group_project_id" />';
132 <input type="text" size="12" name="words" value="'.$words.'" />';
133 print '<input type="submit" name="Search" value="'._('Search').'" />';
139 function footer($params) {
141 <!-- end main body row -->
142 <!-- PLEASE LEAVE "Powered By FusionForge" on your site -->
145 <a href="http://fusionforge.org/">Powered By FusionForge</a><br />
149 if (forge_get_config('show_source')) {
150 echo util_make_link ('/source.php?file='.getStringFromServer('SCRIPT_NAME'),_('Show Source'),array('class'=>'showsource'));
161 * boxTop() - Top HTML box
163 * @param string Box title
165 function boxTop($title) {
166 return '<!-- boxTop --><br />'.$title.'<br />';
171 * boxMiddle() - Middle HTML box
173 * @param string Box title
175 function boxMiddle($title) {
176 return '<!-- boxMiddle --><br />'.$title.'<br />';
180 * boxBottom() - Bottom HTML box
182 * @param bool Whether to echo or return the results
184 function boxBottom() {
186 <!-- Box Bottom Start -->
188 <!-- Box Bottom End -->';
192 * listTableTop() - Takes an array of titles and builds the first row of a new table.
194 * @param array The array of titles
195 * @param array The array of title links
197 function listTableTop ($title_arr,$links_arr=false) {
199 <!-- listTableTop -->
204 $count=count($title_arr);
206 for ($i=0; $i<$count; $i++) {
208 <td align="left"><a href="'.$links_arr[$i].'">'.$title_arr[$i].'</a></td>';
211 for ($i=0; $i<$count; $i++) {
213 <td align="left">'.$title_arr[$i].'</td>';
219 <td colspan="'.$count.'" height="1"></td>
224 function listTableBottom() {
225 return '</table></td>
226 <!-- <td valign="top" align="right" width="10"></td> -->
233 * boxGetAltRowStyle() - Get an alternating row style for tables
235 * @param int Row number
237 function boxGetAltRowStyle($i) {
241 function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='WHITE',$total_width='100%') {
242 $count=count($TABS_DIRS);
244 <form name="menuForm" method="post" action="/">
245 <select name="menuList">';
246 for ($i=0; $i<$count; $i++) {
248 <option '. (($selected==$i)?'selected':'').' value="'.$TABS_DIRS[$i].'"> '.$TABS_TITLES[$i].'</option>';
250 $return .= '</select>
251 <input type="hidden" name="selectmenu" value="yes">
252 <input type="submit" value="GO"></form>
261 // c-file-style: "bsd"