MediaWiki master
SpecialApiSandbox.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\Specials;
22
24
32
33 public function __construct() {
34 parent::__construct( 'ApiSandbox' );
35 }
36
37 public function execute( $par ) {
38 $this->setHeaders();
39 $out = $this->getOutput();
40 $this->addHelpLink( 'Help:ApiSandbox' );
41
42 $out->addJsConfigVars(
43 'apihighlimits',
44 $this->getAuthority()->isAllowed( 'apihighlimits' )
45 );
46 $out->addModuleStyles( [
47 'mediawiki.special',
48 'mediawiki.hlist',
49 ] );
50 $out->addModules( [
51 'mediawiki.special.apisandbox',
52 'mediawiki.apipretty',
53 ] );
54 $out->wrapWikiMsg(
55 "<div id='mw-apisandbox'><div class='mw-apisandbox-nojs error'>\n$1\n</div></div>",
56 'apisandbox-jsonly'
57 );
58 }
59
60 protected function getGroupName() {
61 return 'wiki';
62 }
63}
64
66class_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.
Implements Special:ApiSandbox.
execute( $par)
Default execute method Checks user permissions.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...