58 private $contents =
'';
64 private $headerDone =
false;
82 $this->contents .= $html;
91 $this->
addHTML( $this->parent->parse( $text ) );
98 $this->contents .= $html;
106 throw new LogicException( __METHOD__ .
' called after sending headers' );
108 $this->redirectTarget =
$url;
114 if ( !$this->redirectTarget ) {
129 'lang' => $this->getLanguage()->getCode(),
136 'interface-message-box'
139 'mw-config/config.css',
142 $module->setConfig( $resourceLoader->getConfig() );
145 $styles = ResourceLoader::makeCombinedStyles(
146 $module->readStyleFiles(
147 $module->getStyleFiles( $rlContext ),
151 return implode(
"\n", $styles );
159 private function getCssUrl() {
160 return Html::linkedStyle( $this->parent->getUrl( [
'css' => 1 ] ) );
167 if ( !$this->redirectTarget && strlen( $this->contents ) ) {
168 echo $this->contents;
170 $this->contents =
'';
178 private function getLanguage() {
190 'dir' => $this->getLanguage()->getDir(),
191 'lang' => $this->getLanguage()->getHtmlCode(),
201 return $this->headerDone;
206 $this->parent->request->response()->header(
'Content-Type: text/html; charset=utf-8' );
207 $this->parent->request->response()->header(
'X-Frame-Options: DENY' );
209 if ( $this->redirectTarget ) {
210 $this->parent->request->response()->header(
'Location: ' . $this->redirectTarget );
218 <meta name=
"robots" content=
"noindex, nofollow" />
219 <meta http-equiv=
"Content-type" content=
"text/html; charset=utf-8" />
221 <?php echo $this->
getCodex() .
"\n"; ?>
222 <?php echo $this->getCssUrl() .
"\n"; ?>
224 <?php echo Html::linkedScript(
'config.js' ) .
"\n"; ?>
227<?php echo Html::openElement(
'body', [
'class' => $this->getLanguage()->getDir() ] ) .
"\n"; ?>
228<div
id=
"mw-page-base"></div>
229<div
id=
"mw-head-base"></div>
230<div
id=
"content" class=
"mw-body" role=
"main">
231<div
id=
"bodyContent" class=
"mw-body-content">
243 <div
class=
"portal" id=
"p-logo">
244 <a href=
"https://www.mediawiki.org/" title=
"Main Page"></a>
248 $message =
wfMessage(
'config-sidebar' )->plain();
251 foreach ( explode(
'----', $message ) as $section ) {
252 echo
'<div class="portal"><div class="body">';
253 echo $this->parent->parse( $section,
true );
257 echo
'<div class="portal"><div class="body"><ul>';
259 'config-sidebar-relnotes' =>
'ReleaseNotes',
260 'config-sidebar-license' =>
'Copying',
261 'config-sidebar-upgrade' =>
'UpgradeDoc',
262 ] as $msgKey => $pageName ) {
263 echo $this->parent->makeLinkItem(
264 $this->parent->getDocUrl( $pageName ),
268 echo
'</ul></div></div>';
274 echo Html::closeElement(
'body' ) . Html::closeElement(
'html' );
285 return Html::linkedScript(
"../resources/lib/jquery/jquery.js" );
292 return Html::linkedStyle(
"../resources/lib/codex/codex.style.css" );
const MW_VERSION
The running version of MediaWiki.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
if(!defined( 'MW_NO_SESSION') &&MW_ENTRY_POINT !=='cli' $wgLang
Context object that contains information about the state of a specific ResourceLoader web request.