* Make makeInternalOrExternalUrl() use the same url protocols as the parser
[mediawiki.git] / skins / disabled / HTMLDump.php
blob7b96e2ff14449443422e8fc532b54fdaa60a7b40
1 <?php
3 /**
4 * Default skin for HTML dumps, based on MonoBook.php
5 */
7 if( !defined( 'MEDIAWIKI' ) )
8 die();
10 /** */
11 require_once( 'includes/SkinTemplate.php' );
13 /**
14 * Inherit main code from SkinTemplate, set the CSS and template filter.
15 * @todo document
16 * @package MediaWiki
17 * @subpackage Skins
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] );
36 return $links;
39 function buildContentActionUrls() {
40 $content_actions = array();
41 $nskey = $this->getNameSpaceKey();
42 $content_actions[$nskey] = $this->tabAction(
43 $this->mTitle->getSubjectPage(),
44 $nskey,
45 !$this->mTitle->isTalkPage() );
47 $content_actions['talk'] = $this->tabAction(
48 $this->mTitle->getTalkPage(),
49 'talk',
50 $this->mTitle->isTalkPage(),
51 '',
52 true);
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 );
65 if ( $text == '' ) {
66 $text = $nt->getPrefixedText();
68 return $prefix . $text . $trail;
72 /**
73 * @todo document
74 * @package MediaWiki
75 * @subpackage Skins
77 class HTMLDumpTemplate extends QuickTemplate {
78 /**
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.
84 * @access private
86 function execute() {
87 $this->modifySetup();
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') ?>">
104 <head>
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>
117 </head>
118 <body
119 <?php if($this->data['nsclass' ]) { ?>class="<?php $this->text('nsclass') ?>"<?php } ?>>
120 <div id="globalWrapper">
121 <div id="column-content">
122 <div id="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 } ?>
134 <!-- end content -->
135 <div class="visualClear"></div>
136 </div>
137 </div>
138 </div>
139 <div id="column-one">
140 <div id="p-cactions" class="portlet">
141 <h5>Views</h5>
142 <ul>
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
148 } ?>
149 </ul>
150 </div>
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>
155 </div>
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>
159 <div class="pBody">
160 <ul>
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 } ?>
165 </ul>
166 </div>
167 </div>
168 <?php if( $this->data['language_urls'] ) { ?><div id="p-lang" class="portlet">
169 <h5><?php $this->msg('otherlanguages') ?></h5>
170 <div class="pBody">
171 <ul>
172 <?php foreach($this->data['language_urls'] as $langlink) { ?>
173 <li>
174 <a href="<?php echo htmlspecialchars($langlink['href'])
175 ?>"><?php echo $langlink['text'] ?></a>
176 </li>
177 <?php } ?>
178 </ul>
179 </div>
180 </div>
181 <?php } ?>
182 </div><!-- end of the left (by default at least) column -->
183 <div class="visualClear"></div>
184 <div id="footer">
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 } ?>
187 <ul id="f-list">
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 } ?>
195 </ul>
196 </div>
197 </div>
198 <?php $this->html('reporttime') ?>
199 </body>
200 </html>
201 <?php
202 wfRestoreWarnings();