MediaWiki REL1_39
SpecialApiSandbox.php
Go to the documentation of this file.
1<?php
29
30 public function __construct() {
31 parent::__construct( 'ApiSandbox' );
32 }
33
34 public function execute( $par ) {
35 $this->setHeaders();
36 $out = $this->getOutput();
37 $this->addHelpLink( 'Help:ApiSandbox' );
38
39 $out->addJsConfigVars(
40 'apihighlimits',
41 $this->getAuthority()->isAllowed( 'apihighlimits' )
42 );
43 $out->addModuleStyles( [
44 'mediawiki.special',
45 'mediawiki.hlist',
46 ] );
47 $out->addModules( [
48 'mediawiki.special.apisandbox',
49 'mediawiki.apipretty',
50 ] );
51 $out->wrapWikiMsg(
52 "<div id='mw-apisandbox'><div class='mw-apisandbox-nojs error'>\n$1\n</div></div>",
53 'apisandbox-jsonly'
54 );
55 }
56
57 protected function getGroupName() {
58 return 'wiki';
59 }
60}
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.
getAuthority()
Shortcut to get the Authority executing this instance.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.