Files
aowow/pages/talent.php
Sarjuuk 9f1cbc0233 HTML/Scripts
* append a filemtime timestamp to js/css files to work around browser caching after update
 * shuffle script handling around a bit
 * also user pages cant have community content
 * also fix breadcrumbs on items page
2023-04-13 17:30:23 +02:00

62 lines
1.5 KiB
PHP

<?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']
);
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;
}
}
?>