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
29 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.
31 Make sure browser.php is included _before_ you create an instance of this object.
33 Geoffrey Herteg, August 29, 2000
37 class Theme extends Layout {
47 // The root location for images
48 $this->imgroot = "themes/THEMENAME/images/";
49 $this->imgproj = "themes/THEMENAME/images/";
51 //Define all the icons for this theme
52 $this->icons = array('Summary' => 'ic/anvil24.png',
53 'Homepage' => 'ic/home.png',
54 'Forums' => 'ic/notes.png',
55 'Bugs' => 'ic/bug.png',
56 'Support' => 'ic/support.png',
57 'Patches' => 'ic/patch.png',
58 'Lists' => 'ic/mail.png',
59 'Tasks' => 'ic/index.png',
60 'Docs' => 'ic/docman.png',
61 'Surveys' => 'ic/survey.png',
62 'News' => 'ic/news.png',
63 'CVS' => 'ic/convert.png',
64 'Files' => 'ic/save.png'
67 $this->bgpri = array();
70 Set up the priority color array one time only
83 // Box Top, equivalent to html_box1_top()
84 function box1_top($title,$echoout=1,$bgcolor=''){
85 $return = '<table summary="" class="boxtable">
87 <td colspan="2" class="boxtitle">'.$title.'</td>
90 <td colspan="2" class="boxitem">';
98 // Box Middle, equivalent to html_box1_middle()
99 function box1_middle($title,$bgcolor='') {
104 <td colspan="2" class="boxtitle">'.$title.'</td>
107 <td colspan=2 class="boxitem">';
110 // Get an alternating row style for tables.
111 function box1_get_alt_row_style($i) {
113 return 'class=boxitem';
115 return 'class=boxitemalt';
119 // Box Bottom, equivalent to html_box1_bottom()
120 function box1_bottom($echoout=1) {
133 // generic_header_start() - Start a generic HTML header
134 function generic_header_start($params) {
136 global $G_SESSION, $sys_name;
138 if (!$params['title']) {
139 $params['title'] = $GLOBALS['sys_name'];
141 $params['title'] = $GLOBALS['sys_name'].": " . $params['title'];
144 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
145 "http://www.w3.org/TR/REC-html40/loose.dtd">
147 <!-- Server: <?php echo $sys_name; ?> -->
148 <html lang="<?php echo _('en') ?>">
150 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
151 <TITLE><?php echo $params['title']; ?></TITLE>
152 <SCRIPT language="JavaScript">
154 function help_window(helpurl) {
155 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');
159 <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">
160 <meta name="Keywords" content="Savannah,GNU, FSF, Free Software Foundation, Linux, Emacs, GCC, Unix, Free Software, Operating System, GNU Kernel, HURD, GNU HURD, SourceForge">
161 <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.">
163 // 2002-04-15 yeupou@coleumes.org
164 // NOW we stop to use favico.ico read http://bugzilla.mozilla.org/show_bug.cgi?id=110296
166 <link rel="stylesheet" type="text/css" href="/themes/THEMENAME/debiansf.css">
167 <link rel="icon" type="image/png" href="/images/debian-sf-icon.png">
171 function generic_header_end($params) {
177 function generic_footer($params) {
179 global $IS_DEBUG,$QUERY_COUNT;
180 if ($IS_DEBUG && user_ismember(1,'A')) {
181 echo "<CENTER><B><FONT COLOR=RED>Query Count: $QUERY_COUNT</FONT
183 echo "<P>$GLOBALS[G_DEBUGQUERY]";
187 Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA
189 Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
197 function header($params) {
198 $this->generic_header_start($params);
201 $site_fonts='helvetica,sans-serif';
203 $this->generic_header_end($params);
209 <!-- start page body -->
210 <table summary="" class="standardtable">
213 <!-- start main body cell -->
215 <table summary="" class="standardtable">
217 <td class="menutable">
220 if (!session_issecure()) {
221 //print '<IMG src="/images/clear.png" width=140 height=1 alt="Counter"><BR>';
223 //print html_blankimage(1,140) . '<br>';
227 <a href="/"><?php print html_image($this->imgroot . "floating.png",'150','130',array('alt'=>'Floating GNU')); ?></a>
231 menu_print_sidebar($params);
236 <td class="contenttable">
241 function footer($params) {
250 <!-- themed page footer -->
252 $this->generic_footer($params);
257 function menuhtml_top($title) {
259 Use only for the top most menu
262 <table summary="" class="menutable">
264 <td class="menutitle"><?php echo $title; ?><br></td>
267 <td class="menuitem">
272 function menuhtml_bottom() {
284 function menu_entry($link, $title) {
285 print "\t".'<a href="'.$link.'">'.$title.'</a> ';
286 print html_image($this->imgroot . "point.png",'7','7',array('alt'=>' > '));
287 print ' <br>';
290 /*! @function tab_entry
291 @abstract Prints out the a themed tab, used by project_tabs
292 @param $url is the URL to link to
293 $icon is the image to use (if the theme uses it)
294 $title is the title to use in the link tags
295 $selected is a boolean to test if the tab is 'selected'
296 @result text - echos HTML to the screen directly
298 function tab_entry($url='http://localhost/', $icon='', $title='Home', $selected=0) {
302 print 'class=tabselect ';
306 print 'href="'. $url .'">' . $title . '</A> | ';