MediaWiki  master
SpecialApiSandbox.php
Go to the documentation of this file.
1 <?php
25 
31 
33  private $permManager;
34 
39  parent::__construct( 'ApiSandbox' );
40 
41  $this->permManager = $permManager;
42  }
43 
44  public function execute( $par ) {
45  $this->setHeaders();
46  $out = $this->getOutput();
47  $this->addHelpLink( 'Help:ApiSandbox' );
48 
49  $out->addJsConfigVars(
50  'apihighlimits',
51  $this->permManager->userHasRight( $this->getUser(), 'apihighlimits' )
52  );
53  $out->addModuleStyles( [
54  'mediawiki.special',
55  'mediawiki.hlist',
56  ] );
57  $out->addModules( [
58  'mediawiki.special.apisandbox',
59  'mediawiki.apipretty',
60  ] );
61  $out->wrapWikiMsg(
62  "<div id='mw-apisandbox'><div class='mw-apisandbox-nojs error'>\n$1\n</div></div>",
63  'apisandbox-jsonly'
64  );
65  }
66 
67  protected function getGroupName() {
68  return 'wiki';
69  }
70 }
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:744
SpecialApiSandbox
Definition: SpecialApiSandbox.php:30
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:864
SpecialApiSandbox\$permManager
PermissionManager $permManager
Definition: SpecialApiSandbox.php:33
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!...
Definition: SpecialPage.php:571
SpecialApiSandbox\__construct
__construct(PermissionManager $permManager)
Definition: SpecialApiSandbox.php:38
SpecialApiSandbox\execute
execute( $par)
Default execute method Checks user permissions.
Definition: SpecialApiSandbox.php:44
MediaWiki\Permissions\PermissionManager
A service class for checking permissions To obtain an instance, use MediaWikiServices::getInstance()-...
Definition: PermissionManager.php:49
SpecialPage
Parent class for all special pages.
Definition: SpecialPage.php:41
SpecialApiSandbox\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialApiSandbox.php:67