forked from sigbertklinke/Iframe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpecialIframe_body.php
30 lines (27 loc) · 1.16 KB
/
SpecialIframe_body.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
class SpecialIframe extends SpecialPage {
function __construct() {
parent::__construct( 'Iframe' );
}
function execute( $par ) {
global $wgIframe;
$request = $this->getRequest();
$output = $this->getOutput();
$this->setHeaders();
$wikitext = "This page gives you an overview about the parameters of the global variable <b><tt>" . '$wgIframe' . "</tt></b> which can be set at in the [https://www.mediawiki.org/wiki/Manual:LocalSettings.php <tt>LocalSettings.php</tt>] file of the wiki:\n\n{| class=\"wikitable\"\n!Parameter\n!Value(s)\n!Remark\n|- style=\"vertical-align:top;\" \n";
foreach ($wgIframe['description'] as $key => $value) {
$wikitext .= ("|" . $key . "\n");
if (is_array($wgIframe[$key])) {
$wikitext .= "|";
foreach ($wgIframe[$key] as $subkey => $subvalue) {
$wikitext .= "<b>" . $subkey . "</b>: " . json_encode($subvalue) . "<br>";
}
} else {
$wikitext .= ("|" . $wgIframe[$key]);
}
$wikitext .= "\n|" . $value . "\n|- style=\"vertical-align:top;\"\n";
}
$wikitext .= "\n|}";
$output->addWikiText( $wikitext );
}
}