4 // Copyright 1999-2000 (c) The SourceForge Crew
6 // This is a modified version made by the Savannah Project
7 // Copyright 2000-2001 (c) Free Software Foundation
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License
11 // as published by the Free Software Foundation; either version 2
12 // of the License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 // http://sourceforge.net
31 Extends the basic Error class to add HTML functions for displaying all site dependent HTML, while allowing extendibility/overriding by themes via the Theme class.
33 Make sure browser.php is included _before_ you create an instance of this object.
35 Geoffrey Herteg, August 29, 2000
39 class Theme extends Layout {
49 // The root location for images
50 $this->imgroot = "themes/THEMENAME/images/";
51 $this->imgproj = "themes/THEMENAME/images/";
53 //Define all the icons for this theme
54 $this->icons = array('Summary' => 'ic/anvil24.png',
55 'Homepage' => 'ic/home.png',
56 'Forums' => 'ic/notes.png',
57 'Bugs' => 'ic/bug.png',
58 'Support' => 'ic/support.png',
59 'Patches' => 'ic/patch.png',
60 'Lists' => 'ic/mail.png',
61 'Tasks' => 'ic/index.png',
62 'Docs' => 'ic/docman.png',
63 'Surveys' => 'ic/survey.png',
64 'News' => 'ic/news.png',
65 'CVS' => 'ic/convert.png',
66 'Files' => 'ic/save.png'
69 $this->bgpri = array();
72 Set up the priority color array one time only
85 // Box Top, equivalent to html_box1_top()
86 function box1_top($title,$echoout=1,$bgcolor=''){
87 $return = '<table summary="" class="boxtable">
89 <td colspan="2" class="boxtitle">'.$title.'</td>
92 <td colspan="2" class="boxitem">';
100 // Box Middle, equivalent to html_box1_middle()
101 function box1_middle($title,$bgcolor='') {
106 <td colspan="2" class="boxtitle">'.$title.'</td>
109 <td colspan=2 class="boxitem">';
112 // Get an alternating row style for tables.
113 function box1_get_alt_row_style($i) {
115 return 'class=boxitem';
117 return 'class=boxitemalt';
121 // Box Bottom, equivalent to html_box1_bottom()
122 function box1_bottom($echoout=1) {
135 // generic_header_start() - Start a generic HTML header
136 function generic_header_start($params) {
138 global $G_SESSION, $Language, $sys_name;
140 if (!$params['title']) {
141 $params['title'] = $GLOBALS['sys_name'];
143 $params['title'] = $GLOBALS['sys_name'].": " . $params['title'];
146 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
147 "http://www.w3.org/TR/REC-html40/loose.dtd">
149 <!-- Server: <?php echo $sys_name; ?> -->
150 <html lang="<?php echo $Language->getLanguageCode(); ?>">
152 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Language->getEncoding(); ?>">
153 <TITLE><?php echo $params['title']; ?></TITLE>
154 <SCRIPT language="JavaScript">
156 function help_window(helpurl) {
157 HelpWin = window.open( '<?php echo ((session_issecure()) ? 'https://'.$GLOBALS['sys_default_domain'] : 'http://'.$GLOBALS['sys_default_domain'] ); ?>' + helpurl,'HelpWindow','scrollbars=yes,resizable=yes,toolbar=no,height=400,width=400');
161 <meta name="Author" content="Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved">
162 <meta name="Keywords" content="Savannah,GNU, FSF, Free Software Foundation, Linux, Emacs, GCC, Unix, Free Software, Operating System, GNU Kernel, HURD, GNU HURD, SourceForge">
163 <meta name="Description" content="Savannah is a central point for development, distribution and maintainance of Free Software. It allows contributors to easily join existing Free Software projects.">
165 // 2002-04-15 yeupou@coleumes.org
166 // NOW we stop to use favico.ico read http://bugzilla.mozilla.org/show_bug.cgi?id=110296
168 <link rel="stylesheet" type="text/css" href="/themes/THEMENAME/debiansf.css">
169 <link rel="icon" type="image/png" href="/images/debian-sf-icon.png">
173 function generic_header_end($params) {
179 function generic_footer($params) {
181 global $IS_DEBUG,$QUERY_COUNT,$Language;
182 if ($IS_DEBUG && user_ismember(1,'A')) {
183 echo "<CENTER><B><FONT COLOR=RED>Query Count: $QUERY_COUNT</FONT
185 echo "<P>$GLOBALS[G_DEBUGQUERY]";
189 Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA
191 Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
194 <span class="center">
195 <? echo $Language->getText('general', 'footer'); ?>
203 function header($params) {
204 $this->generic_header_start($params);
207 $site_fonts='helvetica,sans-serif';
209 $this->generic_header_end($params);
215 <!-- start page body -->
216 <table summary="" class="standardtable">
219 <!-- start main body cell -->
221 <table summary="" class="standardtable">
223 <td class="menutable">
226 if (!session_issecure()) {
227 //print '<IMG src="/images/clear.png" width=140 height=1 alt="Counter"><BR>';
229 //print html_blankimage(1,140) . '<br>';
233 <a href="/"><?php print html_image($this->imgroot . "floating.png",'150','130',array('alt'=>'Floating GNU')); ?></a>
237 menu_print_sidebar($params);
242 <td class="contenttable">
247 function footer($params) {
256 <!-- themed page footer -->
258 $this->generic_footer($params);
263 function menuhtml_top($title) {
265 Use only for the top most menu
268 <table summary="" class="menutable">
270 <td class="menutitle"><?php echo $title; ?><br></td>
273 <td class="menuitem">
278 function menuhtml_bottom() {
290 function menu_entry($link, $title) {
291 print "\t".'<a href="'.$link.'">'.$title.'</a> ';
292 print html_image($this->imgroot . "point.png",'7','7',array('alt'=>' > '));
293 print ' <br>';
296 /*! @function tab_entry
297 @abstract Prints out the a themed tab, used by project_tabs
298 @param $url is the URL to link to
299 $icon is the image to use (if the theme uses it)
300 $title is the title to use in the link tags
301 $selected is a boolean to test if the tab is 'selected'
302 @result text - echos HTML to the screen directly
304 function tab_entry($url='http://localhost/', $icon='', $title='Home', $selected=0) {
308 print 'class=tabselect ';
312 print 'href="'. $url .'">' . $title . '</A> | ';