MediaWiki  1.34.0
SpecialApiSandbox.php
Go to the documentation of this file.
1 <?php
25 
31  public function __construct() {
32  parent::__construct( 'ApiSandbox' );
33  }
34 
35  public function execute( $par ) {
36  $this->setHeaders();
37  $out = $this->getOutput();
38  $this->addHelpLink( 'Help:ApiSandbox' );
39 
40  $out->addJsConfigVars( 'apihighlimits', MediaWikiServices::getInstance()
42  ->userHasRight( $this->getUser(), 'apihighlimits' )
43  );
44  $out->addModuleStyles( [
45  'mediawiki.special',
46  'mediawiki.hlist',
47  ] );
48  $out->addModules( [
49  'mediawiki.special.apisandbox',
50  'mediawiki.apipretty',
51  ] );
52  $out->wrapWikiMsg(
53  "<div id='mw-apisandbox'><div class='mw-apisandbox-nojs error'>\n$1\n</div></div>",
54  'apisandbox-jsonly'
55  );
56  }
57 
58  protected function getGroupName() {
59  return 'wiki';
60  }
61 }
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:719
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:117
SpecialApiSandbox
Definition: SpecialApiSandbox.php:30
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:828
getPermissionManager
getPermissionManager()
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
Definition: SpecialPage.php:537
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:729
SpecialApiSandbox\execute
execute( $par)
Default execute method Checks user permissions.
Definition: SpecialApiSandbox.php:35
SpecialPage
Parent class for all special pages.
Definition: SpecialPage.php:37
SpecialApiSandbox\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialApiSandbox.php:58
SpecialApiSandbox\__construct
__construct()
Definition: SpecialApiSandbox.php:31