-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpage.php
More file actions
148 lines (134 loc) · 4.37 KB
/
page.php
File metadata and controls
148 lines (134 loc) · 4.37 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
abstract class Page {
/// constructor
public function __construct() {
?>
<!DOCTYPE html>
<html lang="nl">
<head>
<?php $this->renderHEAD(); ?>
</head>
<body>
<?php $this->renderBODY(); ?>
</body>
</html>
<?php
}
/// protected methods
protected function renderBODY() {
global $pathToRoot;
?>
<a href="http://sc2calc.org/" class="banner">
<h1><?php echo $this->getTitle(); ?></h1>
</a>
<div class="menu">
<table id="menu">
<tr>
<td style="width: 120px;" class="group">
<a href="<?php echo $pathToRoot; ?>build_order/">Build order <img src="http://image.sc2calc.org/arrow_right.gif"/></a>
</td>
<td class="group">
<div class="unfold" style="width: 120px;">
<a href="<?php echo $pathToRoot; ?>unit_production/">Unit production <img src="http://image.sc2calc.org/arrow_right.gif"/></a>
<a class="race" href="<?php echo $pathToRoot; ?>unit_production/protoss.php"><img src="http://image.sc2calc.org/protoss.png"/> Protoss</a>
<a class="race" href="<?php echo $pathToRoot; ?>unit_production/terran.php"><img src="http://image.sc2calc.org/terran.png"/> Terran</a>
<a class="race" href="<?php echo $pathToRoot; ?>unit_production/zerg.php"><img src="http://image.sc2calc.org/zerg.png"/> Zerg</a>
</div>
</td>
<td> </td>
<td style="width: 90px;">
<a class="race" href="<?php echo $pathToRoot; ?>faq.php"><img src="http://image.sc2calc.org/faq.png"/> FAQ</a>
</td>
</tr>
</table>
</div>
<div id="tooltips"></div>
<?php
$this->renderContent();
?>
<div class="footer">
<ul class="copyleft">
<li>© 2010 Jasper A. Visser</li>
</ul>
<ul>
<li><a href="<?php echo $pathToRoot; ?>about.php">About</a></li>
<li><a href="http://www.teamliquid.net/mytlnet/index.php?view=new&to=Haploid" target="_blank">Contact</a></li>
</ul>
</div>
<?php
}
protected function renderHEAD() {
global $pathToRoot;
?>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title><?php echo $this->getTitle(); ?> - StarCraft 2</title>
<link rel="stylesheet" type="text/css" href="<?php echo $pathToRoot; ?>style.css"/>
<link rel="icon" href="http://image.sc2calc.org/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<?php echo $pathToRoot; ?>jquery.js"></script>
<script type="text/javascript" src="<?php echo $pathToRoot; ?>jquery.effects.core.js"></script>
<script type="text/javascript" src="<?php echo $pathToRoot; ?>jquery.effects.highlight.js"></script>
<script type="text/javascript" src="<?php echo $pathToRoot; ?>jquery.corner.js"></script>
<script type="text/javascript" src="<?php echo $pathToRoot; ?>jquery.ezpz.js"></script>
<script type="text/javascript"><!--
$(function() {
// collapsibles
$("fieldset > legend").click(function() {
$(this).parent().toggleClass("collapsed");
});
// menu unfold
$("table#menu div.unfold").each(function(){
$(this).hover(function(){
$(this).animate({width: "380px"}, {queue: false, duration: 500});
},function() {
$(this).animate({width: "120px"}, {queue: false, duration: 500});
});
});
});
//--></script>
<script type="text/javascript"><!--
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18765033-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
//--></script>
<?php
}
/// abstract protected methods
abstract protected function getTitle();
abstract protected function renderContent();
};
/*
<?php
require("page.php");
class XXXPage extends Page {
/// protected methods
protected function getTitle() {
return "XXX";
}
protected function renderBODY() {
parent::renderBODY();
?>
<?php
}
protected function renderContent() {
?>
<?php
}
protected function renderHEAD() {
parent::renderHEAD();
?>
<script type="text/javascript"><!--
$(function() {
});
//--></script>
<?php
}
};
new XXXPage();
?>
*/
?>