MediaWiki REL1_34
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}
getPermissionManager()
MediaWikiServices is the service locator for the application scope of MediaWiki.
execute( $par)
Default execute method Checks user permissions.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
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.
getUser()
Shortcut to get the User executing this instance.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.