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 getNavigationLinks() {
27 $links = parent
::getNavigationLinks();
28 foreach ( $links as $index => $link ) {
29 if ( $link['href'] == 'recentchanges-url' ) {
30 unset( $links[$index] );
32 if ( $link['href'] == 'randompage-url' ) {
33 unset( $links[$index] );
39 function buildContentActionUrls() {
40 $content_actions = array();
41 $nskey = $this->getNameSpaceKey();
42 $content_actions[$nskey] = $this->tabAction(
43 $this->mTitle
->getSubjectPage(),
45 !$this->mTitle
->isTalkPage() );
47 $content_actions['talk'] = $this->tabAction(
48 $this->mTitle
->getTalkPage(),
50 $this->mTitle
->isTalkPage(),
53 return $content_actions;
56 function makeBrokenLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
57 if ( !isset( $nt ) ) {
58 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
61 if ( $nt->getNamespace() == NS_CATEGORY
) {
62 return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
66 $text = $nt->getPrefixedText();
68 return $prefix . $text . $trail;
77 class HTMLDumpTemplate
extends QuickTemplate
{
79 * Template filter callback for MonoBook skin.
80 * Takes an associative array of data set from a SkinTemplate-based
81 * class, and a wrapper for MediaWiki's localization database, and
82 * outputs a formatted page.
88 $this->reallyExecute();
92 function modifySetup() {
94 foreach ( $this->data['navigation_urls'] as $index => $link ) {
95 if ( $link['text'] == 'recentchanges' ) {
96 unset( $this->data['navigation_urls'][$index] );
97 } elseif ( $link['text'] */
100 function reallyExecute() {
101 wfSuppressWarnings();
102 ?
><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
103 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="<?php $this->text('lang') ?>" lang
="<?php $this->text('lang') ?>" dir
="<?php $this->text('dir') ?>">
105 <meta http
-equiv
="Content-Type" content
="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
106 <?php
$this->html('headlinks') ?
>
107 <title
><?php
$this->text('pagetitle') ?
></title
>
108 <style type
="text/css" media
="screen,projection">/*<![CDATA[*/ @import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css"; /*]]>*/</style
>
109 <link rel
="stylesheet" type
="text/css" media
="print" href
="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
110 <!--[if lt IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style
><![endif]-->
111 <!--[if IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style
><![endif]-->
112 <!--[if IE
6]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style
><![endif]-->
113 <!--[if IE
]><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script
>
114 <meta http
-equiv
="imagetoolbar" content
="no" /><![endif]-->
115 <?php
if($this->data
['jsvarurl' ]) { ?
><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('jsvarurl' ) ?>"></script
><?php
} ?
>
116 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath' ) ?>/common/wikibits.js"></script
>
119 <?php
if($this->data
['nsclass' ]) { ?
>class="<?php $this->text('nsclass') ?>"<?php
} ?
>>
120 <div id
="globalWrapper">
121 <div id
="column-content">
123 <a name
="top" id
="contentTop"></a
>
124 <?php
if($this->data
['sitenotice']) { ?
><div id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
><?php
} ?
>
125 <h1
class="firstHeading"><?php
$this->text('title') ?
></h1
>
126 <div id
="bodyContent">
127 <h3 id
="siteSub"><?php
$this->msg('tagline') ?
></h3
>
128 <div id
="contentSub"><?php
$this->html('subtitle') ?
></div
>
129 <?php
if($this->data
['undelete']) { ?
><div id
="contentSub"><?php
$this->html('undelete') ?
></div
><?php
} ?
>
130 <?php
if($this->data
['newtalk'] ) { ?
><div
class="usermessage"><?php
$this->html('newtalk') ?
></div
><?php
} ?
>
131 <!-- start content
-->
132 <?php
$this->html('bodytext') ?
>
133 <?php
if($this->data
['catlinks']) { ?
><div id
="catlinks"><?php
$this->html('catlinks') ?
></div
><?php
} ?
>
135 <div
class="visualClear"></div
>
139 <div id
="column-one">
140 <div id
="p-cactions" class="portlet">
143 <?php
foreach($this->data
['content_actions'] as $key => $action) {
144 ?
><li id
="ca-<?php echo htmlspecialchars($key) ?>"
145 <?php
if($action['class']) { ?
>class="<?php echo htmlspecialchars($action['class']) ?>"<?php
} ?
>
146 ><a href
="<?php echo htmlspecialchars($action['href']) ?>"><?php
147 echo htmlspecialchars($action['text']) ?
></a
></li
><?php
151 <div
class="portlet" id
="p-logo">
152 <a style
="background-image: url(<?php $this->text('logopath') ?>);"
153 href
="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"
154 title
="<?php $this->msg('mainpage') ?>"></a
>
156 <script type
="<?php $this->text('jsmimetype') ?>"> if (window
.isMSIE55
) fixalpha(); </script
>
157 <div
class="portlet" id
="p-navigation">
158 <h5
><?php
$this->msg('navigation') ?
></h5
>
161 <?php
foreach($this->data
['navigation_urls'] as $navlink) { ?
>
162 <li id
="<?php echo htmlspecialchars($navlink['id'])
163 ?>"><a href
="<?php echo htmlspecialchars($navlink['href']) ?>"><?php
164 echo htmlspecialchars($navlink['text']) ?
></a
></li
><?php
} ?
>
168 <?php
if( $this->data
['language_urls'] ) { ?
><div id
="p-lang" class="portlet">
169 <h5
><?php
$this->msg('otherlanguages') ?
></h5
>
172 <?php
foreach($this->data
['language_urls'] as $langlink) { ?
>
174 <a href
="<?php echo htmlspecialchars($langlink['href'])
175 ?>"><?php
echo $langlink['text'] ?
></a
>
182 </div
><!-- end of the
left (by
default at least
) column
-->
183 <div
class="visualClear"></div
>
185 <?php
if($this->data
['poweredbyico']) { ?
><div id
="f-poweredbyico"><?php
$this->html('poweredbyico') ?
></div
><?php
} ?
>
186 <?php
if($this->data
['copyrightico']) { ?
><div id
="f-copyrightico"><?php
$this->html('copyrightico') ?
></div
><?php
} ?
>
188 <?php
if($this->data
['lastmod' ]) { ?
><li id
="f-lastmod"><?php
$this->html('lastmod') ?
></li
><?php
} ?
>
189 <?php
if($this->data
['numberofwatchingusers' ]) { ?
><li id
="f-numberofwatchingusers"><?php
$this->html('numberofwatchingusers') ?
></li
><?php
} ?
>
190 <?php
if($this->data
['credits' ]) { ?
><li id
="f-credits"><?php
$this->html('credits') ?
></li
><?php
} ?
>
191 <?php
if($this->data
['copyright' ]) { ?
><li id
="f-copyright"><?php
$this->html('copyright') ?
></li
><?php
} ?
>
192 <?php
if($this->data
['about' ]) { ?
><li id
="f-about"><?php
$this->html('about') ?
></li
><?php
} ?
>
193 <?php
if($this->data
['disclaimer']) { ?
><li id
="f-disclaimer"><?php
$this->html('disclaimer') ?
></li
><?php
} ?
>
194 <?php
if($this->data
['tagline']) { ?
><li id
="f-tagline"><?php
echo $this->data
['tagline'] ?
></li
><?php
} ?
>
198 <?php
$this->html('reporttime') ?
>