Moved buildNavigationUrls into SkinTemplate from SkinVector which inherits SkinTempla...
[lhc/web/wiklou.git] / skins / Vector.php
1 <?php
2 /**
3 * Vector - Branch of MonoBook which has many usability improvements and
4 * somewhat cleaner code.
5 *
6 * @todo document
7 * @file
8 * @ingroup Skins
9 */
10
11 if( !defined( 'MEDIAWIKI' ) )
12 die( -1 );
13
14 /**
15 * SkinTemplate class for Vector skin
16 * @ingroup Skins
17 */
18 class SkinVector extends SkinTemplate {
19
20 /* Functions */
21
22 /**
23 * Initializes output page and sets up skin-specific parameters
24 * @param object $out Output page object to initialize
25 */
26 public function initPage( OutputPage $out ) {
27 parent::initPage( $out );
28 $this->skinname = 'vector';
29 $this->stylename = 'vector';
30 $this->template = 'VectorTemplate';
31 }
32
33 /**
34 * Defines CSS files to be included
35 * @param object $out Output page to add styles to
36 */
37 public function setupSkinUserCss( OutputPage $out ) {
38 global $wgContLang;
39 // Append to the default screen common & print styles...
40 if ( $wgContLang->isRTL() ) {
41 $out->addStyle( 'vector/main-rtl.css', 'screen' );
42 } else {
43 $out->addStyle( 'vector/main-ltr.css', 'screen' );
44 }
45 // Add common styles
46 parent::setupSkinUserCss( $out );
47 }
48
49 }
50
51 /**
52 * QuickTemplate class for Vector skin
53 * @ingroup Skins
54 */
55 class VectorTemplate extends QuickTemplate {
56
57 /* Members */
58
59 /**
60 * @var Cached skin object
61 */
62 var $skin;
63
64 /* Functions */
65
66 /**
67 * Outputs the entire contents of the XHTML page
68 */
69 public function execute() {
70 global $wgRequest, $wgUseTwoButtonsSearchForm;
71
72 $this->skin = $this->data['skin'];
73 $action = $wgRequest->getText( 'action' );
74
75 // Suppress warnings to prevent notices about missing indexes in
76 // $this->data (is this really the best way to handle this?)
77 wfSuppressWarnings();
78
79 // Build additional attributes for navigation urls
80 $nav = $this->skin->buildNavigationUrls();
81 foreach ( $nav as $section => $links ) {
82 foreach ( $links as $key => $link ) {
83 $xmlID = $key;
84 if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
85 $xmlID = 'ca-nstab-' . $xmlID;
86 } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
87 $xmlID = 'ca-talk';
88 } else {
89 $xmlID = 'ca-' . $xmlID;
90 }
91 $nav[$section][$key]['attributes'] =
92 ' id="' . Sanitizer::escapeId( $xmlID ) . '"';
93 if ( $nav[$section][$key]['class'] ) {
94 $nav[$section][$key]['attributes'] .=
95 ' class="' . htmlspecialchars( $link['class'] ) . '"';
96 unset( $nav[$section][$key]['class'] );
97 }
98
99 // We don't want to give the watch tab an accesskey if the page is
100 // being edited, because that conflicts with the accesskey on the
101 // watch checkbox. We also don't want to give the edit tab an
102 // accesskey, because that's fairly superfluous and conflicts with
103 // an accesskey (Ctrl-E) often used for editing in Safari.
104 if (
105 in_array( $action, array( 'edit', 'submit' ) ) &&
106 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
107 ) {
108 $nav[$section][$key]['key'] =
109 $this->skin->tooltip( $xmlID );
110 } else {
111 $nav[$section][$key]['key'] =
112 $this->skin->tooltipAndAccesskey( $xmlID );
113 }
114 }
115 }
116 $this->data['namespace_urls'] = $nav['namespaces'];
117 $this->data['view_urls'] = $nav['views'];
118 $this->data['action_urls'] = $nav['actions'];
119 $this->data['variant_urls'] = $nav['variants'];
120
121 // Build additional attributes for personal_urls
122 foreach ( $this->data['personal_urls'] as $key => $item) {
123 $this->data['personal_urls'][$key]['attributes'] =
124 ' id="' . Sanitizer::escapeId( "pt-$key" ) . '"';
125 if ( $item['active'] ) {
126 $this->data['personal_urls'][$key]['attributes'] .=
127 ' class="active"';
128 }
129 $this->data['personal_urls'][$key]['key'] =
130 $this->skin->tooltipAndAccesskey('pt-'.$key);
131 }
132
133 // Generate additional footer links
134 $footerlinks = array(
135 'info' => array(
136 'lastmod',
137 'viewcount',
138 'numberofwatchingusers',
139 'credits',
140 'copyright',
141 'tagline',
142 ),
143 'places' => array(
144 'privacy',
145 'about',
146 'disclaimer',
147 ),
148 );
149
150 // Build list of valid footer links
151 $validFooterLinks = array();
152 foreach( $footerlinks as $category => $links ) {
153 $validFooterLinks[$category] = array();
154 foreach( $links as $link ) {
155 if( isset( $this->data[$link] ) && $this->data[$link] ) {
156 $validFooterLinks[$category][] = $link;
157 }
158 }
159 }
160
161 // Begin content output
162 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
163 <html xmlns="<?php $this->text('xhtmldefaultnamespace') ?>" <?php foreach($this->data['xhtmlnamespaces'] as $tag => $ns): ?>xmlns:<?php echo "{$tag}=\"{$ns}\" "; ?><?php endforeach ?>xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
164 <head>
165 <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
166 <title><?php $this->text('pagetitle') ?></title>
167 <!-- headlinks -->
168 <?php $this->html('headlinks') ?>
169 <!-- /headlinks -->
170 <!-- csslinks -->
171 <?php $this->html('csslinks') ?>
172 <!-- /csslinks -->
173 <!-- IEFixes -->
174 <!--[if lt IE 7]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script>
175 <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
176 <style type="text/css">body{behavior:url("<?php $this->text('stylepath') ?>/vector/csshover.htc")}</style>
177 <!-- /IEFixes -->
178 <!-- globalVariablesScript -->
179 <?php echo Skin::makeGlobalVariablesScript( $this->data ); ?>
180 <!-- /globalVariablesScript -->
181 <!-- wikibits -->
182 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js --></script>
183 <!-- /wikibits -->
184 <!-- headscripts -->
185 <?php $this->html('headscripts') ?>
186 <!-- /headscripts -->
187 <?php if($this->data['jsvarurl']): ?>
188 <!-- jsvarurl -->
189 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl') ?>"><!-- site js --></script>
190 <!-- /jsvarurl -->
191 <?php endif; ?>
192 <?php if($this->data['pagecss']): ?>
193 <!-- pagecss -->
194 <style type="text/css"><?php $this->html('pagecss') ?></style>
195 <!-- /pagecss -->
196 <?php endif; ?>
197 <?php if($this->data['usercss']): ?>
198 <!-- usercss -->
199 <style type="text/css"><?php $this->html('usercss') ?></style>
200 <!-- /usercss -->
201 <?php endif; ?>
202 <?php if($this->data['userjs']): ?>
203 <!-- userjs -->
204 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
205 <!-- /userjs -->
206 <?php endif; ?>
207 <?php if($this->data['userjsprev']): ?>
208 <!-- userjsprev -->
209 <script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
210 <!-- /userjsprev -->
211 <?php endif; ?>
212 <?php if($this->data['trackbackhtml']): ?>
213 <!-- trackbackhtml -->
214 <?php echo $this->data['trackbackhtml']; ?>
215 <!-- /trackbackhtml -->
216 <?php endif; ?>
217 </head>
218 <body<?php if($this->data['body_ondblclick']): ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php endif; ?> <?php if($this->data['body_onload']): ?> onload="<?php $this->text('body_onload') ?>"<?php endif; ?> class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
219 <div id="page-base" class="noprint"></div>
220 <div id="head-base" class="noprint"></div>
221 <!-- content -->
222 <div id="content">
223 <a name="top" id="top"></a>
224 <div id="mw-js-message" style="display:none;"></div>
225 <!-- sitenotice -->
226 <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
227 <!-- /sitenotice -->
228 <!-- firstHeading -->
229 <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
230 <!-- /firstHeading -->
231 <!-- bodyContent -->
232 <div id="bodyContent">
233 <!-- tagline -->
234 <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
235 <!-- /tagline -->
236 <!-- subtitle -->
237 <div id="contentSub"><?php $this->html('subtitle') ?></div>
238 <!-- /subtitle -->
239 <?php if($this->data['undelete']): ?>
240 <!-- undelete -->
241 <div id="contentSub2"><?php $this->html('undelete') ?></div>
242 <!-- /undelete -->
243 <?php endif; ?>
244 <?php if($this->data['newtalk'] ): ?>
245 <!-- newtalk -->
246 <div class="usermessage"><?php $this->html('newtalk') ?></div>
247 <!-- /newtalk -->
248 <?php endif; ?>
249 <?php if($this->data['showjumplinks']): ?>
250 <!-- jumpto -->
251 <div id="jump-to-nav">
252 <?php $this->msg('jumpto') ?> <a href="#head"><?php $this->msg('jumptonavigation') ?></a>,
253 <a href="#search"><?php $this->msg('jumptosearch') ?></a>
254 </div>
255 <!-- /jumpto -->
256 <?php endif; ?>
257 <!-- bodytext -->
258 <?php $this->html('bodytext') ?>
259 <!-- /bodytext -->
260 <!-- catlinks -->
261 <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
262 <!-- /catlinks -->
263 <!-- dataAfterContent -->
264 <?php if($this->data['dataAfterContent']) { $this->html('dataAfterContent'); } ?>
265 <!-- /dataAfterContent -->
266 <div class="visualClear"></div>
267 </div>
268 <!-- /bodyContent -->
269 </div>
270 <!-- /content -->
271 <!-- header -->
272 <div id="head" class="noprint">
273 <!-- personal -->
274 <?php if ( count( $this->data['personal_urls'] ) > 0 ): ?>
275 <div id="p-personal">
276 <h5><?php $this->msg('personaltools') ?></h5>
277 <ul <?php $this->html('userlangattributes') ?>>
278 <?php foreach($this->data['personal_urls'] as $key => $item): ?>
279 <li <?php echo $item['attributes'] ?>><a href="<?php echo htmlspecialchars($item['href']) ?>"<?php echo $item['key'] ?><?php if(!empty($item['class'])): ?> class="<?php echo htmlspecialchars($item['class']) ?>"<?php endif; ?>><?php echo htmlspecialchars($item['text']) ?></a></li>
280 <?php endforeach; ?>
281 </ul>
282 </div>
283 <?php endif; ?>
284 <!-- /personal -->
285 <div id="left-navigation">
286 <!-- namespaces -->
287 <?php if ( count( $this->data['namespace_urls'] ) > 0 ): ?>
288 <div id="namespaces" class="vectorTabs">
289 <h5><?php $this->msg('namespaces') ?></h5>
290 <ul <?php $this->html('userlangattributes') ?>>
291 <?php foreach ($this->data['namespace_urls'] as $key => $link ): ?>
292 <li <?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><span><?php echo htmlspecialchars( $link['text'] ) ?></span></a></li>
293 <?php endforeach; ?>
294 </ul>
295 </div>
296 <?php endif; ?>
297 <!-- /namespaces -->
298 <!-- variants -->
299 <?php if ( count( $this->data['variant_urls'] ) > 0 ): ?>
300 <div id="variants" class="vectorMenu">
301 <h5><span><?php $this->msg('variants') ?></span><a href="#">&nbsp;</a></h5>
302 <div class="menu">
303 <ul <?php $this->html('userlangattributes') ?>>
304 <?php foreach ($this->data['variant_urls'] as $key => $link ): ?>
305 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
306 <?php endforeach; ?>
307 </ul>
308 </div>
309 </div>
310 <?php endif; ?>
311 <!-- /variants -->
312 </div>
313 <div id="right-navigation">
314 <!-- views -->
315 <?php if ( count( $this->data['view_urls'] ) > 0 ): ?>
316 <div id="views" class="vectorTabs">
317 <h5><?php $this->msg('views') ?></h5>
318 <ul <?php $this->html('userlangattributes') ?>>
319 <?php foreach ($this->data['view_urls'] as $key => $link ): ?>
320 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><span><?php echo htmlspecialchars( $link['text'] ) ?></span></a></li>
321 <?php endforeach; ?>
322 </ul>
323 </div>
324 <?php endif; ?>
325 <!-- /views -->
326 <!-- actions -->
327 <?php if ( count( $this->data['action_urls'] ) > 0 ): ?>
328 <div id="p-cactions" class="vectorMenu">
329 <h5><span><?php $this->msg('actions') ?></span><a href="#">&nbsp;</a></h5>
330 <div class="menu">
331 <ul <?php $this->html('userlangattributes') ?>>
332 <?php foreach ($this->data['action_urls'] as $key => $link ): ?>
333 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
334 <?php endforeach; ?>
335 </ul>
336 </div>
337 </div>
338 <?php endif; ?>
339 <!-- /actions -->
340 <!-- search -->
341 <div id="p-search">
342 <h5 <?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5>
343 <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
344 <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/>
345 <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
346 <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg( 'searcharticle' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> />
347 <?php if ( $wgUseTwoButtonsSearchForm ): ?>
348 <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg( 'searchbutton' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
349 <?php else: ?>
350 <div><a href="<?php $this->text( 'searchaction' ) ?>" rel="search"><?php $this->msg( 'powersearch-legend' ) ?></a></div>
351 <?php endif; ?>
352 </form>
353 </div>
354 <!-- /search -->
355 </div>
356 </div>
357 <!-- /header -->
358 <!-- panel -->
359 <div id="panel" class="noprint">
360 <!-- sidebar -->
361 <?php
362 $sidebar = $this->data['sidebar'];
363 $sidebar['TOOLBOX'] = ( !isset( $sidebar['TOOLBOX'] ) );
364 $sidebar['LANGUAGES'] = ( !isset( $sidebar['LANGUAGES'] ) );
365 foreach ( $sidebar as $name => $content ) {
366 switch( $name ) {
367 case 'SEARCH':
368 break;
369 case 'TOOLBOX':
370 $this->toolBox();
371 break;
372 case 'LANGUAGES':
373 $this->languageBox();
374 break;
375 default:
376 $this->customBox( $name, $content );
377 break;
378 }
379 }
380 ?>
381 <!-- /sidebar -->
382 </div>
383 <!-- /panel -->
384 <div class="break"></div>
385 <!-- foot -->
386 <div id="foot">
387 <?php foreach( $validFooterLinks as $category => $links ): ?>
388 <?php if ( count( $links ) > 0 ): ?>
389 <ul id="foot-<?php echo $category ?>">
390 <?php foreach( $links as $link ): ?>
391 <?php if( isset( $this->data[$link] ) && $this->data[$link] ): ?>
392 <li id="foot-<?php echo $category ?>-<?php echo $link ?>"><?php $this->html( $link ) ?></li>
393 <?php endif; ?>
394 <?php endforeach; ?>
395 </ul>
396 <?php endif; ?>
397 <?php endforeach; ?>
398 <ul id="foot-icons" class="noprint">
399 <?php if( $this->data['poweredbyico'] ): ?>
400 <li id="foot-icon-poweredby"><?php $this->html( 'poweredbyico' ) ?></li>
401 <?php endif; ?>
402 <?php if( $this->data['copyrightico'] ): ?>
403 <li id="foot-icon-copyright"><?php $this->html( 'copyrightico' ) ?></li>
404 <?php endif; ?>
405 </ul>
406 <div style="clear:both"></div>
407 </div>
408 <!-- /foot -->
409 <!-- logo -->
410 <div id="p-logo">
411 <a style="background-image: url(<?php $this->text('logopath') ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo $this->skin->tooltipAndAccesskey('p-logo') ?>></a>
412 </div>
413 <!-- /logo -->
414 <!-- fixalpha -->
415 <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha( 'p-logo' ); </script>
416 <!-- /fixalpha -->
417 <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
418 <?php $this->html( 'reporttime' ) ?>
419 <?php if ( $this->data['debug'] ): ?>
420 <!-- Debug output:
421 <?php $this->text( 'debug' ); ?>
422 -->
423 <?php endif; ?>
424 </body>
425 </html>
426 <?php
427 // We're done with abusing arrays now...
428 wfRestoreWarnings();
429 }
430
431 /**
432 * Outputs a box with a list of tools
433 */
434 private function toolBox() {
435 ?>
436 <div class="portal" id="p-tb">
437 <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg( 'toolbox' ) ?></h5>
438 <div class="body">
439 <ul>
440 <?php if( $this->data['notspecialpage'] ): ?>
441 <li id="t-whatlinkshere"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['whatlinkshere']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-whatlinkshere' ) ?>><?php $this->msg( 'whatlinkshere' ) ?></a></li>
442 <?php if( $this->data['nav_urls']['recentchangeslinked'] ): ?>
443 <li id="t-recentchangeslinked"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['recentchangeslinked']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-recentchangeslinked' ) ?>><?php $this->msg( 'recentchangeslinked-toolbox' ) ?></a></li>
444 <?php endif; ?>
445 <?php endif; ?>
446 <?php if( isset( $this->data['nav_urls']['trackbacklink'] ) ): ?>
447 <li id="t-trackbacklink"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['trackbacklink']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-trackbacklink' ) ?>><?php $this->msg( 'trackbacklink' ) ?></a></li>
448 <?php endif; ?>
449 <?php if( $this->data['feeds']): ?>
450 <li id="feedlinks">
451 <?php foreach( $this->data['feeds'] as $key => $feed ): ?>
452 <a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php echo htmlspecialchars( $feed['href'] ) ?>" rel="alternate" type="application/<?php echo $key ?>+xml" class="feedlink"<?php echo $this->skin->tooltipAndAccesskey( 'feed-' . $key ) ?>><?php echo htmlspecialchars( $feed['text'] ) ?></a>
453 <?php endforeach; ?>
454 </li>
455 <?php endif; ?>
456 <?php foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?>
457 <?php if( $this->data['nav_urls'][$special]): ?>
458 <li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars( $this->data['nav_urls'][$special]['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-' . $special ) ?>><?php $this->msg( $special ) ?></a></li>
459 <?php endif; ?>
460 <?php endforeach; ?>
461 <?php if( !empty( $this->data['nav_urls']['print']['href'] ) ): ?>
462 <li id="t-print"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['print']['href'] ) ?>" rel="alternate"<?php echo $this->skin->tooltipAndAccesskey( 't-print' ) ?>><?php $this->msg( 'printableversion' ) ?></a></li>
463 <?php endif; ?>
464 <?php if ( !empty( $this->data['nav_urls']['permalink']['href'] ) ): ?>
465 <li id="t-permalink"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['permalink']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-permalink' ) ?>><?php $this->msg( 'permalink' ) ?></a></li>
466 <?php elseif ( $this->data['nav_urls']['permalink']['href'] === '' ): ?>
467 <li id="t-ispermalink"<?php echo $this->skin->tooltip( 't-ispermalink' ) ?>><?php $this->msg( 'permalink' ) ?></li>
468 <?php endif; ?>
469 <?php wfRunHooks( 'VectorTemplateToolboxEnd', array( &$this ) ); ?>
470 <?php wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?>
471 </ul>
472 </div>
473 </div>
474 <?php
475 }
476
477 /**
478 * Outputs a box with a list of alternative languages for this page
479 */
480 private function languageBox() {
481 if( $this->data['language_urls'] ) {
482 ?>
483 <div class="portal" id="p-lang">
484 <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg( 'otherlanguages' ) ?></h5>
485 <div class="body">
486 <ul>
487 <?php foreach ( $this->data['language_urls'] as $langlink ): ?>
488 <li class="<?php echo htmlspecialchars( $langlink['class'] ) ?>"><a href="<?php echo htmlspecialchars( $langlink['href'] ) ?>"><?php echo $langlink['text'] ?></a></li>
489 <?php endforeach; ?>
490 </ul>
491 </div>
492 </div>
493 <?php
494 }
495 }
496
497 /**
498 * Outputs a box with a custom list of items or HTML content
499 * @param string $bar Message name for title of box
500 * @param mixed $content HTML or array of items to build a list from
501 */
502 private function customBox( $bar, $content ) {
503 ?>
504 <div class="portal" id='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php echo $this->skin->tooltip( 'p-' . $bar ) ?>>
505 <h5 <?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $bar ); if ( wfEmptyMsg( $bar, $out ) ) echo htmlspecialchars( $bar ); else echo htmlspecialchars( $out ); ?></h5>
506 <div class="body">
507 <?php if ( is_array( $content ) ): ?>
508 <ul>
509 <?php foreach( $content as $key => $val ): ?>
510 <li id="<?php echo Sanitizer::escapeId( $val['id'] ) ?>"<?php if ( $val['active'] ): ?> class="active" <?php endif; ?>><a href="<?php echo htmlspecialchars( $val['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( $val['id'] ) ?>><?php echo htmlspecialchars( $val['text'] ) ?></a></li>
511 <?php endforeach; ?>
512 </ul>
513 <?php else: ?>
514 <?php echo $content; /* Allow raw HTML block to be defined by extensions */ ?>
515 <?php endif; ?>
516 </div>
517 </div>
518 <?php
519 }
520 }