53 private $contents =
'';
59 private $headerDone =
false;
78 private $useShortHeader =
false;
91 $this->contents .= $html;
100 $this->
addHTML( $this->parent->parse( $text ) );
107 $this->contents .= $html;
117 throw new MWException( __METHOD__ .
' called after sending headers' );
119 $this->redirectTarget = $url;
125 if ( !$this->redirectTarget ) {
136 $resourceLoader = MediaWikiServices::getInstance()->getResourceLoader();
140 'lang' => $this->getLanguage()->getCode(),
147 'interface-message-box'
150 'mw-config/config.css',
153 $module->setConfig( $resourceLoader->getConfig() );
156 $styles = ResourceLoader::makeCombinedStyles(
157 $module->readStyleFiles(
158 $module->getStyleFiles( $rlContext ),
162 return implode(
"\n", $styles );
170 private function getCssUrl() {
171 return Html::linkedStyle( $this->parent->getUrl( [
'css' => 1 ] ) );
186 if ( !$this->redirectTarget && strlen( $this->contents ) ) {
187 echo $this->contents;
189 $this->contents =
'';
197 private function getLanguage() {
201 : MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage(
'en' );
209 'dir' => $this->getLanguage()->getDir(),
210 'lang' => $this->getLanguage()->getHtmlCode(),
220 return $this->headerDone;
225 $this->parent->request->response()->header(
'Content-Type: text/html; charset=utf-8' );
228 $this->parent->request->response()->header(
'X-Frame-Options: DENY' );
231 if ( $this->redirectTarget ) {
232 $this->parent->request->response()->header(
'Location: ' . $this->redirectTarget );
247 <meta name=
"robots" content=
"noindex, nofollow" />
248 <meta http-equiv=
"Content-type" content=
"text/html; charset=utf-8" />
250 <?php echo $this->getCssUrl() .
"\n"; ?>
252 <?php echo Html::linkedScript(
'config.js' ) .
"\n"; ?>
255<?php echo Html::openElement(
'body', [
'class' => $this->getLanguage()->getDir() ] ) .
"\n"; ?>
256<div
id=
"mw-page-base"></div>
257<div
id=
"mw-head-base"></div>
258<div
id=
"content" class=
"mw-body" role=
"main">
259<div
id=
"bodyContent" class=
"mw-body-content">
267 echo Html::closeElement(
'body' ) . Html::closeElement(
'html' );
276 <div
class=
"portal" id=
"p-logo">
277 <a href=
"https://www.mediawiki.org/" title=
"Main Page"></a>
280 $message =
wfMessage(
'config-sidebar' )->plain();
283 foreach ( explode(
'----', $message ) as $section ) {
284 echo
'<div class="portal"><div class="body">';
285 echo $this->parent->parse( $section,
true );
289 echo
'<div class="portal"><div class="body"><ul>';
291 'config-sidebar-relnotes' =>
'ReleaseNotes',
292 'config-sidebar-license' =>
'Copying',
293 'config-sidebar-upgrade' =>
'UpgradeDoc',
294 ] as $msgKey => $pageName ) {
295 echo $this->parent->makeLinkItem(
296 $this->parent->getDocUrl( $pageName ),
300 echo
'</ul></div></div>';
305 echo Html::closeElement(
'body' ) . Html::closeElement(
'html' );
313 <meta name=
"robots" content=
"noindex, nofollow" />
314 <meta http-equiv=
"Content-type" content=
"text/html; charset=utf-8" />
316 <?php echo $this->getCssUrl() .
"\n"; ?>
318 <?php echo Html::linkedScript(
'config.js' ) .
"\n"; ?>
321<body style=
"background-image: none">
333 return Html::linkedScript(
"../resources/lib/jquery/jquery.js" );
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') &&! $wgCommandLineMode $wgLang
WebRequest clone which takes values from a provided array.
Context object that contains information about the state of a specific ResourceLoader web request.
Output class modelled on OutputPage.
addWikiTextAsInterface( $text)
__construct(WebInstaller $parent)
useShortHeader( $use=true)
getCSS()
Get the stylesheet of the MediaWiki skin.
bool $allowFrames
Does the current page need to allow being used as a frame? If not, X-Frame-Options will be output to ...
WebInstaller $parent
The WebInstaller object this WebInstallerOutput is used by.
headerDone()
Get whether the header has been output.
allowFrames( $allow=true)
Class for the core installer web interface.