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?9"; /*]]>*/</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 IE
6]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style
><![endif]-->
64 <!--[if IE
7]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE70Fixes.css?1";</style
><![endif]-->
65 <!--[if lt IE
7]><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script
>
66 <meta http
-equiv
="imagetoolbar" content
="no" /><![endif]-->
68 <?php
print Skin
::makeGlobalVariablesScript( $this->data
); ?
>
70 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath' ) ?>/common/wikibits.js?1"><!-- wikibits js
--></script
>
71 <?php
if($this->data
['jsvarurl' ]) { ?
>
72 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('jsvarurl' ) ?>"><!-- site js
--></script
>
74 <?php
if($this->data
['pagecss' ]) { ?
>
75 <style type
="text/css"><?php
$this->html('pagecss' ) ?
></style
>
77 if($this->data
['usercss' ]) { ?
>
78 <style type
="text/css"><?php
$this->html('usercss' ) ?
></style
>
80 if($this->data
['userjs' ]) { ?
>
81 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('userjs' ) ?>"></script
>
83 if($this->data
['userjsprev']) { ?
>
84 <script type
="<?php $this->text('jsmimetype') ?>"><?php
$this->html('userjsprev') ?
></script
>
86 if($this->data
['trackbackhtml']) print $this->data
['trackbackhtml']; ?
>
88 <?php
$this->html('headscripts') ?
>
90 <body
<?php
if($this->data
['body_ondblclick']) { ?
>ondblclick
="<?php $this->text('body_ondblclick') ?>"<?php
} ?
>
91 <?php
if($this->data
['body_onload' ]) { ?
>onload
="<?php $this->text('body_onload') ?>"<?php
} ?
>
92 class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?>">
93 <div id
="globalWrapper">
94 <div id
="column-content">
96 <a name
="top" id
="top"></a
>
97 <?php
if($this->data
['sitenotice']) { ?
><div id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
><?php
} ?
>
98 <h1
class="firstHeading"><?php
$this->data
['displaytitle']!=""?
$this->html('title'):$this->text('title') ?
></h1
>
99 <div id
="bodyContent">
100 <h3 id
="siteSub"><?php
$this->msg('tagline') ?
></h3
>
101 <div id
="contentSub"><?php
$this->html('subtitle') ?
></div
>
102 <?php
if($this->data
['undelete']) { ?
><div id
="contentSub2"><?php
$this->html('undelete') ?
></div
><?php
} ?
>
103 <?php
if($this->data
['newtalk'] ) { ?
><div
class="usermessage"><?php
$this->html('newtalk') ?
></div
><?php
} ?
>
104 <?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
} ?
>
105 <!-- start content
-->
106 <?php
$this->html('bodytext') ?
>
107 <?php
if($this->data
['catlinks']) { ?
><div id
="catlinks"><?php
$this->html('catlinks') ?
></div
><?php
} ?
>
109 <div
class="visualClear"></div
>
113 <div id
="column-one">
114 <div id
="p-cactions" class="portlet">
115 <h5
><?php
$this->msg('views') ?
></h5
>
117 <?php
foreach($this->data
['content_actions'] as $key => $tab) { ?
>
118 <li id
="ca-<?php echo htmlspecialchars($key) ?>"<?php
119 if($tab['class']) { ?
> class="<?php echo htmlspecialchars($tab['class']) ?>"<?php
}
120 ?
>><a href
="<?php echo htmlspecialchars($tab['href']) ?>"><?php
121 echo htmlspecialchars($tab['text']) ?
></a
></li
>
125 <div
class="portlet" id
="p-personal">
126 <h5
><?php
$this->msg('personaltools') ?
></h5
>
129 <?php
foreach($this->data
['personal_urls'] as $key => $item) { ?
>
130 <li id
="pt-<?php echo htmlspecialchars($key) ?>"<?php
131 if ($item['active']) { ?
> class="active"<?php
} ?
>><a href
="<?php
132 echo htmlspecialchars($item['href']) ?>"<?php
133 if(!empty($item['class'])) { ?
> class="<?php
134 echo htmlspecialchars($item['class']) ?>"<?php
} ?
>><?php
135 echo htmlspecialchars($item['text']) ?
></a
></li
>
140 <div
class="portlet" id
="p-logo">
141 <a style
="background-image: url(<?php $this->text('logopath') ?>);" <?php
142 ?
>href
="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" <?php
143 ?
>title
="<?php $this->msg('mainpage') ?>"></a
>
145 <script type
="<?php $this->text('jsmimetype') ?>"> if (window
.isMSIE55
) fixalpha(); </script
>
146 <?php
foreach ($this->data
['sidebar'] as $bar => $cont) { ?
>
147 <div
class='portlet' id
='p-<?php echo htmlspecialchars($bar) ?>'>
148 <h5
><?php
$out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?
></h5
>
151 <?php
foreach($cont as $key => $val) { ?
>
152 <li id
="<?php echo htmlspecialchars($val['id']) ?>"<?php
153 if ( $val['active'] ) { ?
> class="active" <?php
}
154 ?
>><a href
="<?php echo htmlspecialchars($val['href']) ?>"><?php
echo htmlspecialchars($val['text']) ?
></a
></li
>
160 <div id
="p-search" class="portlet">
161 <h5
><label
for="searchInput"><?php
$this->msg('search') ?
></label
></h5
>
162 <div id
="searchBody" class="pBody">
163 <form action
="<?php $this->text('searchaction') ?>" id
="searchform"><div
>
164 <input id
="searchInput" name
="search" type
="text" <?php
165 if($this->haveMsg('accesskey-search')) {
166 ?
>accesskey
="<?php $this->msg('accesskey-search') ?>"<?php
}
167 if( isset( $this->data
['search'] ) ) {
168 ?
> value
="<?php $this->text('search') ?>"<?php
} ?
> />
169 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg('searcharticle') ?>" /> 
;
170 <input type
='submit' name
="fulltext" class="searchButton" value
="<?php $this->msg('searchbutton') ?>" />
174 <div
class="portlet" id
="p-tb">
175 <h5
><?php
$this->msg('toolbox') ?
></h5
>
179 if($this->data
['notspecialpage']) { ?
>
180 <li id
="t-whatlinkshere"><a href
="<?php
181 echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
182 ?>"><?php
$this->msg('whatlinkshere') ?
></a
></li
>
184 if( $this->data
['nav_urls']['recentchangeslinked'] ) { ?
>
185 <li id
="t-recentchangeslinked"><a href
="<?php
186 echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
187 ?>"><?php
$this->msg('recentchangeslinked') ?
></a
></li
>
190 if(isset($this->data
['nav_urls']['trackbacklink'])) { ?
>
191 <li id
="t-trackbacklink"><a href
="<?php
192 echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
193 ?>"><?php
$this->msg('trackbacklink') ?
></a
></li
>
195 if($this->data
['feeds']) { ?
>
196 <li id
="feedlinks"><?php
foreach($this->data
['feeds'] as $key => $feed) {
197 ?
><span id
="feed-<?php echo htmlspecialchars($key) ?>"><a href
="<?php
198 echo htmlspecialchars($feed['href']) ?>"><?php
echo htmlspecialchars($feed['text'])?
></a
> 
;</span
>
202 foreach( array('contributions', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) {
204 if($this->data
['nav_urls'][$special]) {
205 ?
><li id
="t-<?php echo $special ?>"><a href
="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
206 ?>"><?php
$this->msg($special) ?
></a
></li
>
210 if(!empty($this->data
['nav_urls']['print']['href'])) { ?
>
211 <li id
="t-print"><a href
="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href'])
212 ?>"><?php
$this->msg('printableversion') ?
></a
></li
><?php
215 if(!empty($this->data
['nav_urls']['permalink']['href'])) { ?
>
216 <li id
="t-permalink"><a href
="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href'])
217 ?>"><?php
$this->msg('permalink') ?
></a
></li
><?php
218 } elseif ($this->data
['nav_urls']['permalink']['href'] === '') { ?
>
219 <li id
="t-ispermalink"><?php
$this->msg('permalink') ?
></li
><?php
222 wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );
228 if( $this->data
['language_urls'] ) { ?
>
229 <div id
="p-lang" class="portlet">
230 <h5
><?php
$this->msg('otherlanguages') ?
></h5
>
233 <?php
foreach($this->data
['language_urls'] as $langlink) { ?
>
234 <li
class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
235 ?
><a href
="<?php echo htmlspecialchars($langlink['href']) ?>"><?php
echo $langlink['text'] ?
></a
></li
>
241 </div
><!-- end of the
left (by
default at least
) column
-->
242 <div
class="visualClear"></div
>
245 if($this->data
['poweredbyico']) { ?
>
246 <div id
="f-poweredbyico"><?php
$this->html('poweredbyico') ?
></div
>
248 if($this->data
['copyrightico']) { ?
>
249 <div id
="f-copyrightico"><?php
$this->html('copyrightico') ?
></div
>
252 // Generate additional footer links
256 $footerlinks = array(
257 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
258 'privacy', 'about', 'disclaimer', 'tagline',
260 foreach( $footerlinks as $aLink ) {
261 if( $this->data
[$aLink] ) {
262 ?
> <li id
="<?php echo$aLink?>"><?php
$this->html($aLink) ?
></li
>
269 <?php
$this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?
>
271 <?php
$this->html('reporttime') ?
>
272 <?php
if ( $this->data
['debug'] ): ?
>
274 <?php
$this->text( 'debug' ); ?
>
281 } // end of execute() method