5 * Copyright (c) 2002-2003 Richard Offer. All rights reserved.
7 * Permission to use, copy, modify, distribute, and sell this software and its
8 * documentation for any purpose is hereby granted without fee, provided that
9 * the above copyright notice appear in all copies and that both that
10 * copyright notice and this permission notice appear in supporting
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 * Except as contained in this notice, the name of the author shall not be
24 * used in advertising or otherwise to promote the sale, use or other dealings
25 * in this Software without prior written authorization from the author.
28 * Based on the "debian" theme, which is apparantly :-
29 * Copyright 1999-2001 (c) VA Linux Systems
34 class Theme extends Layout {
38 * Theme() - Constructor
49 * header() - "steel theme" top of page
51 * @param array Header parameters array
53 function header($params) {
54 global $Language, $sys_name;
56 $this->headerStart($params); ?>
58 <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['sys_urlprefix']; ?>/themes/osx/css/theme.css" />
61 <table border="0" width="100%" cellspacing="0" cellpadding="0">
64 <td><a href="<?php echo $GLOBALS['sys_urlprefix']; ?>/"
65 onmouseover="imgOver('logo')"
66 onmouseout="imgOff('logo')"><img name="logo" border="0" height="60" width="180"
67 src="<?php echo $this->imgroot.'logo.png'; ?>" alt="GForge Logo" /></a></td>
68 <td><?php echo $this->searchBox(); ?></td>
69 <td align="right"><?php
70 if (session_loggedin()) {
72 <b><a href="<?php echo $GLOBALS['sys_urlprefix']; ?>/account/logout.php"><?php echo _('Log Out'); ?></a></b><br />
73 <b><a href="<?php echo $GLOBALS['sys_urlprefix']; ?>/account/"><?php echo _('My Account'); ?></a></b>
77 <b><a href="<?php echo $GLOBALS['sys_urlprefix']; ?>/account/login.php"><?php echo _('Log In'); ?></a></b><br />
78 <b><a href="<?php echo $GLOBALS['sys_urlprefix']; ?>/account/register.php"><?php echo _('New Account'); ?></a></b>
88 <table border="0" width="100%" cellspacing="0" cellpadding="0">
94 <?php echo $this->outerTabs($params); ?>
102 <td valign="top" width="99%" colspan="3">
103 <!-- Inner Tabs / Shell -->
105 <table border="0" width="100%" cellspacing="0" cellpadding="0">
109 if ($params['group']) {
117 echo $this->projectTabs($params['toptab'],$params['group']);
130 src="<?php echo $this->imgroot; ?>clear.png" width="99%" height="10" alt="" /></td>
135 src="<?php echo $this->imgroot; ?>clear.png" width="10" height="1" alt="" /></td>
136 <td valign="top" width="99%">
140 function footer($params) {
144 <!-- end main body row -->
149 src="<?php echo $this->imgroot; ?>clear.png" width="2" height="1" alt="" /></td>
153 src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td>
157 <!-- end inner body row -->
160 <td width="10"><img src="<?php echo $this->imgroot; ?>clear.png" width="2" height="1" alt="" /></td>
163 <!-- some extra space to make it look nicer -->
164 <td height="100"> </td>
168 echo $this->footerEnd($params);
174 * boxTop() - Top HTML box
176 * @param string Box title
177 * @param bool Whether to echo or return the results
178 * @param string The box background color
180 function boxTop($title) {
183 <table cellspacing="2" cellpadding="0" width="100%" border="0">
186 <table cellspacing="2" cellpadding="0" width="100%" border="0" >
188 <td colspan="2"><span class="titlebar">'.$title.'</span></td>
190 <tr align="left" bgcolor="'. $this->COLOR_HTMLBOX_BACK .'">
191 <td colspan="2" height="1"></td></tr><tr align="left"><td colspan="2">';
195 * boxMiddle() - Middle HTML box
197 * @param string Box title
198 * @param string The box background color
200 function boxMiddle($title) {
205 <tr><td height="20" colspan="2"> </td></tr>
207 <td colspan="2"><span class="titlebar">'.$title.'</span></td>
209 <tr align="left" bgcolor="'. $this->COLOR_HTMLBOX_BACK .'">
210 <td colspan="2" height="1"></td></tr><tr><td colspan="2">';
214 * boxGetAltRowStyle() - Get an alternating row style for tables
216 * @param int Row number
218 function boxGetAltRowStyle($i) {
221 return ' bgcolor="#FFFFFF"';
223 return ' bgcolor="' . $this->COLOR_LTBACK1 . '"';
225 return ' bgcolor="' . $this->COLOR_LTBACK2 . '"';
230 * boxBottom() - Bottom HTML box
232 * @param bool Whether to echo or return the results
234 function boxBottom() {
235 return '<!-- boxBottom -->
240 <tr><td height="20" colspan="2"> </td></tr>
245 * listTableTop() - Takes an array of titles and builds the first row of a new table.
247 * @param array The array of titles
248 * @param array The array of title links
250 function listTableTop ($title_arr,$links_arr=false) {
252 <!-- listTableTop -->
253 <table cellspacing="0" cellpadding="1" width="100%" border="0">
255 <table width="100%" border="0" cellspacing="2" cellpadding="0">
258 $count=count($title_arr);
260 for ($i=0; $i<$count; $i++) {
262 <td align="left"><a class="titlebar" href="'.$links_arr[$i].'">'.$title_arr[$i].'</a></td>';
265 for ($i=0; $i<$count; $i++) {
267 <td align="left">'.$title_arr[$i].'</td>';
272 <tr align="left" bgcolor="'. $this->COLOR_HTMLBOX_BACK .'">
273 <td colspan="'.$count.'" height="1"><img src="'.$this->imgroot.'clear.png" height="1" width="1" alt="" /></td>
278 function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='WHITE',$total_width='100%') {
280 $deselect_tab='style="background-image: url('.$this->imgroot.'tabs/deselect.png);"';
281 $select_tab='style="background-image: url('.$this->imgroot.'tabs/select.png);"';
282 $deselect_rule='style="background-image: url('.$this->imgroot.'tabs/ruledeselect.png);"';
283 $select_rule='style="background-image: url('.$this->imgroot.'tabs/ruleselect.png);"';
285 $count=count($TABS_DIRS);
286 $width=intval((100/($count+1)));
287 $space=intval($width/2);
290 <!-- tabGenerator -->
292 <table border="0" cellpadding="0" cellspacing="0" width="'.$total_width.'">
294 <td><img src="'.$this->imgroot.'clear.png" height="'.$this->TAB_HEIGHT.'" width="'.$space.'%" alt="" /></td>';
300 for ($i=0; $i<$count; $i++) {
301 $TABS_TITLES[$i] = preg_replace("/ +/", " ", $TABS_TITLES[$i]);
302 $bgimg=(($selected==$i)?$select_tab:$deselect_tab);
303 $cornerimg=(($selected==$i)?'select':'deselect');
305 <td height="'.$this->TAB_HEIGHT.'" width="5"
306 style="background-image: url('.$this->imgroot.'tabs/left'.$cornerimg.'.png);"></td>
307 <td '.$bgimg.' height="'.$this->TAB_HEIGHT.'" width="'.$width.'%" align="center">'.
308 '<a class="'. (($selected==$i)?'tabsellink':'tablink') .'" href="'. $TABS_DIRS[$i] .'">'. $TABS_TITLES[$i] .'</a></td>
309 <td height="'.$this->TAB_HEIGHT.'" width="5"
310 style="background-image: url('.$this->imgroot.'tabs/right'.$cornerimg.'.png);"></td>';
314 <td><img src="'.$this->imgroot.'clear.png" height="'.$this->TAB_HEIGHT.'" width="'.$space.'%" alt="" /></td>
317 <td style="background-image: url('.$this->imgroot.'tabs/ruleselect.png);" align="center"><img
318 src="'.$this->imgroot.'clear.png" height="8" width="'.$space.'%" alt="" /></td>';
319 for ($i=0; $i<$count; $i++) {
320 $bgimg=(($selected==$i)?$select_rule:$deselect_rule);
321 $blendimg=(($selected==$i)?'select':'deselect');
323 <td style="background-image: url('.$this->imgroot.'tabs/leftblend'.$blendimg.'.png);"><img
324 src="'.$this->imgroot . 'clear.png" height="8" width="5" alt="" /></td>
325 <td '.$bgimg.' width="'.$width.'%" align="center"><img
326 src="'.$this->imgroot . 'clear.png" height="8" width="1" alt="" /></td>
327 <td style="background-image: url('.$this->imgroot.'tabs/rightblend'.$blendimg.'.png);"><img
328 src="'.$this->imgroot . 'clear.png" height="8" width="5" alt="" /></td>';
332 <td style="background-image: url('.$this->imgroot.'tabs/ruleselect.png);" align="center"><img
333 src="'.$this->imgroot.'clear.png" height="8" width="'.$space.'%" alt="" /></td>
335 <tr><td height="10"> </td></tr>
337 <!-- end tabGenerator -->';
341 * multiTableRow() - create a mutlilevel row in a table
343 * @param string the row attributes
344 * @param array the array of cell data, each element is an array,
345 * the first item being the text,
346 * the subsequent items are attributes
347 * @param boolean is this row part of the title ?
350 function multiTableRow($row_attr, $cell_data, $istitle) {
352 <!-- multiTableRow -->
355 $return .=' align="center" ';
358 for ( $c = 0; $c < count($cell_data); $c++ ) {
360 for ( $a=1; $a < count($cell_data[$c]); $a++) {
361 $return .= $cell_data[$c][$a].' ';
365 $return .='<span class="titlebar">';
367 $return .= $cell_data[$c][0];
375 <!-- end multiTableRow -->