-
Notifications
You must be signed in to change notification settings - Fork 217
/
Copy pathtalent.php
62 lines (51 loc) · 1.65 KB
/
talent.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
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
// tabId 1: Tools g_initHeader()
class TalentPage extends GenericPage
{
protected $tpl = 'talent';
protected $tabId = 1;
protected $path = [1];
protected $mode = CACHE_TYPE_NONE;
protected $gDataKey = true;
protected $scripts = array(
[SC_JS_FILE, 'js/TalentCalc.js'],
[SC_CSS_FILE, 'css/talentcalc.css'],
[SC_CSS_FILE, 'css/talent.css']
);
protected $tcType = 'tc'; // tc: TalentCalculator; pc: PetCalculator
private $isPetCalc = false;
public function __construct($pageCall, $__)
{
parent::__construct($pageCall, $__);
$this->isPetCalc = $pageCall == 'petcalc';
$this->name = $this->isPetCalc ? Lang::main('petCalc') : Lang::main('talentCalc');
}
protected function generateContent()
{
// add conditional js & css
if ($this->isPetCalc)
$this->addScript(
[SC_JS_FILE, '?data=pet-talents.pets'],
[SC_JS_FILE, 'js/petcalc.js'],
[SC_JS_FILE, 'js/swfobject.js'],
[SC_CSS_FILE, 'css/petcalc.css']
);
else
$this->addScript(
[SC_JS_FILE, '?data=glyphs'],
[SC_JS_FILE, 'js/talent.js']
);
$this->tcType = $this->isPetCalc ? 'pc' : 'tc';
}
protected function generateTitle()
{
array_unshift($this->title, $this->name);
}
protected function generatePath()
{
$this->path[] = $this->isPetCalc ? 2 : 0;
}
}
?>