4 * Default skin for HTML dumps, based on MonoBook.php
7 if( !defined( 'MEDIAWIKI' ) )
11 require_once( 'includes/SkinTemplate.php' );
14 * Inherit main code from SkinTemplate, set the CSS and template filter.
19 class SkinHTMLDump
extends SkinTemplate
{
20 /** Using monobook. */
21 function initPage( &$out ) {
22 SkinTemplate
::initPage( $out );
23 $this->template
= 'HTMLDumpTemplate';
26 function buildSidebar() {
27 $sections = parent
::buildSidebar();
28 $badMessages = array( 'recentchanges-url', 'randompage-url' );
30 foreach ( $badMessages as $msg ) {
31 $badUrls[] = $this->makeInternalOrExternalUrl( wfMsgForContent( $msg ) );
34 foreach ( $sections as $heading => $section ) {
35 foreach ( $section as $index => $link ) {
36 if ( in_array( $link['href'], $badUrls ) ) {
37 unset( $sections[$heading][$index] );
44 function buildContentActionUrls() {
47 $content_actions = array();
48 $nskey = $this->getNameSpaceKey();
49 $content_actions[$nskey] = $this->tabAction(
50 $this->mTitle
->getSubjectPage(),
52 !$this->mTitle
->isTalkPage() );
54 $content_actions['talk'] = $this->tabAction(
55 $this->mTitle
->getTalkPage(),
57 $this->mTitle
->isTalkPage(),
61 if ( isset( $wgHTMLDump ) ) {
62 $content_actions['current'] = array(
63 'text' => wfMsg( 'currentrev' ),
64 'href' => str_replace( '$1', wfUrlencode( $this->mTitle
->getPrefixedDBkey() ),
65 $wgHTMLDump->oldArticlePath
),
69 return $content_actions;
72 function makeBrokenLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
73 if ( !isset( $nt ) ) {
74 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
77 if ( $nt->getNamespace() == NS_CATEGORY
) {
78 return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
82 $text = $nt->getPrefixedText();
84 return $prefix . $text . $trail;
93 class HTMLDumpTemplate
extends QuickTemplate
{
95 * Template filter callback for MonoBook skin.
96 * Takes an associative array of data set from a SkinTemplate-based
97 * class, and a wrapper for MediaWiki's localization database, and
98 * outputs a formatted page.
103 wfSuppressWarnings();
104 ?
><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
105 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="<?php $this->text('lang') ?>" lang
="<?php $this->text('lang') ?>" dir
="<?php $this->text('dir') ?>">
107 <meta http
-equiv
="Content-Type" content
="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
108 <?php
$this->html('headlinks') ?
>
109 <title
><?php
$this->text('pagetitle') ?
></title
>
110 <style type
="text/css">/*<![CDATA[*/ @import
"<?php $this->text('stylepath') ?>/htmldump/main.css"; /*]]>*/</style
>
111 <link rel
="stylesheet" type
="text/css" media
="print" href
="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
112 <!--[if lt IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style
><![endif]-->
113 <!--[if IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style
><![endif]-->
114 <!--[if IE
6]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style
><![endif]-->
115 <!--[if IE
]><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script
>
116 <meta http
-equiv
="imagetoolbar" content
="no" /><![endif]-->
117 <?php
if($this->data
['jsvarurl' ]) { ?
><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('jsvarurl' ) ?>"></script
><?php
} ?
>
118 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath' ) ?>/common/wikibits.js"></script
>
119 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath' ) ?>/htmldump/md5.js"></script
>
120 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath' ) ?>/htmldump/utf8.js"></script
>
121 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath' ) ?>/htmldump/lookup.js"></script
>
122 <?php
if($this->data
['pagecss' ]) { ?
><style type
="text/css"><?php
$this->html('pagecss' ) ?
></style
><?php
} ?
>
123 <?php
if($this->data
['usercss' ]) { ?
><style type
="text/css"><?php
$this->html('usercss' ) ?
></style
><?php
} ?
>
124 <?php
if($this->data
['userjs' ]) { ?
><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('userjs' ) ?>"></script
><?php
} ?
>
125 <?php
if($this->data
['userjsprev']) { ?
><script type
="<?php $this->text('jsmimetype') ?>"><?php
$this->html('userjsprev') ?
></script
><?php
} ?
>
128 <?php
if($this->data
['nsclass' ]) { ?
>class="<?php $this->text('nsclass') ?>"<?php
} ?
>>
129 <div id
="globalWrapper">
130 <div id
="column-content">
132 <a name
="top" id
="contentTop"></a
>
133 <?php
if($this->data
['sitenotice']) { ?
><div id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
><?php
} ?
>
134 <h1
class="firstHeading"><?php
$this->text('title') ?
></h1
>
135 <div id
="bodyContent">
136 <h3 id
="siteSub"><?php
$this->msg('tagline') ?
></h3
>
137 <div id
="contentSub"><?php
$this->html('subtitle') ?
></div
>
138 <?php
if($this->data
['undelete']) { ?
><div id
="contentSub"><?php
$this->html('undelete') ?
></div
><?php
} ?
>
139 <?php
if($this->data
['newtalk'] ) { ?
><div
class="usermessage"><?php
$this->html('newtalk') ?
></div
><?php
} ?
>
140 <!-- start content
-->
141 <?php
$this->html('bodytext') ?
>
142 <?php
if($this->data
['catlinks']) { ?
><div id
="catlinks"><?php
$this->html('catlinks') ?
></div
><?php
} ?
>
144 <div
class="visualClear"></div
>
148 <div id
="column-one">
149 <div id
="p-cactions" class="portlet">
152 <?php
foreach($this->data
['content_actions'] as $key => $action) {
153 ?
><li id
="ca-<?php echo htmlspecialchars($key) ?>"
154 <?php
if($action['class']) { ?
>class="<?php echo htmlspecialchars($action['class']) ?>"<?php
} ?
>
155 ><a href
="<?php echo htmlspecialchars($action['href']) ?>"><?php
156 echo htmlspecialchars($action['text']) ?
></a
></li
><?php
160 <div
class="portlet" id
="p-logo">
161 <a style
="background-image: url(<?php $this->text('logopath') ?>);"
162 href
="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"
163 title
="<?php $this->msg('mainpage') ?>"></a
>
165 <script type
="<?php $this->text('jsmimetype') ?>"> if (window
.isMSIE55
) fixalpha(); </script
>
166 <?php
foreach ($this->data
['sidebar'] as $bar => $cont) { ?
>
167 <div
class='portlet' id
='p-<?php echo htmlspecialchars($bar) ?>'>
168 <h5
><?php
$this->msg( $bar ) ?
></h5
>
171 <?php
foreach($cont as $key => $val) { ?
>
172 <li id
="<?php echo htmlspecialchars($val['id']) ?>"><a href
="<?php echo htmlspecialchars($val['href']) ?>"><?php
echo htmlspecialchars($val['text'])?
></a
></li
>
178 <div id
="p-search" class="portlet">
179 <h5
><label
for="searchInput"><?php
$this->msg('search') ?
></label
></h5
>
181 <form action
="javascript:goToStatic(3)" id
="searchform"><div
>
182 <input id
="searchInput" name
="search" type
="text"
183 <?php
if($this->haveMsg('accesskey-search')) {
184 ?
>accesskey
="<?php $this->msg('accesskey-search') ?>"<?php
}
185 if( isset( $this->data
['search'] ) ) {
186 ?
> value
="<?php $this->text('search') ?>"<?php
} ?
> />
187 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton"
188 value
="<?php $this->msg('go') ?>" />
192 <?php
if( $this->data
['language_urls'] ) { ?
><div id
="p-lang" class="portlet">
193 <h5
><?php
$this->msg('otherlanguages') ?
></h5
>
196 <?php
foreach($this->data
['language_urls'] as $langlink) { ?
>
198 <a href
="<?php echo htmlspecialchars($langlink['href'])
199 ?>"><?php
echo $langlink['text'] ?
></a
>
206 </div
><!-- end of the
left (by
default at least
) column
-->
207 <div
class="visualClear"></div
>
209 <?php
if($this->data
['poweredbyico']) { ?
><div id
="f-poweredbyico"><?php
$this->html('poweredbyico') ?
></div
><?php
} ?
>
210 <?php
if($this->data
['copyrightico']) { ?
><div id
="f-copyrightico"><?php
$this->html('copyrightico') ?
></div
><?php
} ?
>
212 <?php
if($this->data
['lastmod' ]) { ?
><li id
="f-lastmod"><?php
$this->html('lastmod') ?
></li
><?php
} ?
>
213 <?php
if($this->data
['numberofwatchingusers' ]) { ?
><li id
="f-numberofwatchingusers"><?php
$this->html('numberofwatchingusers') ?
></li
><?php
} ?
>
214 <?php
if($this->data
['credits' ]) { ?
><li id
="f-credits"><?php
$this->html('credits') ?
></li
><?php
} ?
>
215 <?php
if($this->data
['copyright' ]) { ?
><li id
="f-copyright"><?php
$this->html('copyright') ?
></li
><?php
} ?
>
216 <?php
if($this->data
['about' ]) { ?
><li id
="f-about"><?php
$this->html('about') ?
></li
><?php
} ?
>
217 <?php
if($this->data
['disclaimer']) { ?
><li id
="f-disclaimer"><?php
$this->html('disclaimer') ?
></li
><?php
} ?
>
218 <?php
if($this->data
['tagline']) { ?
><li id
="f-tagline"><?php
echo $this->data
['tagline'] ?
></li
><?php
} ?
>