-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
StandardPage.hh
81 lines (73 loc) · 2.05 KB
/
StandardPage.hh
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
<?hh // strict
/**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
trait StandardPage {
require extends Controller;
abstract protected function renderMainColumn(): :xhp;
protected function getExtraCSS(): Set<string> {
return Set {};
}
protected function getExtraJS(): Set<string> {
return Set {};
}
final protected function getCSS(): Set<string> {
return (Set {
'/css/base.css',
})->addAll($this->getExtraCSS());
}
final protected function getJS(): Set<string> {
return (Set {
})->addAll($this->getExtraJS());
}
final private function renderHeader(): :xhp {
return
<div class="hackHeader">
<div class="width">
<a href="http://hacklang.org/">
<div class="logo">Hack</div>
</a>
<div class="headerNav">
<ul>
<li>
<a href="http://hacklang.org/install/">Install</a>
</li>
<li>
<a href="http://hacklang.org/tutorial/">Tutorial</a>
</li>
<li>
<a href="/">Cookbook</a>
</li>
<li>
<a href="http://hhvm.com/manual">Docs</a>
</li>
<li>
<a href="http://github.com/facebook/hhvm">GitHub</a>
</li>
<li>
<a href="http://hhvm.com/">HHVM</a>
</li>
</ul>
</div>
</div>
</div>;
}
final protected function render(): :xhp {
return
<div>
{$this->renderHeader()}
<div class="width">
<div class="mainContainer">
<div class="mainColumn">{$this->renderMainColumn()}</div>
<hack:nav/>
</div>
</div>
</div>;
}
}