58 private $contents =
'';
64 private $headerDone =
false;
79 $this->contents .= $html;
88 $this->
addHTML( $this->parent->parse( $text ) );
95 $this->contents .= $html;
103 throw new LogicException( __METHOD__ .
' called after sending headers' );
105 $this->redirectTarget =
$url;
111 if ( !$this->redirectTarget ) {
126 'lang' => $this->getLanguage()->getCode(),
133 'interface-message-box'
136 'mw-config/config.css',
139 $module->setConfig( $resourceLoader->getConfig() );
142 $styles = ResourceLoader::makeCombinedStyles(
143 $module->readStyleFiles(
144 $module->getStyleFiles( $rlContext ),
148 return implode(
"\n", $styles );
156 private function getCssUrl() {
157 return Html::linkedStyle( $this->parent->getUrl( [
'css' => 1 ] ) );
164 if ( !$this->redirectTarget && strlen( $this->contents ) ) {
165 echo $this->contents;
167 $this->contents =
'';
175 private function getLanguage() {
187 'dir' => $this->getLanguage()->getDir(),
188 'lang' => $this->getLanguage()->getHtmlCode(),
198 return $this->headerDone;
203 $this->parent->request->response()->header(
'Content-Type: text/html; charset=utf-8' );
204 $this->parent->request->response()->header(
'X-Frame-Options: DENY' );
206 if ( $this->redirectTarget ) {
207 $this->parent->request->response()->header(
'Location: ' . $this->redirectTarget );
215 <meta name=
"robots" content=
"noindex, nofollow" />
216 <meta http-equiv=
"Content-type" content=
"text/html; charset=utf-8" />
218 <?php echo $this->
getCodex() .
"\n"; ?>
219 <?php echo $this->getCssUrl() .
"\n"; ?>
221 <?php echo Html::linkedScript(
'config.js' ) .
"\n"; ?>
224<?php echo Html::openElement(
'body', [
'class' => $this->getLanguage()->getDir() ] ) .
"\n"; ?>
225<div
id=
"mw-page-base"></div>
226<div
id=
"mw-head-base"></div>
227<div
id=
"content" class=
"mw-body" role=
"main">
228<div
id=
"bodyContent" class=
"mw-body-content">
240 <div
class=
"portal" id=
"p-logo">
241 <a href=
"https://www.mediawiki.org/" title=
"Main Page"></a>
245 $message =
wfMessage(
'config-sidebar' )->plain();
248 foreach ( explode(
'----', $message ) as $section ) {
249 echo
'<div class="portal"><div class="body">';
250 echo $this->parent->parse( $section,
true );
254 echo
'<div class="portal"><div class="body"><ul>';
256 'config-sidebar-relnotes' =>
'ReleaseNotes',
257 'config-sidebar-license' =>
'Copying',
258 'config-sidebar-upgrade' =>
'UpgradeDoc',
259 ] as $msgKey => $pageName ) {
260 echo $this->parent->makeLinkItem(
261 $this->parent->getDocUrl( $pageName ),
265 echo
'</ul></div></div>';
271 echo Html::closeElement(
'body' ) . Html::closeElement(
'html' );
282 return Html::linkedScript(
"../resources/lib/jquery/jquery.js" );
289 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.