b4c1a4730169efde5f2f11c561477bd20ee2a05f
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() {
45 $content_actions = array();
46 $nskey = $this->getNameSpaceKey();
47 $content_actions[$nskey] = $this->tabAction(
48 $this->mTitle
->getSubjectPage(),
50 !$this->mTitle
->isTalkPage() );
52 $content_actions['talk'] = $this->tabAction(
53 $this->mTitle
->getTalkPage(),
55 $this->mTitle
->isTalkPage(),
58 return $content_actions;
61 function makeBrokenLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
62 if ( !isset( $nt ) ) {
63 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
66 if ( $nt->getNamespace() == NS_CATEGORY
) {
67 return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
71 $text = $nt->getPrefixedText();
73 return $prefix . $text . $trail;
82 class HTMLDumpTemplate
extends QuickTemplate
{
84 * Template filter callback for MonoBook skin.
85 * Takes an associative array of data set from a SkinTemplate-based
86 * class, and a wrapper for MediaWiki's localization database, and
87 * outputs a formatted page.
93 $this->reallyExecute();
97 function modifySetup() {
99 foreach ( $this->data['navigation_urls'] as $index => $link ) {
100 if ( $link['text'] == 'recentchanges' ) {
101 unset( $this->data['navigation_urls'][$index] );
102 } elseif ( $link['text'] */
105 function reallyExecute() {
106 wfSuppressWarnings();
107 ?
><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
108 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="<?php $this->text('lang') ?>" lang
="<?php $this->text('lang') ?>" dir
="<?php $this->text('dir') ?>">
110 <meta http
-equiv
="Content-Type" content
="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
111 <?php
$this->html('headlinks') ?
>
112 <title
><?php
$this->text('pagetitle') ?
></title
>
113 <style type
="text/css" media
="screen,projection">/*<![CDATA[*/ @import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css"; /*]]>*/</style
>
114 <link rel
="stylesheet" type
="text/css" media
="print" href
="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
115 <!--[if lt IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style
><![endif]-->
116 <!--[if IE
5.5000]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style
><![endif]-->
117 <!--[if gte IE
6]><style type
="text/css">@import
"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style
><![endif]-->
118 <!--[if IE
]><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script
>
119 <meta http
-equiv
="imagetoolbar" content
="no" /><![endif]-->
120 <?php
if($this->data
['jsvarurl' ]) { ?
><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('jsvarurl' ) ?>"></script
><?php
} ?
>
121 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath' ) ?>/common/wikibits.js"></script
>
124 <?php
if($this->data
['nsclass' ]) { ?
>class="<?php $this->text('nsclass') ?>"<?php
} ?
>>
125 <div id
="globalWrapper">
126 <div id
="column-content">
128 <a name
="top" id
="contentTop"></a
>
129 <?php
if($this->data
['sitenotice']) { ?
><div id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
><?php
} ?
>
130 <h1
class="firstHeading"><?php
$this->text('title') ?
></h1
>
131 <div id
="bodyContent">
132 <h3 id
="siteSub"><?php
$this->msg('tagline') ?
></h3
>
133 <div id
="contentSub"><?php
$this->html('subtitle') ?
></div
>
134 <?php
if($this->data
['undelete']) { ?
><div id
="contentSub"><?php
$this->html('undelete') ?
></div
><?php
} ?
>
135 <?php
if($this->data
['newtalk'] ) { ?
><div
class="usermessage"><?php
$this->html('newtalk') ?
></div
><?php
} ?
>
136 <!-- start content
-->
137 <?php
$this->html('bodytext') ?
>
138 <?php
if($this->data
['catlinks']) { ?
><div id
="catlinks"><?php
$this->html('catlinks') ?
></div
><?php
} ?
>
140 <div
class="visualClear"></div
>
144 <div id
="column-one">
145 <div id
="p-cactions" class="portlet">
148 <?php
foreach($this->data
['content_actions'] as $key => $action) {
149 ?
><li id
="ca-<?php echo htmlspecialchars($key) ?>"
150 <?php
if($action['class']) { ?
>class="<?php echo htmlspecialchars($action['class']) ?>"<?php
} ?
>
151 ><a href
="<?php echo htmlspecialchars($action['href']) ?>"><?php
152 echo htmlspecialchars($action['text']) ?
></a
></li
><?php
156 <div
class="portlet" id
="p-logo">
157 <a style
="background-image: url(<?php $this->text('logopath') ?>);"
158 href
="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"
159 title
="<?php $this->msg('mainpage') ?>"></a
>
161 <script type
="<?php $this->text('jsmimetype') ?>"> if (window
.isMSIE55
) fixalpha(); </script
>
162 <?php
foreach ($this->data
['sidebar'] as $bar => $cont) { ?
>
163 <div
class='portlet' id
='p-<?php echo htmlspecialchars($bar) ?>'>
164 <h5
><?php
$this->msg( $bar ) ?
></h5
>
167 <?php
foreach($cont as $key => $val) { ?
>
168 <li id
="<?php echo htmlspecialchars($val['id']) ?>"><a href
="<?php echo htmlspecialchars($val['href']) ?>"><?php
echo htmlspecialchars($val['text'])?
></a
></li
>
174 <?php
if( $this->data
['language_urls'] ) { ?
><div id
="p-lang" class="portlet">
175 <h5
><?php
$this->msg('otherlanguages') ?
></h5
>
178 <?php
foreach($this->data
['language_urls'] as $langlink) { ?
>
180 <a href
="<?php echo htmlspecialchars($langlink['href'])
181 ?>"><?php
echo $langlink['text'] ?
></a
>
188 </div
><!-- end of the
left (by
default at least
) column
-->
189 <div
class="visualClear"></div
>
191 <?php
if($this->data
['poweredbyico']) { ?
><div id
="f-poweredbyico"><?php
$this->html('poweredbyico') ?
></div
><?php
} ?
>
192 <?php
if($this->data
['copyrightico']) { ?
><div id
="f-copyrightico"><?php
$this->html('copyrightico') ?
></div
><?php
} ?
>
194 <?php
if($this->data
['lastmod' ]) { ?
><li id
="f-lastmod"><?php
$this->html('lastmod') ?
></li
><?php
} ?
>
195 <?php
if($this->data
['numberofwatchingusers' ]) { ?
><li id
="f-numberofwatchingusers"><?php
$this->html('numberofwatchingusers') ?
></li
><?php
} ?
>
196 <?php
if($this->data
['credits' ]) { ?
><li id
="f-credits"><?php
$this->html('credits') ?
></li
><?php
} ?
>
197 <?php
if($this->data
['copyright' ]) { ?
><li id
="f-copyright"><?php
$this->html('copyright') ?
></li
><?php
} ?
>
198 <?php
if($this->data
['about' ]) { ?
><li id
="f-about"><?php
$this->html('about') ?
></li
><?php
} ?
>
199 <?php
if($this->data
['disclaimer']) { ?
><li id
="f-disclaimer"><?php
$this->html('disclaimer') ?
></li
><?php
} ?
>
200 <?php
if($this->data
['tagline']) { ?
><li id
="f-tagline"><?php
echo $this->data
['tagline'] ?
></li
><?php
} ?
>
204 <?php
$this->html('reporttime') ?
>