5 * Translated from gwicke's previous TAL template version to remove
6 * dependency on PHPTAL.
12 if( !defined( 'MEDIAWIKI' ) )
16 require_once('includes/SkinTemplate.php');
19 * Inherit main code from SkinTemplate, set the CSS and template filter.
23 class SkinMonoBook
extends SkinTemplate
{
24 /** Using monobook. */
25 function initPage( &$out ) {
26 SkinTemplate
::initPage( $out );
27 $this->skinname
= 'monobook';
28 $this->stylename
= 'monobook';
29 $this->template
= 'MonoBookTemplate';
37 class MonoBookTemplate
extends QuickTemplate
{
39 * Template filter callback for MonoBook skin.
40 * Takes an associative array of data set from a SkinTemplate-based
41 * class, and a wrapper for MediaWiki's localization database, and
42 * outputs a formatted page.
48 $skin = $wgUser->getSkin();
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
="<?php $this->text('xhtmldefaultnamespace') ?>" <?php
55 foreach($this->data
['xhtmlnamespaces'] as $tag => $ns) {
56 ?
>xmlns
:<?php
echo "{$tag}=\"{$ns}\" ";
57 } ?
>xml
:lang
="<?php $this->text('lang') ?>" lang
="<?php $this->text('lang') ?>" dir
="<?php $this->text('dir') ?>">
59 <meta http
-equiv
="Content-Type" content
="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
60 <?php
$this->html('headlinks') ?
>
61 <title
><?php
$this->text('pagetitle') ?
></title
>
62 <style type
="text/css" media
="screen,projection">/*<![CDATA[*/ @import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?<?php echo $GLOBALS['wgStyleVersion'] ?>"; /*]]>*/</style
>
63 <link rel
="stylesheet" type
="text/css" <?php
if(empty($this->data
['printable']) ) { ?
>media
="print"<?php
} ?
> href
="<?php $this->text('stylepath') ?>/common/commonPrint.css?<?php echo $GLOBALS['wgStyleVersion'] ?>" />
64 <link rel
="stylesheet" type
="text/css" media
="handheld" href
="<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/handheld.css?<?php echo $GLOBALS['wgStyleVersion'] ?>" />
65 <!--[if lt IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style
><![endif]-->
66 <!--[if IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style
><![endif]-->
67 <!--[if IE
6]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style
><![endif]-->
68 <!--[if IE
7]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE70Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style
><![endif]-->
69 <!--[if lt IE
7]><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath') ?>/common/IEFixes.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script
>
70 <meta http
-equiv
="imagetoolbar" content
="no" /><![endif]-->
72 <?php
print Skin
::makeGlobalVariablesScript( $this->data
); ?
>
74 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js
--></script
>
75 <?php
if($this->data
['jsvarurl' ]) { ?
>
76 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('jsvarurl' ) ?>"><!-- site js
--></script
>
78 <?php
if($this->data
['pagecss' ]) { ?
>
79 <style type
="text/css"><?php
$this->html('pagecss' ) ?
></style
>
81 if($this->data
['usercss' ]) { ?
>
82 <style type
="text/css"><?php
$this->html('usercss' ) ?
></style
>
84 if($this->data
['userjs' ]) { ?
>
85 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('userjs' ) ?>"></script
>
87 if($this->data
['userjsprev']) { ?
>
88 <script type
="<?php $this->text('jsmimetype') ?>"><?php
$this->html('userjsprev') ?
></script
>
90 if($this->data
['trackbackhtml']) print $this->data
['trackbackhtml']; ?
>
92 <?php
$this->html('headscripts') ?
>
94 <body
<?php
if($this->data
['body_ondblclick']) { ?
>ondblclick
="<?php $this->text('body_ondblclick') ?>"<?php
} ?
>
95 <?php
if($this->data
['body_onload' ]) { ?
>onload
="<?php $this->text('body_onload') ?>"<?php
} ?
>
96 class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?>">
97 <div id
="globalWrapper">
98 <div id
="column-content">
100 <a name
="top" id
="top"></a
>
101 <?php
if($this->data
['sitenotice']) { ?
><div id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
><?php
} ?
>
102 <h1
class="firstHeading"><?php
$this->data
['displaytitle']!=""?
$this->html('title'):$this->text('title') ?
></h1
>
103 <div id
="bodyContent">
104 <h3 id
="siteSub"><?php
$this->msg('tagline') ?
></h3
>
105 <div id
="contentSub"><?php
$this->html('subtitle') ?
></div
>
106 <?php
if($this->data
['undelete']) { ?
><div id
="contentSub2"><?php
$this->html('undelete') ?
></div
><?php
} ?
>
107 <?php
if($this->data
['newtalk'] ) { ?
><div
class="usermessage"><?php
$this->html('newtalk') ?
></div
><?php
} ?
>
108 <?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
} ?
>
109 <!-- start content
-->
110 <?php
$this->html('bodytext') ?
>
111 <?php
if($this->data
['catlinks']) { ?
><div id
="catlinks"><?php
$this->html('catlinks') ?
></div
><?php
} ?
>
113 <div
class="visualClear"></div
>
117 <div id
="column-one">
118 <div id
="p-cactions" class="portlet">
119 <h5
><?php
$this->msg('views') ?
></h5
>
122 <?php
foreach($this->data
['content_actions'] as $key => $tab) { ?
>
123 <li id
="ca-<?php echo Sanitizer::escapeId($key) ?>"<?php
124 if($tab['class']) { ?
> class="<?php echo htmlspecialchars($tab['class']) ?>"<?php
}
125 ?
>><a href
="<?php echo htmlspecialchars($tab['href']) ?>"<?php
echo $skin->tooltipAndAccesskey('ca-'.$key) ?
>><?php
126 echo htmlspecialchars($tab['text']) ?
></a
></li
>
131 <div
class="portlet" id
="p-personal">
132 <h5
><?php
$this->msg('personaltools') ?
></h5
>
135 <?php
foreach($this->data
['personal_urls'] as $key => $item) { ?
>
136 <li id
="pt-<?php echo Sanitizer::escapeId($key) ?>"<?php
137 if ($item['active']) { ?
> class="active"<?php
} ?
>><a href
="<?php
138 echo htmlspecialchars($item['href']) ?>"<?php
echo $skin->tooltipAndAccesskey('pt-'.$key) ?
><?php
139 if(!empty($item['class'])) { ?
> class="<?php
140 echo htmlspecialchars($item['class']) ?>"<?php
} ?
>><?php
141 echo htmlspecialchars($item['text']) ?
></a
></li
>
146 <div
class="portlet" id
="p-logo">
147 <a style
="background-image: url(<?php $this->text('logopath') ?>);" <?php
148 ?
>href
="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"<?php
149 echo $skin->tooltipAndAccesskey('n-mainpage') ?
>></a
>
151 <script type
="<?php $this->text('jsmimetype') ?>"> if (window
.isMSIE55
) fixalpha(); </script
>
152 <?php
foreach ($this->data
['sidebar'] as $bar => $cont) { ?
>
153 <div
class='portlet' id
='p-<?php echo Sanitizer::escapeId($bar) ?>'<?php
echo $skin->tooltip('p-'.$bar) ?
>>
154 <h5
><?php
$out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?
></h5
>
157 <?php
foreach($cont as $key => $val) { ?
>
158 <li id
="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php
159 if ( $val['active'] ) { ?
> class="active" <?php
}
160 ?
>><a href
="<?php echo htmlspecialchars($val['href']) ?>"<?php
echo $skin->tooltipAndAccesskey($val['id']) ?
>><?php
echo htmlspecialchars($val['text']) ?
></a
></li
>
166 <div id
="p-search" class="portlet">
167 <h5
><label
for="searchInput"><?php
$this->msg('search') ?
></label
></h5
>
168 <div id
="searchBody" class="pBody">
169 <form action
="<?php $this->text('searchaction') ?>" id
="searchform"><div
>
170 <input id
="searchInput" name
="search" type
="text"<?php
echo $skin->tooltipAndAccesskey('search');
171 if( isset( $this->data
['search'] ) ) {
172 ?
> value
="<?php $this->text('search') ?>"<?php
} ?
> />
173 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg('searcharticle') ?>" /> 
;
174 <input type
='submit' name
="fulltext" class="searchButton" id
="mw-searchButton" value
="<?php $this->msg('searchbutton') ?>" />
178 <div
class="portlet" id
="p-tb">
179 <h5
><?php
$this->msg('toolbox') ?
></h5
>
183 if($this->data
['notspecialpage']) { ?
>
184 <li id
="t-whatlinkshere"><a href
="<?php
185 echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
186 ?>"<?php
echo $skin->tooltipAndAccesskey('t-whatlinkshere') ?
>><?php
$this->msg('whatlinkshere') ?
></a
></li
>
188 if( $this->data
['nav_urls']['recentchangeslinked'] ) { ?
>
189 <li id
="t-recentchangeslinked"><a href
="<?php
190 echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
191 ?>"<?php
echo $skin->tooltipAndAccesskey('t-recentchangeslinked') ?
>><?php
$this->msg('recentchangeslinked') ?
></a
></li
>
194 if(isset($this->data
['nav_urls']['trackbacklink'])) { ?
>
195 <li id
="t-trackbacklink"><a href
="<?php
196 echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
197 ?>"<?php
echo $skin->tooltipAndAccesskey('t-trackbacklink') ?
>><?php
$this->msg('trackbacklink') ?
></a
></li
>
199 if($this->data
['feeds']) { ?
>
200 <li id
="feedlinks"><?php
foreach($this->data
['feeds'] as $key => $feed) {
201 ?
><span id
="feed-<?php echo Sanitizer::escapeId($key) ?>"><a href
="<?php
202 echo htmlspecialchars($feed['href']) ?>"<?php
echo $skin->tooltipAndAccesskey('feed-'.$key) ?
>><?php
echo htmlspecialchars($feed['text'])?
></a
> 
;</span
>
206 foreach( array('contributions', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) {
208 if($this->data
['nav_urls'][$special]) {
209 ?
><li id
="t-<?php echo $special ?>"><a href
="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
210 ?>"<?php
echo $skin->tooltipAndAccesskey('t-'.$special) ?
>><?php
$this->msg($special) ?
></a
></li
>
214 if(!empty($this->data
['nav_urls']['print']['href'])) { ?
>
215 <li id
="t-print"><a href
="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href'])
216 ?>"<?php
echo $skin->tooltipAndAccesskey('t-print') ?
>><?php
$this->msg('printableversion') ?
></a
></li
><?php
219 if(!empty($this->data
['nav_urls']['permalink']['href'])) { ?
>
220 <li id
="t-permalink"><a href
="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href'])
221 ?>"<?php
echo $skin->tooltipAndAccesskey('t-permalink') ?
>><?php
$this->msg('permalink') ?
></a
></li
><?php
222 } elseif ($this->data
['nav_urls']['permalink']['href'] === '') { ?
>
223 <li id
="t-ispermalink"<?php
echo $skin->tooltip('t-ispermalink') ?
>><?php
$this->msg('permalink') ?
></li
><?php
226 wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );
232 if( $this->data
['language_urls'] ) { ?
>
233 <div id
="p-lang" class="portlet">
234 <h5
><?php
$this->msg('otherlanguages') ?
></h5
>
237 <?php
foreach($this->data
['language_urls'] as $langlink) { ?
>
238 <li
class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
239 ?
><a href
="<?php echo htmlspecialchars($langlink['href']) ?>"><?php
echo $langlink['text'] ?
></a
></li
>
245 </div
><!-- end of the
left (by
default at least
) column
-->
246 <div
class="visualClear"></div
>
249 if($this->data
['poweredbyico']) { ?
>
250 <div id
="f-poweredbyico"><?php
$this->html('poweredbyico') ?
></div
>
252 if($this->data
['copyrightico']) { ?
>
253 <div id
="f-copyrightico"><?php
$this->html('copyrightico') ?
></div
>
256 // Generate additional footer links
260 $footerlinks = array(
261 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
262 'privacy', 'about', 'disclaimer', 'tagline',
264 foreach( $footerlinks as $aLink ) {
265 if( isset( $this->data
[$aLink] ) && $this->data
[$aLink] ) {
266 ?
> <li id
="<?php echo$aLink?>"><?php
$this->html($aLink) ?
></li
>
273 <?php
$this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?
>
275 <?php
$this->html('reporttime') ?
>
276 <?php
if ( $this->data
['debug'] ): ?
>
278 <?php
$this->text( 'debug' ); ?
>
285 } // end of execute() method