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 <?php
$this->html('headscripts') ?
>
59 <title
><?php
$this->text('pagetitle') ?
></title
>
60 <style type
="text/css" media
="screen,projection">/*<![CDATA[*/ @import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?5"; /*]]>*/</style
>
61 <link rel
="stylesheet" type
="text/css" <?php
if(empty($this->data
['printable']) ) { ?
>media
="print"<?php
} ?
> href
="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
62 <!--[if lt IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style
><![endif]-->
63 <!--[if IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style
><![endif]-->
64 <!--[if gte IE
6]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style
><![endif]-->
65 <!--[if IE
]><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script
>
66 <meta http
-equiv
="imagetoolbar" content
="no" /><![endif]-->
67 <?php
if($this->data
['jsvarurl' ]) { ?
>
68 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('jsvarurl' ) ?>"><!-- site js
--></script
>
70 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath' ) ?>/common/wikibits.js"><!-- wikibits js
--></script
>
71 <?php
if($this->data
['pagecss' ]) { ?
>
72 <style type
="text/css"><?php
$this->html('pagecss' ) ?
></style
>
74 if($this->data
['usercss' ]) { ?
>
75 <style type
="text/css"><?php
$this->html('usercss' ) ?
></style
>
77 if($this->data
['userjs' ]) { ?
>
78 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('userjs' ) ?>"></script
>
80 if($this->data
['userjsprev']) { ?
>
81 <script type
="<?php $this->text('jsmimetype') ?>"><?php
$this->html('userjsprev') ?
></script
>
83 if($this->data
['trackbackhtml']) print $this->data
['trackbackhtml']; ?
>
85 <body
<?php
if($this->data
['body_ondblclick']) { ?
>ondblclick
="<?php $this->text('body_ondblclick') ?>"<?php
} ?
>
86 <?php
if($this->data
['body_onload' ]) { ?
>onload
="<?php $this->text('body_onload') ?>"<?php
} ?
>
87 <?php
if($this->data
['nsclass' ]) { ?
>class="<?php $this->text('nsclass') ?>"<?php
} ?
>>
88 <div id
="globalWrapper">
89 <div id
="column-content">
91 <a name
="top" id
="top"></a
>
92 <?php
if($this->data
['sitenotice']) { ?
><div id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
><?php
} ?
>
93 <h1
class="firstHeading"><?php
$this->text('title') ?
></h1
>
94 <div id
="bodyContent">
95 <h3 id
="siteSub"><?php
$this->msg('tagline') ?
></h3
>
96 <div id
="contentSub"><?php
$this->html('subtitle') ?
></div
>
97 <?php
if($this->data
['undelete']) { ?
><div id
="contentSub2"><?php
$this->html('undelete') ?
></div
><?php
} ?
>
98 <?php
if($this->data
['newtalk'] ) { ?
><div
class="usermessage"><?php
$this->html('newtalk') ?
></div
><?php
} ?
>
99 <?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
} ?
>
100 <!-- start content
-->
101 <?php
$this->html('bodytext') ?
>
102 <?php
if($this->data
['catlinks']) { ?
><div id
="catlinks"><?php
$this->html('catlinks') ?
></div
><?php
} ?
>
104 <div
class="visualClear"></div
>
108 <div id
="column-one">
109 <div id
="p-cactions" class="portlet">
110 <h5
><?php
$this->msg('views') ?
></h5
>
112 <?php
foreach($this->data
['content_actions'] as $key => $tab) { ?
>
113 <li id
="ca-<?php echo htmlspecialchars($key) ?>"<?php
114 if($tab['class']) { ?
> class="<?php echo htmlspecialchars($tab['class']) ?>"<?php
}
115 ?
>><a href
="<?php echo htmlspecialchars($tab['href']) ?>"><?php
116 echo htmlspecialchars($tab['text']) ?
></a
></li
>
120 <div
class="portlet" id
="p-personal">
121 <h5
><?php
$this->msg('personaltools') ?
></h5
>
124 <?php
foreach($this->data
['personal_urls'] as $key => $item) { ?
>
125 <li id
="pt-<?php echo htmlspecialchars($key) ?>"<?php
126 if ($item['active']) { ?
> class="active"<?php
} ?
>><a href
="<?php
127 echo htmlspecialchars($item['href']) ?>"<?php
128 if(!empty($item['class'])) { ?
> class="<?php
129 echo htmlspecialchars($item['class']) ?>"<?php
} ?
>><?php
130 echo htmlspecialchars($item['text']) ?
></a
></li
>
135 <div
class="portlet" id
="p-logo">
136 <a style
="background-image: url(<?php $this->text('logopath') ?>);" <?php
137 ?
>href
="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" <?php
138 ?
>title
="<?php $this->msg('mainpage') ?>"></a
>
140 <script type
="<?php $this->text('jsmimetype') ?>"> if (window
.isMSIE55
) fixalpha(); </script
>
141 <?php
foreach ($this->data
['sidebar'] as $bar => $cont) { ?
>
142 <div
class='portlet' id
='p-<?php echo htmlspecialchars($bar) ?>'>
143 <h5
><?php
$out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?
></h5
>
146 <?php
foreach($cont as $key => $val) { ?
>
147 <li id
="<?php echo htmlspecialchars($val['id']) ?>"<?php
148 if ( $val['active'] ) { ?
> class="active" <?php
}
149 ?
>><a href
="<?php echo htmlspecialchars($val['href']) ?>"><?php
echo htmlspecialchars($val['text']) ?
></a
></li
>
155 <div id
="p-search" class="portlet">
156 <h5
><label
for="searchInput"><?php
$this->msg('search') ?
></label
></h5
>
158 <form action
="<?php $this->text('searchaction') ?>" id
="searchform"><div
>
159 <input id
="searchInput" name
="search" type
="text" <?php
160 if($this->haveMsg('accesskey-search')) {
161 ?
>accesskey
="<?php $this->msg('accesskey-search') ?>"<?php
}
162 if( isset( $this->data
['search'] ) ) {
163 ?
> value
="<?php $this->text('search') ?>"<?php
} ?
> />
164 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg('go') ?>" /> 
;
165 <input type
='submit' name
="fulltext" class="searchButton" value
="<?php $this->msg('search') ?>" />
169 <div
class="portlet" id
="p-tb">
170 <h5
><?php
$this->msg('toolbox') ?
></h5
>
174 if($this->data
['notspecialpage']) { ?
>
175 <li id
="t-whatlinkshere"><a href
="<?php
176 echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
177 ?>"><?php
$this->msg('whatlinkshere') ?
></a
></li
>
179 if( $this->data
['nav_urls']['recentchangeslinked'] ) { ?
>
180 <li id
="t-recentchangeslinked"><a href
="<?php
181 echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
182 ?>"><?php
$this->msg('recentchangeslinked') ?
></a
></li
>
185 if(isset($this->data
['nav_urls']['trackbacklink'])) { ?
>
186 <li id
="t-trackbacklink"><a href
="<?php
187 echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
188 ?>"><?php
$this->msg('trackbacklink') ?
></a
></li
>
190 if($this->data
['feeds']) { ?
>
191 <li id
="feedlinks"><?php
foreach($this->data
['feeds'] as $key => $feed) {
192 ?
><span id
="feed-<?php echo htmlspecialchars($key) ?>"><a href
="<?php
193 echo htmlspecialchars($feed['href']) ?>"><?php
echo htmlspecialchars($feed['text'])?
></a
> 
;</span
>
197 foreach( array('contributions', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) {
199 if($this->data
['nav_urls'][$special]) {
200 ?
><li id
="t-<?php echo $special ?>"><a href
="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
201 ?>"><?php
$this->msg($special) ?
></a
></li
>
205 if(!empty($this->data
['nav_urls']['print']['href'])) { ?
>
206 <li id
="t-print"><a href
="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href'])
207 ?>"><?php
$this->msg('printableversion') ?
></a
></li
><?php
210 if(!empty($this->data
['nav_urls']['permalink']['href'])) { ?
>
211 <li id
="t-permalink"><a href
="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href'])
212 ?>"><?php
$this->msg('permalink') ?
></a
></li
><?php
213 } elseif ($this->data
['nav_urls']['permalink']['href'] === '') { ?
>
214 <li id
="t-ispermalink"><?php
$this->msg('permalink') ?
></li
><?php
217 wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );
223 if( $this->data
['language_urls'] ) { ?
>
224 <div id
="p-lang" class="portlet">
225 <h5
><?php
$this->msg('otherlanguages') ?
></h5
>
228 <?php
foreach($this->data
['language_urls'] as $langlink) { ?
>
229 <li
class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
230 ?
><a href
="<?php echo htmlspecialchars($langlink['href']) ?>"><?php
echo $langlink['text'] ?
></a
></li
>
236 </div
><!-- end of the
left (by
default at least
) column
-->
237 <div
class="visualClear"></div
>
240 if($this->data
['poweredbyico']) { ?
>
241 <div id
="f-poweredbyico"><?php
$this->html('poweredbyico') ?
></div
>
243 if($this->data
['copyrightico']) { ?
>
244 <div id
="f-copyrightico"><?php
$this->html('copyrightico') ?
></div
>
247 // Generate additional footer links
251 $footerlinks = array(
252 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
253 'privacy', 'about', 'disclaimer', 'tagline',
255 foreach( $footerlinks as $aLink ) {
256 if( $this->data
[$aLink] ) {
257 ?
> <li id
="<?php echo$aLink?>"><?php
$this->html($aLink) ?
></li
>
263 <script type
="text/javascript"> if (window
.runOnloadHook
) runOnloadHook();</script
>
265 <?php
$this->html('reporttime') ?
>
270 } // end of execute() method