2 header("Content-Type: text/html; charset=utf-8");
3 print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
7 #-------------------------------------------------------
9 #-------------------------------------------------------
10 # Complete real path to this file
11 $file = realpath(__FILE__);
13 # Complete real path of glabels root directory
14 $root_dir = dirname($file);
16 # Server document root
17 $htroot = getenv("DOCUMENT_ROOT");
19 # Base URL of the glabels website
20 if ( strncmp($root_dir,$htroot,strlen($htroot)) == 0 ) {
21 $root = substr($root_dir,strlen($htroot));
26 #-------------------------------------------------------
28 #-------------------------------------------------------
29 function print_globals()
31 global $file, $root_dir, $htroot, $root;
33 print "file = \"$file\"<br>";
34 print "root_dir = \"$root_dir\"<br>";
35 print "htroot = \"$htroot\"<br>";
36 print "root = \"$root\"<br>";
39 #-------------------------------------------------------
41 #-------------------------------------------------------
49 #-------------------------------------------------------
50 # Construct and print img tag
51 #-------------------------------------------------------
52 function img($src, $alt)
57 if (substr($src,0,1) == "/") {
58 $size = GetImageSize("$root_dir$src");
59 print "<img src=\"$root$src\" $size[3] alt=\"$alt\" />";
61 $size = GetImageSize("$src");
62 print "<img src=\"$src\" $size[3] alt=\"$alt\" />";
66 #-------------------------------------------------------
67 # Construct and print img tag with explicit size, NULL alt
68 #-------------------------------------------------------
69 function img_size($src, $w, $h)
75 if (substr($src,0,1) == "/") {
76 print "<img src=\"$root$src\" width=\"$w\" height=\"$h\" alt=\"$alt\" />";
78 print "<img src=\"$src\" width=\"$w\" height=\"$h\" alt=\"$alt\" />";
82 #-------------------------------------------------------
83 # Construct and print link (a) tag
84 #-------------------------------------------------------
85 function a($href, $text)
89 if (substr($href,0,1) == "/") {
90 print "<a href=\"$root$href\">$text</a>";
92 print "<a href=\"$href\">$text</a>";
96 #-------------------------------------------------------
97 # Construct and print link (a) tag to a downloadable file
98 #-------------------------------------------------------
99 function a_file($href)
103 $text = basename($href);
105 if (substr($href,0,1) == "/") {
106 print "<a href=\"$root$href\">$text</a>";
108 print "<a href=\"$href\">$text</a>";
112 #-------------------------------------------------------
113 # Construct and print link (a) tag to a sf dl file
114 #-------------------------------------------------------
115 function a_sfdownload($file)
117 print "<a href=\"http://downloads.sourceforge.net/glabels/$file\">$file</a>";
120 #-------------------------------------------------------
121 # Construct and print link (a) tag to a web address
122 #-------------------------------------------------------
123 function a_host($host)
127 print "<a href=\"http://$host/\">$host</a>";
130 #-------------------------------------------------------
131 # Construct and print mailto (a) tag
132 #-------------------------------------------------------
133 function a_mailto($email)
135 print "<a href=\"mailto:$email\">$email</a>";
138 #-------------------------------------------------------
139 # Common Header and navigation
140 #-------------------------------------------------------
141 function gLabelsHeader($tab)
145 $tabs["$root/"] = "home";
146 $tabs["$root/news/"] = "news";
147 $tabs["$root/screenshots/"] = "screenshots";
148 $tabs["$root/download/"] = "download";
149 $tabs["$root/doc/"] = "docs";
150 $tabs["$root/faq/"] = "FAQ";
151 $tabs["$root/contact/"] = "contact";
152 $tabs["$root/links/"] = "links";
156 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
157 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
159 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
161 <meta name="description" content="gLabels: a label and business card program for GNOME" />
162 <meta name="keywords" content="glabels, snaught, label, business card, gnome, linux" />
164 <title>gLabels</title>
166 <link rel="stylesheet" href="<?root();?>/css/glabels.css" type="text/css" />
172 <div id="title"> </div>
176 <!-- Navigation tabs -->
185 while (list($key,$value) = each($tabs))
187 $value = trim($value);
188 if (strlen($value) >= 8) {$width=90;} else {$width=60;}
191 print "\t\t\t<li><span>$tab</span></li>\n";
195 print "\t\t\t<li><a href=\"$key\">$value</a></li>\n";
205 <a href="http://sourceforge.net"><img class="noborder" src="http://sourceforge.net/sflogo.php?group_id=46122&type=2" width="125" height="37" alt="SourceForge Logo" /></a>
211 <div class="tlcorner"> </div>
212 <div class="trcorner"> </div>
223 #-------------------------------------------------------
225 #-------------------------------------------------------
226 function gLabelsFooter()
232 <div class="blcorner"> </div>
233 <div class="brcorner"> </div>
236 <div id="copy">* Section header icons on this website borrowed from the <a href="http://tango.freedesktop.org">Tango</a> project. (<a href="http://creativecommons.org/licenses/by-sa/2.5/">License</a>)</div>
239 <a href="http://validator.w3.org/check/referer"><img class="noborder" src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid XHTML 1.1!" height="31" width="88" /></a>
240 <a href="http://jigsaw.w3.org/css-validator/"><img class="noborder" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" /></a>