-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRainbow.skin.php
222 lines (202 loc) · 7.04 KB
/
Rainbow.skin.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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<?php
/**
* Skin file for skin Rainbow.
*
* @file
* @ingroup Skins
*/
/**
* SkinTemplate class for Rainbow skin
* @ingroup Skins
*/
class SkinRainbow extends SkinTemplate {
var $skinname = 'Rainbow';
var $stylename = 'Rainbow';
var $template = 'RainbowTemplate';
var $useHeadElement = true;
/**
* Initializes output page and sets up skin-specific parameters
* @param $out OutputPage object to initialize
*/
public function initPage( OutputPage $out ) {
parent::initPage( $out );
$out->addModuleScripts( 'skins.rainbow' );
$out->addModuleMessages( 'skins.rainbow' );
//$out->addModules( 'skins.rainbow' );
}
/**
* @param $out OutputPage object
*/
function setupSkinUserCss( OutputPage $out ){
parent::setupSkinUserCss( $out );
$out->addModuleStyles( 'skins.rainbow' );
}
}
/**
* BaseTemplate class for Rainbow skin
* @ingroup Skins
*/
class RainbowTemplate extends BaseTemplate {
/**
* Outputs the entire contents of the page
*/
public function execute() {
//MW 1.18.x compatibility
if ( !isset($this->data['sitename']) ) {
global $wgSitename;
$this->set( 'sitename', $wgSitename );
}
wfSuppressWarnings(); // Suppress warnings to prevent notices about missing indexes in $this->data
$this->html( 'headelement' );
?>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<?php
foreach ( $this->getPersonalTools() as $key => $item ) {
echo $this->makeListItem($key, $item);
}
?>
</ul>
<form action="<?php $this->text( 'wgScript' ); ?>" class="form-search form-inline">
<input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>" />
<?php echo $this->makeSearchInput( array( 'type' => 'text', 'class' => 'input-medium search-query') ); ?>
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="">
<span class="feature-description"><?php $this->msg( 'rainbow-jsmessage' ); ?></span>
<div id="mw-js-message" style="display:none;"></div>
<span class="feature-description"><?php $this->msg( 'rainbow-newtalk' ); ?></span>
<?php if ( $this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html( 'newtalk' ); ?></div><?php } ?>
<span class="feature-description"><?php $this->msg( 'rainbow-sitenotice' ); ?></span>
<?php if ( $this->data['sitenotice'] ) { ?><div id="siteNotice"><?php $this->html( 'sitenotice' ); ?></div><?php } ?>
<span class="feature-description"><?php $this->msg( 'rainbow-sitename' ); ?></span>
<?php $this->text( 'sitename' ); ?>
</div>
</div>
<div class="">
<span class="feature-description"><?php $this->msg( 'rainbow-contentnavigation' ); ?></span>
<ul class="nav nav-tabs">
<?php
foreach ( $this->data['content_navigation'] as $category => $tabs ) {
?>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><?php echo $category ?><b class="caret"></b> </a>
<ul class="dropdown-menu"> <?php
foreach ( $tabs as $key => $tab ) {
echo $this->makeListItem( $key, $tab );
}
?>
</ul>
</li>
<?php
}
?>
</ul>
</div>
<div class="row">
<div class="">
<span class="feature-description"><?php $this->msg( 'rainbow-title' ); ?></span>
<h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
</div>
</div>
<div class="row">
<div class="span10">
<?php global $wgUser; ?>
<span class="feature-description"><?php $this->msg( 'rainbow-wikitextmsg', $wgUser->getName() ); ?></span>
<?php $this->msgWiki( 'rainbow-wikitextmsg', $wgUser->getName() ); ?>
<span class="feature-description"><?php $this->msg( 'rainbow-content' ); ?></span>
<div id="content">
<div id="bodyContent">
<?php if ( $this->data['isarticle'] ): ?>
<span class="feature-description"><?php $this->msg( 'rainbow-tagline' ); ?></span>
<div id="siteSub"><?php $this->msg( 'tagline' ); ?></div>
<?php endif; ?>
<span class="feature-description"><?php $this->msg( 'rainbow-subtitle' ); ?></span>
<?php if ( $this->data['subtitle'] ) { ?><div id="contentSub"><?php $this->html( 'subtitle' ); ?></div><?php } ?>
<span class="feature-description"><?php $this->msg( 'rainbow-undelete' ); ?></span>
<?php if ( $this->data['undelete'] ) { ?><div id="contentSub2"><?php $this->html( 'undelete' ); ?></div><?php } ?>
<span class="feature-description"><?php $this->msg( 'rainbow-bodytext' ); ?></span>
<?php $this->html( 'bodytext' ) ?>
<span class="feature-description"><?php $this->msg( 'rainbow-catlinks' ); ?></span>
<?php $this->html( 'catlinks' ); ?>
</div>
</div>
<span class="feature-description"><?php $this->msg( 'rainbow-dataAfterContent' ); ?></span>
<?php $this->html( 'dataAfterContent' ); ?>
</div>
<div class="span2">
<span class="feature-description"><?php $this->msg( 'rainbow-sidebar' ); ?></span>
<?php
foreach ( $this->getSidebar() as $boxName => $box ) {
?>
<div id="<?php echo Sanitizer::escapeId( $box['id'] ) ?>"<?php echo Linker::tooltip( $box['id'] ) ?>>
<h5><?php echo htmlspecialchars( $box['header'] ); ?></h5>
<?php
if ( is_array( $box['content'] ) ) { ?>
<ul class="nav nav-pills nav-stacked">
<?php
foreach ( $box['content'] as $key => $item ) { ?>
<?php echo $this->makeListItem( $key, $item ); ?>
<?php
} ?>
</ul>
<?php
} else { ?>
<?php echo $box['content']; ?>
<?php
} ?>
</div>
<?php
}
?>
<span class="feature-description"><?php $this->msg( 'rainbow-languageurls' ); ?></span>
<?php if ( $this->data['language_urls'] ) { ?>
<ul class="nav nav-pills nav-stacked">
<?php
foreach ( $this->data['language_urls'] as $key => $langlink ) { ?>
<?php echo $this->makeListItem( $key, $langlink ); ?>
<?php
} ?>
</ul>
<?php } ?>
<!-- Überflüssig, weil bereits in Sidebar -->
<span class="feature-description"><?php $this->msg( 'rainbow-toolbox' ); ?></span>
<ul class="nav nav-pills nav-stacked">
<?php
foreach ( $this->getToolbox() as $key => $tbitem ) { ?>
<?php echo $this->makeListItem( $key, $tbitem ); ?>
<?php
}
wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) );
?>
</ul>
</div>
</div>
<div class="row">
<div class="">
<span class="feature-description"><?php $this->msg( 'rainbow-footer' ); ?></span>
<?php
foreach ( $this->getFooterLinks() as $category => $links ) { ?>
<ul class="nav nav-pills">
<?php
foreach ( $links as $key ) { ?>
<li><?php $this->html( $key ) ?></li>
<?php } ?>
</ul>
<?php } ?>
<?php $this->printTrail(); ?>
</div>
</div>
</div>
</body>
</html>
<?php
wfRestoreWarnings();
}
}