MediaWiki  master
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 }
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
getOutput()
Get the OutputPage being used for this instance.
getPermissionManager()
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes! ...
getUser()
Shortcut to get the User executing this instance.