summaryrefslogtreecommitdiff
path: root/template.php
blob: 6f9137d92a9bca1769a7f19bf92eec1cdee10947 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php

function print_page($title, $context, $heading, $content, $subtabs = array())
{
        // hnave values are as follow
        //  - the URL path (relative if possible)
        //  - the label as used in tabs and the navigation
        //  - (optional) the id of the tab it is under, this is for subsections
	$hnav = array( "summary" => array("/", "Home"),
			"home" => array("/", "Home"),
			"download" => array("/download/", "Download"),
			"planet" => array("http://planet.go-oo.org/", "Planet"),
			"developers" => array("/developers/", "Developers"),
			"users" => array("/users/", "Users"),
			"mgp" => array("/users/mgp", "Magicpoint"),
			"mailarchive" => array("/developers/mailarchive", 
                                               "Mail archive", "developers"),
			"about" => array("/about/", "About") 
			);
        // tabs state. the all have the "container" value
	// and the current one MUST have the "selected" value
	// this is all dependent on ths CSS used.
	$tabs = array ( "summary" => "container", 
	       	       	 "download" => "container", 
	       		 "planet" => "container", 
			 "developers" => "container",
	       		 "about" => "container" ); 
	
	$id = "summary";
	foreach ($context as $c) {
		if (array_key_exists ($c, $tabs)) {
			$id = $c;
			break;
		}
	}
	// the current tab is selected
	$tabs[$id] = "selected";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
    <head>
        <title><?php print $heading; ?></title>
        <style type="text/css">
            @import url(/css/blueprint/print.css) print;
            @import url(/css/blueprint/screen.css) screen;
            @import url(/css/tabs.css);
            @import url(/css/style.css);
        </style>
    </head>
    <body>
<!-- DO NOT EDIT ! the html is generated by PHP. Edit the PHP instead -->
        <div id="wrap">

            <div id="header">
                <h1><a href="/">Go-OO</a></h1>
            </div>
            <div id="container">
                <ul id="nav">
<?php
			foreach($tabs as $key => $value)
			{
				$link = $hnav[$key];
				echo "<li class=\"tabs-$value\"><a href=\"$link[0]\">$link[1]</a></li>\n";

			}
		?>
                </ul>
                <div id="tagline">
                        <a href="http://www.go-oo.org">Better, Faster, Free-er</a>
                </div>
<?php
		if (count ($subtabs) > 0) {
			echo "<ul id=\"hnav\">\n";

			foreach($subtabs as $key => $value) {
				echo "<li><a";
				if (!is_array ($value) ) {
					echo " href=\"$value\"";
				}
				else {
					ksort ($value);
					foreach ($value as $an => $av) {
						echo " $an=\"$av\"";
					}
				}
				echo ">$key</a></li>\n";
			}
			echo "</ul>\n";
		}
?>

                <div class="container">
                    <div id="splash">
                        <h2><?php print $heading; ?></h2>
			<?php print $content . "\n"; ?>
                    </div>
                </div>

            </div>

            <div id="sidebar">
                <div class="text">
                    open office<br />
                    development
                </div>
            </div>

        </div>
    </body>
</html>

<?php
}
?>