-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpecialEsoCharData.php
67 lines (46 loc) · 1.43 KB
/
SpecialEsoCharData.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
class SpecialEsoCharData extends SpecialPage
{
public $charDataViewer = null;
function __construct()
{
global $wgOut;
parent::__construct( 'EsoCharData' );
$wgOut->addModules( 'ext.EsoBuildData.viewer.scripts' );
$wgOut->addModuleStyles( 'ext.EsoBuildData.viewer.styles' );
$this->charDataViewer = new EsoCharDataViewer();
$this->charDataViewer->baseUrl = "/wiki/Special:EsoCharData";
$this->charDataViewer->baseResourceUrl = "/esobuilddata/";
$this->charDataViewer->includeSetSkillData = true;
}
function execute( $par )
{
$this->charDataViewer->wikiContext = $this->getContext();
$request = $this->getRequest();
$output = $this->getOutput();
$charId = $request->getText( 'id' );
$raw = $request->getText( 'raw' );
$html = $this->charDataViewer->getOutput();
if ($this->charDataViewer->shouldOutputJson())
{
$this->outputJsonHeader();
print($this->charDataViewer->outputJson);
die();
}
$this->setHeaders();
$output->addHTML($html);
}
function outputJsonHeader()
{
ob_start("ob_gzhandler");
header("Expires: 0");
header("Pragma: no-cache");
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN'] . "");
header("content-type: application/json");
}
function getGroupName()
{
return 'wiki';
}
};