2 header("Content-Type: text/html; charser=utf-8");
4 #-------------------------------------------------------
6 #-------------------------------------------------------
7 # Complete real path to this file
8 $file = realpath(__FILE__);
10 # Complete real path of glabels root directory
11 $root_dir = dirname($file);
13 # Server document root
14 $htroot = getenv("DOCUMENT_ROOT");
16 # Base URL of the glabels website
17 if ( strncmp($root_dir,$htroot,strlen($htroot)) == 0 ) {
18 $root = substr($root_dir,strlen($htroot));
23 #-------------------------------------------------------
25 #-------------------------------------------------------
26 function print_globals()
28 global $file, $root_dir, $htroot, $root;
30 print "file = \"$file\"<br>";
31 print "root_dir = \"$root_dir\"<br>";
32 print "htroot = \"$htroot\"<br>";
33 print "root = \"$root\"<br>";
36 #-------------------------------------------------------
38 #-------------------------------------------------------
46 #-------------------------------------------------------
47 # Construct and print img tag
48 #-------------------------------------------------------
49 function img($src, $alt)
54 if (substr($src,0,1) == "/") {
55 $size = GetImageSize("$root_dir$src");
56 print "<img src=\"$root$src\" $size[3] alt=\"$alt\" />";
58 $size = GetImageSize("$src");
59 print "<img src=\"$src\" $size[3] alt=\"$alt\" />";
63 #-------------------------------------------------------
64 # Construct and print img tag with explicit size, NULL alt
65 #-------------------------------------------------------
66 function img_size($src, $w, $h)
72 if (substr($src,0,1) == "/") {
73 print "<img src=\"$root$src\" width=\"$w\" height=\"$h\" alt=\"$alt\" />";
75 print "<img src=\"$src\" width=\"$w\" height=\"$h\" alt=\"$alt\" />";
79 #-------------------------------------------------------
80 # Construct and print link (a) tag
81 #-------------------------------------------------------
82 function a($href, $text)
86 if (substr($href,0,1) == "/") {
87 print "<a href=\"$root$href\">$text</a>";
89 print "<a href=\"$href\">$text</a>";
93 #-------------------------------------------------------
94 # Construct and print link (a) tag to a downloadable file
95 #-------------------------------------------------------
96 function a_file($href)
100 $text = basename($href);
102 if (substr($href,0,1) == "/") {
103 print "<a href=\"$root$href\">$text</a>";
105 print "<a href=\"$href\">$text</a>";
109 #-------------------------------------------------------
110 # Construct and print link (a) tag to a sf dl file
111 #-------------------------------------------------------
112 function a_sfdownload($file)
114 print "<a href=\"http://downloads.sourceforge.net/glabels/$file\">$file</a>";
117 #-------------------------------------------------------
118 # Construct and print link (a) tag to a web address
119 #-------------------------------------------------------
120 function a_host($host)
124 print "<a href=\"http://$host/\">$host</a>";
127 #-------------------------------------------------------
128 # Construct and print mailto (a) tag
129 #-------------------------------------------------------
130 function a_mailto($email)
132 print "<a href=\"mailto:$email\">$email</a>";
135 #-------------------------------------------------------
136 # Common Header and navigation
137 #-------------------------------------------------------
138 function gLabelsHeader($tab)
142 $tabs["$root/"] = "home";
143 $tabs["$root/news/"] = "news";
144 $tabs["$root/screenshots/"] = "screenshots";
145 $tabs["$root/download/"] = "download";
146 $tabs["$root/doc/"] = "docs";
147 $tabs["$root/faq/"] = "FAQ";
148 $tabs["$root/contact/"] = "contact";
149 $tabs["$root/links/"] = "links";
151 print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
154 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
155 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
157 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
159 <meta name="description" content="gLabels: a label and business card program for GNOME" />
160 <meta name="keywords" content="glabels, snaught, label, business card, gnome, linux" />
162 <title>gLabels</title>
164 <link rel="stylesheet" href="<?root();?>/css/glabels.css" type="text/css" />
170 <div id="title"> </div>
174 <!-- Navigation tabs -->
183 while (list($key,$value) = each($tabs))
185 $value = trim($value);
186 if (strlen($value) >= 8) {$width=90;} else {$width=60;}
189 print "\t\t\t<li><span>$tab</span></li>\n";
193 print "\t\t\t<li><a href=\"$key\">$value</a></li>\n";
203 <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>
209 <div class="tlcorner"> </div>
210 <div class="trcorner"> </div>
221 #-------------------------------------------------------
223 #-------------------------------------------------------
224 function gLabelsFooter()
230 <div class="blcorner"> </div>
231 <div class="brcorner"> </div>
234 <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>
237 <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>
238 <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>