This repository has been archived by the owner on Jan 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSuperTuxKartTemplate.php
206 lines (173 loc) · 7.44 KB
/
SuperTuxKartTemplate.php
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?php
class SuperTuxKartTemplate extends BaseTemplate {
/**
* This is function is used to create the entire page
*/
public function execute() {
$admin_tools = array( array("name" => "Actions", "tools" => array("edit", "move", "purge","protect", "delete", "watch", "upload")),
array("name" => "Page", "tools" => array("history", "whatlinkshere", "permalink", "info")),
array("name" => "Me", "tools" => array("specialpages", "preferences", "watchlist", "mycontris", "logout")));
$user_tools = array("history", "whatlinkshere", "permalink", "info", "specialpages", "login");
$all_tools = array_merge($this->getPersonalTools(), $this->data['content_actions'], $this->getToolbox());
// TODO s. #3
/**
<?php if ($this->data['language_urls'] and count($this->data['language_urls']) > 0) { ?>
<ul>
<?php foreach ($this->data['language_urls'] as $key => $item) {
echo $this->makeListItem($key, $item);
} ?>
</ul>
<?php } ?>
*/
// Even goole didn't know a better to do that ...
$logged_in = false;
foreach ($all_tools as $key => $item ) {
if ($key == "logout") {
$logged_in = true;
}
}
$this->html('headelement');
?>
<div class="outerbox"> <!-- currently unused -->
<?php /* - Header ---------------------------------------------------------------------------- */ ?>
<div class="header_wrapper">
<div class="header_color_wrapper_outer">
<div class="header_color_wrapper_inner size-dependend-margin">
<div class="navigation-tools">
<nav>
<label for="toggle-mobile-navbar" class="toggle-mobile-navbar"><i class="fa fa-bars" style="margin-right: 5px"></i>Menu</label>
<input type="checkbox" role="button" id="toggle-mobile-navbar" class="dropdown-trigger">
<ul class="nav noselect dropdown-target">
<li><a href="/Discover" >Discover </a></li>
<li><a href="/Download" >Download </a></li>
<li><a href="/FAQ" >FAQ </a></li>
<li><a href="/Community">Get Involved</a></li>
<li><a href="https://blog.supertuxkart.net/">Blog</a></li>
<li><a class="donate-top-menu-link" href="/Donate">Donate <i class="fa fa-heart"></i></a></li>
<li class="searchform">
<div class="toolbox-container">
<label for="toolbox-gear" class="toolbox-gear-label"><i class="fa fa-cog fa-lg"></i></label>
<input type="checkbox" role="button" id="toolbox-gear" class="dropdown-trigger"/>
<div class="toolbox dropdown-target"> <!-- the actual toolbox starts here -->
<p class="toolbox-title">Tools</p>
<?php
if ($logged_in) {
foreach ($admin_tools as $tool) { ?>
<div class="toolbox-section">
<p><?= $tool["name"] ?></p>
<ul>
<?php
foreach ($tool["tools"] as $toolname) {
foreach ($all_tools as $key => $item ) {
if ($key == $toolname) {
echo $this->makeListItem($key, $item);
}
}
}
?>
</ul>
</div>
<?php }
} else { ?>
<ul class="public-tools">
<?php
foreach ($user_tools as $toolname) {
foreach ($all_tools as $key => $item ) {
if ($key == $toolname) {
echo $this->makeListItem($key, $item);
}
}
}
?>
</ul>
<?php
} ?>
</div> <!-- the actual toolbox ends here -->
</div>
<form action="<?php $this->text('wgScript'); ?>">
<input type="hidden" name="title" value="<?php $this->text('searchtitle') ?>" />
<?php echo $this->makeSearchInput(array('type' => 'text')); ?>
<button class="fa fa-search" role="submit"></button>
</form>
</li>
</ul>
</nav>
<a class="logo noselect"
href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href']) ?>"
<?php echo Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs('p-logo')) ?>
>
<img src="<?php $this->text('logopath') ?>" alt="<?php $this->text('sitename') ?>" />
</a>
</div>
</div>
</div>
</div>
<?php /* - Main Content ---------------------------------------------------------------------- */ ?>
<div class="main-content-wrapper size-dependend-margin">
<div class="content_wrapper">
<?php /* Main Content ----------------------------------------------------------------------- */ ?>
<?php if ($this->data['title'] != 'Main Page') { ?>
<h1 class="article-title"><?php $this->html('title') ?></h1>
<?php } ?>
<article>
<?php $this->html('bodytext') ?>
</article>
</div>
</div>
</div> <!-- main-content-wrapper -->
<?php /* - Footer (copyright section, various menu etc) -------------------------------------- */ ?>
<footer class="size-dependend-margin ">
<div class="footer-links">
<?php
// Data to be displayed at the end
$footer_section = array (
array( 'heading' => 'Community', 'entries' => array (
array('Forum', 'https://forum.freegamedev.net/viewforum.php?f=16'),
array('Blog', 'https://blog.supertuxkart.net/'),
array('Twitter', 'https://twitter.com/supertuxkart'),
array('Addons', 'https://online.supertuxkart.net/'),
array('irc: #supertuxkart@libera', 'https://web.libera.chat/?channels=#supertuxkart')
)),
array( 'heading' => 'Media', 'entries' => array (
array('YouTube', 'https://www.youtube.com/channel/UCJ9hmn6MG_ggpQUhmbMS2mQ'),
array('Pictures', '/Gallery'),
array('Posters', '/Posters')
)),
array( 'heading' => 'Development', 'entries' => array (
array('Modding', '/Community'),
array('GitHub', 'https://github.com/supertuxkart/stk-code'),
array('Documentation', 'https://doxygen.supertuxkart.net/')
)),
array( 'heading' => 'About us', 'entries' => array (
array('FAQ', '/FAQ'),
array('Who we are', '/Team'),
array('About SuperTuxKart', '/Discover'),
array('Projects using SuperTuxKart', '/Projects'),
))
);
?>
<?php
// This loop makes the link footer link table
foreach ($footer_section as $column) { ?>
<div><p> <?= $column['heading'] ?> </p>
<ul>
<?php // Generating table cell
foreach ($column['entries'] as $entry) { ?>
<li><a href='<?= $entry[1] ?>'> <?= $entry[0] ?> </a></li>
<?php } ?>
</ul>
</div>
<?php } ?>
</div>
<div class="footer-copyright">
Site designed by Jean-Manuel Clémençon & Konstin<br />
Powered by <a href="https://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a><br /><br />
SuperTuxKart Team © 2021
</div>
</footer>
<?php $this->printTrail(); // includes scripts etc. ?>
</body>
</html><?php
}
}
?>