55 private $contents =
'';
61 private $headerDone =
false;
80 private $useShortHeader =
false;
93 $this->contents .= $html;
102 $this->
addHTML( $this->parent->parse( $text ) );
109 $this->contents .= $html;
119 throw new MWException( __METHOD__ .
' called after sending headers' );
121 $this->redirectTarget = $url;
127 if ( !$this->redirectTarget ) {
138 $resourceLoader = MediaWikiServices::getInstance()->getResourceLoader();
142 'lang' => $this->getLanguage()->getCode(),
149 'interface-message-box'
152 'mw-config/config.css',
155 $module->setConfig( $resourceLoader->getConfig() );
158 $styles = ResourceLoader::makeCombinedStyles(
159 $module->readStyleFiles(
160 $module->getStyleFiles( $rlContext ),
164 return implode(
"\n", $styles );
172 private function getCssUrl() {
173 return Html::linkedStyle( $this->parent->getUrl( [
'css' => 1 ] ) );
188 if ( !$this->redirectTarget && strlen( $this->contents ) ) {
189 echo $this->contents;
191 $this->contents =
'';
199 private function getLanguage() {
203 : MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage(
'en' );
211 'dir' => $this->getLanguage()->getDir(),
212 'lang' => $this->getLanguage()->getHtmlCode(),
222 return $this->headerDone;
227 $this->parent->request->response()->header(
'Content-Type: text/html; charset=utf-8' );
230 $this->parent->request->response()->header(
'X-Frame-Options: DENY' );
233 if ( $this->redirectTarget ) {
234 $this->parent->request->response()->header(
'Location: ' . $this->redirectTarget );
249 <meta name=
"robots" content=
"noindex, nofollow" />
250 <meta http-equiv=
"Content-type" content=
"text/html; charset=utf-8" />
252 <?php echo $this->getCssUrl() .
"\n"; ?>
254 <?php echo Html::linkedScript(
'config.js' ) .
"\n"; ?>
257 <?php echo Html::openElement(
'body', [
'class' => $this->getLanguage()->getDir() ] ) .
"\n"; ?>
258 <div
id=
"mw-page-base"></div>
259 <div
id=
"mw-head-base"></div>
260 <div
id=
"content" class=
"mw-body" role=
"main">
261 <div
id=
"bodyContent" class=
"mw-body-content">
269 echo Html::closeElement(
'body' ) . Html::closeElement(
'html' );
278 <div
class=
"portal" id=
"p-logo">
279 <a href=
"https://www.mediawiki.org/" title=
"Main Page"></a>
282 $message =
wfMessage(
'config-sidebar' )->plain();
285 foreach ( explode(
'----', $message ) as $section ) {
286 echo
'<div class="portal"><div class="body">';
287 echo $this->parent->parse( $section,
true );
291 echo
'<div class="portal"><div class="body"><ul>';
293 'config-sidebar-relnotes' =>
'ReleaseNotes',
294 'config-sidebar-license' =>
'Copying',
295 'config-sidebar-upgrade' =>
'UpgradeDoc',
296 ] as $msgKey => $pageName ) {
297 echo $this->parent->makeLinkItem(
298 $this->parent->getDocUrl( $pageName ),
302 echo
'</ul></div></div>';
307 echo Html::closeElement(
'body' ) . Html::closeElement(
'html' );
315 <meta name=
"robots" content=
"noindex, nofollow" />
316 <meta http-equiv=
"Content-type" content=
"text/html; charset=utf-8" />
318 <?php echo $this->getCssUrl() .
"\n"; ?>
320 <?php echo Html::linkedScript(
'config.js' ) .
"\n"; ?>
323 <body style=
"background-image: none">
335 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
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.