MediaWiki REL1_41
SpecialApiSandbox.php
Go to the documentation of this file.
1<?php
24namespace MediaWiki\Specials;
25
27
33
34 public function __construct() {
35 parent::__construct( 'ApiSandbox' );
36 }
37
38 public function execute( $par ) {
39 $this->setHeaders();
40 $out = $this->getOutput();
41 $this->addHelpLink( 'Help:ApiSandbox' );
42
43 $out->addJsConfigVars(
44 'apihighlimits',
45 $this->getAuthority()->isAllowed( 'apihighlimits' )
46 );
47 $out->addModuleStyles( [
48 'mediawiki.special',
49 'mediawiki.hlist',
50 ] );
51 $out->addModules( [
52 'mediawiki.special.apisandbox',
53 'mediawiki.apipretty',
54 ] );
55 $out->wrapWikiMsg(
56 "<div id='mw-apisandbox'><div class='mw-apisandbox-nojs error'>\n$1\n</div></div>",
57 'apisandbox-jsonly'
58 );
59 }
60
61 protected function getGroupName() {
62 return 'wiki';
63 }
64}
65
69class_alias( SpecialApiSandbox::class, 'SpecialApiSandbox' );
Parent class for all special pages.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
getAuthority()
Shortcut to get the Authority executing this instance.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
execute( $par)
Default execute method Checks user permissions.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...