d0d5b4fbbdda0732f13eb3350c87b5423a952085
5 * Translated from gwicke's previous TAL template version to remove
6 * dependency on PHPTAL.
13 if( !defined( 'MEDIAWIKI' ) )
17 require_once('includes/SkinTemplate.php');
20 * Inherit main code from SkinTemplate, set the CSS and template filter.
25 class SkinMonoBook
extends SkinTemplate
{
26 /** Using monobook. */
27 function initPage( &$out ) {
28 SkinTemplate
::initPage( $out );
29 $this->skinname
= 'monobook';
30 $this->stylename
= 'monobook';
31 $this->template
= 'MonoBookTemplate';
40 class MonoBookTemplate
extends QuickTemplate
{
42 * Template filter callback for MonoBook skin.
43 * Takes an associative array of data set from a SkinTemplate-based
44 * class, and a wrapper for MediaWiki's localization database, and
45 * outputs a formatted page.
50 // Suppress warnings to prevent notices about missing indexes in $this->data
53 ?
><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
54 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="<?php $this->text('lang') ?>" lang
="<?php $this->text('lang') ?>" dir
="<?php $this->text('dir') ?>">
56 <meta http
-equiv
="Content-Type" content
="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
57 <?php
$this->html('headlinks') ?
>
58 <title
><?php
$this->text('pagetitle') ?
></title
>
59 <style type
="text/css" media
="screen,projection">/*<![CDATA[*/ @import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?5"; /*]]>*/</style
>
60 <link rel
="stylesheet" type
="text/css" <?php
if(empty($this->data
['printable']) ) { ?
>media
="print"<?php
} ?
> href
="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
61 <!--[if lt IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style
><![endif]-->
62 <!--[if IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style
><![endif]-->
63 <!--[if gte IE
6]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style
><![endif]-->
64 <!--[if IE
]><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script
>
65 <meta http
-equiv
="imagetoolbar" content
="no" /><![endif]-->
66 <?php
if($this->data
['jsvarurl' ]) { ?
><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('jsvarurl' ) ?>"><!-- site js
--></script
><?php
} ?
>
67 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath' ) ?>/common/wikibits.js"><!-- wikibits js
--></script
>
68 <?php
if($this->data
['pagecss' ]) { ?
><style type
="text/css"><?php
$this->html('pagecss' ) ?
></style
><?php
} ?
>
69 <?php
if($this->data
['usercss' ]) { ?
><style type
="text/css"><?php
$this->html('usercss' ) ?
></style
><?php
} ?
>
70 <?php
if($this->data
['userjs' ]) { ?
><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('userjs' ) ?>"></script
><?php
} ?
>
71 <?php
if($this->data
['userjsprev']) { ?
><script type
="<?php $this->text('jsmimetype') ?>"><?php
$this->html('userjsprev') ?
></script
><?php
} ?
>
72 <?php
if($this->data
['trackbackhtml']) print $this->data
['trackbackhtml']; ?
>
75 <body
<?php
if($this->data
['body_ondblclick']) { ?
>ondblclick
="<?php $this->text('body_ondblclick') ?>"<?php
} ?
>
76 <?php
if($this->data
['body_onload' ]) { ?
>onload
="<?php $this->text('body_onload') ?>"<?php
} ?
>
77 <?php
if($this->data
['nsclass' ]) { ?
>class="<?php $this->text('nsclass') ?>"<?php
} ?
>>
79 <div id
="globalWrapper">
80 <div id
="column-content">
82 <a name
="top" id
="top"></a
>
83 <?php
if($this->data
['sitenotice']) { ?
><div id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
><?php
} ?
>
84 <h1
class="firstHeading"><?php
$this->text('title') ?
></h1
>
85 <div id
="bodyContent">
86 <h3 id
="siteSub"><?php
$this->msg('tagline') ?
></h3
>
87 <div id
="contentSub"><?php
$this->html('subtitle') ?
></div
>
88 <?php
if($this->data
['undelete']) { ?
><div id
="contentSub2"><?php
$this->html('undelete') ?
></div
><?php
} ?
>
89 <?php
if($this->data
['newtalk'] ) { ?
><div
class="usermessage"><?php
$this->html('newtalk') ?
></div
><?php
} ?
>
90 <?php
if($this->data
['showjumplinks']) { ?
><div id
="jump-to-nav"><?php
$this->msg('jumpto') ?
> <a href
="#column-one"><?php
$this->msg('jumptonavigation') ?
></a
>, <a href
="#searchInput"><?php
$this->msg('jumptosearch') ?
></a
></div
><?php
} ?
>
91 <!-- start content
-->
92 <?php
$this->html('bodytext') ?
>
93 <?php
if($this->data
['catlinks']) { ?
><div id
="catlinks"><?php
$this->html('catlinks') ?
></div
><?php
} ?
>
95 <div
class="visualClear"></div
>
100 <div id
="p-cactions" class="portlet">
101 <h5
><?php
$this->msg('views') ?
></h5
>
103 <?php
foreach($this->data
['content_actions'] as $key => $tab) { ?
>
104 <li id
="ca-<?= htmlspecialchars($key) ?>"<?php
105 if($tab['class']) { ?
> class="<?= htmlspecialchars($tab['class']) ?>"<?php
}
106 ?
>><a href
="<?php echo htmlspecialchars($tab['href']) ?>"><?php
107 echo htmlspecialchars($tab['text']) ?
></a
></li
>
111 <div
class="portlet" id
="p-personal">
112 <h5
><?php
$this->msg('personaltools') ?
></h5
>
115 <?php
foreach($this->data
['personal_urls'] as $key => $item) { ?
>
116 <li id
="pt-<?php echo htmlspecialchars($key) ?>"<?php
117 if ($item['active']) { ?
> class="active"<?php
} ?
>><a href
="<?php
118 echo htmlspecialchars($item['href']) ?>"<?php
119 if(!empty($item['class'])) { ?
> class="<?php
120 echo htmlspecialchars($item['class']) ?>"<?php
} ?
>><?php
121 echo htmlspecialchars($item['text']) ?
></a
></li
>
126 <div
class="portlet" id
="p-logo">
127 <a style
="background-image: url(<?php $this->text('logopath') ?>);" <?php
128 ?
>href
="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" <?php
129 ?
>title
="<?php $this->msg('mainpage') ?>"></a
>
131 <script type
="<?php $this->text('jsmimetype') ?>"> if (window
.isMSIE55
) fixalpha(); </script
>
132 <?php
foreach ($this->data
['sidebar'] as $bar => $cont) { ?
>
133 <div
class='portlet' id
='p-<?php echo htmlspecialchars($bar) ?>'>
134 <h5
><?php
$out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?
></h5
>
137 <?php
foreach($cont as $key => $val) { ?
>
138 <li id
="<?= htmlspecialchars($val['id']) ?>"<?php
139 if ( $val['active'] ) { ?
> class="active" <?php
}
140 ?
>><a href
="<?= htmlspecialchars($val['href']) ?>"><?
= htmlspecialchars($val['text']) ?
></a
></li
>
146 <div id
="p-search" class="portlet">
147 <h5
><label
for="searchInput"><?php
$this->msg('search') ?
></label
></h5
>
149 <form action
="<?php $this->text('searchaction') ?>" id
="searchform"><div
>
150 <input id
="searchInput" name
="search" type
="text" <?php
151 if($this->haveMsg('accesskey-search')) {
152 ?
>accesskey
="<?php $this->msg('accesskey-search') ?>"<?php
}
153 if( isset( $this->data
['search'] ) ) {
154 ?
> value
="<?php $this->text('search') ?>"<?php
} ?
> />
155 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg('go') ?>" /> 
;
156 <input type
='submit' name
="fulltext" class="searchButton" value
="<?php $this->msg('search') ?>" />
160 <div
class="portlet" id
="p-tb">
161 <h5
><?php
$this->msg('toolbox') ?
></h5
>
165 if($this->data
['notspecialpage']) { ?
>
166 <li id
="t-whatlinkshere"><a href
="<?php
167 echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
168 ?>"><?
= $this->msg('whatlinkshere') ?
></a
></li
>
170 if( $this->data
['nav_urls']['recentchangeslinked'] ) { ?
>
171 <li id
="t-recentchangeslinked"><a href
="<?php
172 echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
173 ?>"><?
= $this->msg('recentchangeslinked') ?
></a
></li
>
176 if(isset($this->data
['nav_urls']['trackbacklink'])) { ?
>
177 <li id
="t-trackbacklink"><a href
="<?php
178 echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
179 ?>"><?php
echo $this->msg('trackbacklink') ?
></a
></li
>
181 if($this->data
['feeds']) { ?
>
182 <li id
="feedlinks"><?php
foreach($this->data
['feeds'] as $key => $feed) {
183 ?
><span id
="feed-<?= htmlspecialchars($key) ?>"><a href
="<?php
184 echo htmlspecialchars($feed['href']) ?>"><?
= htmlspecialchars($feed['text'])?
></a
> 
;</span
>
188 foreach( array('contributions', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) {
190 if($this->data
['nav_urls'][$special]) {
191 ?
><li id
="t-<?= $special ?>"><a href
="<?= htmlspecialchars($this->data['nav_urls'][$special]['href'])
192 ?>"><?php
$this->msg($special) ?
></a
></li
>
196 if(!empty($this->data
['nav_urls']['print']['href'])) { ?
>
197 <li id
="t-print"><a href
="<?= htmlspecialchars($this->data['nav_urls']['print']['href'])
198 ?>"><?
= $this->msg('printableversion') ?
></a
></li
><?php
201 if(!empty($this->data
['nav_urls']['permalink']['href'])) { ?
>
202 <li id
="t-permalink"><a href
="<?= htmlspecialchars($this->data['nav_urls']['permalink']['href'])
203 ?>"><?
= $this->msg('permalink') ?
></a
></li
><?php
204 } elseif ($this->data
['nav_urls']['permalink']['href'] === '') { ?
>
205 <li id
="t-ispermalink"><?
= $this->msg('permalink') ?
></li
><?php
208 wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );
214 if( $this->data
['language_urls'] ) { ?
>
215 <div id
="p-lang" class="portlet">
216 <h5
><?
= $this->msg('otherlanguages') ?
></h5
>
219 <?php
foreach($this->data
['language_urls'] as $langlink) { ?
>
220 <li
class="<?= htmlspecialchars($langlink['class'])?>"><?php
221 ?
><a href
="<?= htmlspecialchars($langlink['href']) ?>"><?
= $langlink['text'] ?
></a
></li
>
227 </div
><!-- end of the
left (by
default at least
) column
-->
228 <div
class="visualClear"></div
>
231 if($this->data
['poweredbyico']) { ?
>
232 <div id
="f-poweredbyico"><?php
$this->html('poweredbyico') ?
></div
>
234 if($this->data
['copyrightico']) { ?
>
235 <div id
="f-copyrightico"><?php
$this->html('copyrightico') ?
></div
>
238 // Generate additional footer links
242 $footerlinks = array(
243 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
244 'privacy', 'about', 'disclaimer', 'tagline',
246 foreach( $footerlinks as $aLink ) {
247 if( $this->data
[$aLink] ) {
248 ?
> <li id
="<?=$aLink?>"><?
= $this->html($aLink) ?
></li
>
254 <script type
="text/javascript"> if (window
.runOnloadHook
) runOnloadHook();</script
>
256 <?
= $this->html('reporttime') ?
>
261 } // end of execute() method