mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
JS/CSS
* unify handling
This commit is contained in:
@@ -64,6 +64,11 @@ define('CACHE_TYPE_XML', 4); // only used by item
|
|||||||
define('CACHE_MODE_FILECACHE', 0x1);
|
define('CACHE_MODE_FILECACHE', 0x1);
|
||||||
define('CACHE_MODE_MEMCACHED', 0x2);
|
define('CACHE_MODE_MEMCACHED', 0x2);
|
||||||
|
|
||||||
|
define ('CSS_FILE', 1);
|
||||||
|
define ('CSS_STRING', 2);
|
||||||
|
define ('JS_FILE', 3);
|
||||||
|
define ('JS_STRING', 4);
|
||||||
|
|
||||||
define('SEARCH_TYPE_REGULAR', 0x10000000);
|
define('SEARCH_TYPE_REGULAR', 0x10000000);
|
||||||
define('SEARCH_TYPE_OPEN', 0x20000000);
|
define('SEARCH_TYPE_OPEN', 0x20000000);
|
||||||
define('SEARCH_TYPE_JSON', 0x40000000);
|
define('SEARCH_TYPE_JSON', 0x40000000);
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ if (!defined('AOWOW_REVISION'))
|
|||||||
class AccountPage extends GenericPage
|
class AccountPage extends GenericPage
|
||||||
{
|
{
|
||||||
protected $tpl = 'acc-dashboard';
|
protected $tpl = 'acc-dashboard';
|
||||||
protected $js = ['user.js', 'profile.js'];
|
protected $js = [[JS_FILE, 'user.js'], [JS_FILE, 'profile.js']];
|
||||||
protected $css = [['path' => 'Profiler.css']];
|
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||||
protected $mode = CACHE_TYPE_NONE;
|
protected $mode = CACHE_TYPE_NONE;
|
||||||
protected $category = null;
|
protected $category = null;
|
||||||
protected $validCats = array(
|
protected $validCats = array(
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class AchievementPage extends GenericPage
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ($reqBook)
|
if ($reqBook)
|
||||||
$this->addCss(['path' => 'Book.css']);
|
$this->addScript([CSS_FILE, 'Book.css']);
|
||||||
|
|
||||||
// create rewards
|
// create rewards
|
||||||
if ($foo = $this->subject->getField('rewards'))
|
if ($foo = $this->subject->getField('rewards'))
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class AchievementsPage extends GenericPage
|
|||||||
protected $path = [0, 9];
|
protected $path = [0, 9];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['filters.js'];
|
protected $js = [[JS_FILE, 'filters.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
|
|||||||
@@ -73,15 +73,15 @@ class AdminPage extends GenericPage
|
|||||||
|
|
||||||
private function handleConfig()
|
private function handleConfig()
|
||||||
{
|
{
|
||||||
$this->addCSS(array(
|
$this->addScript(
|
||||||
['string' => '.grid input[type=\'text\'], .grid input[type=\'number\'] { width:250px; text-align:left; }'],
|
[CSS_STRING, '.grid input[type=\'text\'], .grid input[type=\'number\'] { width:250px; text-align:left; }'],
|
||||||
['string' => '.grid input[type=\'button\'] { width:65px; padding:2px; }'],
|
[CSS_STRING, '.grid input[type=\'button\'] { width:65px; padding:2px; }'],
|
||||||
['string' => '.grid a.tip { margin:0px 5px; opacity:0.8; }'],
|
[CSS_STRING, '.grid a.tip { margin:0px 5px; opacity:0.8; }'],
|
||||||
['string' => '.grid a.tip:hover { opacity:1; }'],
|
[CSS_STRING, '.grid a.tip:hover { opacity:1; }'],
|
||||||
['string' => '.grid tr { height:30px; }'],
|
[CSS_STRING, '.grid tr { height:30px; }'],
|
||||||
['string' => '.grid .disabled { opacity:0.4 !important; }'],
|
[CSS_STRING, '.grid .disabled { opacity:0.4 !important; }'],
|
||||||
['string' => '.grid .status { position:absolute; right:5px; }'],
|
[CSS_STRING, '.grid .status { position:absolute; right:5px; }'],
|
||||||
));
|
);
|
||||||
|
|
||||||
$head = '<table class="grid"><tr><th><b>Key</b></th><th><b>Value</b></th><th style="width:150px;"><b>Options</b></th></tr>';
|
$head = '<table class="grid"><tr><th><b>Key</b></th><th><b>Value</b></th><th style="width:150px;"><b>Options</b></th></tr>';
|
||||||
$mainTab = [];
|
$mainTab = [];
|
||||||
@@ -123,8 +123,8 @@ class AdminPage extends GenericPage
|
|||||||
|
|
||||||
private function handlePhpInfo()
|
private function handlePhpInfo()
|
||||||
{
|
{
|
||||||
$this->addCSS([
|
$this->addScript([
|
||||||
'string' => "\npre {margin: 0px; font-family: monospace;}\n" .
|
CSS_STRING, "\npre {margin: 0px; font-family: monospace;}\n" .
|
||||||
"td, th { border: 1px solid #000000; vertical-align: baseline;}\n" .
|
"td, th { border: 1px solid #000000; vertical-align: baseline;}\n" .
|
||||||
".p {text-align: left;}\n" .
|
".p {text-align: left;}\n" .
|
||||||
".e {background-color: #ccccff; font-weight: bold; color: #000000;}\n" .
|
".e {background-color: #ccccff; font-weight: bold; color: #000000;}\n" .
|
||||||
@@ -187,11 +187,11 @@ class AdminPage extends GenericPage
|
|||||||
|
|
||||||
private function handleScreenshots()
|
private function handleScreenshots()
|
||||||
{
|
{
|
||||||
$this->addJS('screenshot.js');
|
$this->addScript(
|
||||||
$this->addCSS(array(
|
[JS_FILE, 'screenshot.js'],
|
||||||
['string' => '.layout {margin: 0px 25px; max-width: inherit; min-width: 1200px; }'],
|
[CSS_STRING, '.layout {margin: 0px 25px; max-width: inherit; min-width: 1200px; }'],
|
||||||
['string' => '#highlightedRow { background-color: #322C1C; }']
|
[CSS_STRING, '#highlightedRow { background-color: #322C1C; }'],
|
||||||
));
|
);
|
||||||
|
|
||||||
$ssGetAll = $this->_get['all'];
|
$ssGetAll = $this->_get['all'];
|
||||||
$ssPages = [];
|
$ssPages = [];
|
||||||
@@ -225,8 +225,10 @@ class AdminPage extends GenericPage
|
|||||||
|
|
||||||
private function handleWeightPresets()
|
private function handleWeightPresets()
|
||||||
{
|
{
|
||||||
$this->addCSS(['string' => '.wt-edit {display:inline-block; vertical-align:top; width:350px;}']);
|
$this->addScript(
|
||||||
$this->addJS('filters.js');
|
[JS_FILE, 'filters.js'],
|
||||||
|
[CSS_STRING, '.wt-edit {display:inline-block; vertical-align:top; width:350px;}'],
|
||||||
|
);
|
||||||
|
|
||||||
$head = $body = '';
|
$head = $body = '';
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class AreaTriggerPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$_type = $this->subject->getField('type');
|
$_type = $this->subject->getField('type');
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class AreaTriggersPage extends GenericPage
|
|||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $validCats = [0, 1, 2, 3, 4, 5];
|
protected $validCats = [0, 1, 2, 3, 4, 5];
|
||||||
protected $js = ['filters.js'];
|
protected $js = [[JS_FILE, 'filters.js']];
|
||||||
protected $reqUGroup = U_GROUP_STAFF;
|
protected $reqUGroup = U_GROUP_STAFF;
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ class ArenaTeamPage extends GenericPage
|
|||||||
protected $tabId = 1;
|
protected $tabId = 1;
|
||||||
protected $path = [1, 5, 3];
|
protected $path = [1, 5, 3];
|
||||||
protected $tpl = 'roster';
|
protected $tpl = 'roster';
|
||||||
protected $js = ['profile_all.js', 'profile.js'];
|
protected $js = [[JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||||
protected $css = [['path' => 'Profiler.css']];
|
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||||
|
|
||||||
public function __construct($pageCall, $pageParam)
|
public function __construct($pageCall, $pageParam)
|
||||||
{
|
{
|
||||||
@@ -97,7 +97,7 @@ class ArenaTeamPage extends GenericPage
|
|||||||
if ($this->doResync)
|
if ($this->doResync)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$this->addJS('?data=realms.weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=realms.weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$this->redButtons[BUTTON_RESYNC] = [$this->subjectGUID, 'arena-team'];
|
$this->redButtons[BUTTON_RESYNC] = [$this->subjectGUID, 'arena-team'];
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ArenaTeamsPage extends GenericPage
|
|||||||
protected $tabId = 1;
|
protected $tabId = 1;
|
||||||
protected $path = [1, 5, 3];
|
protected $path = [1, 5, 3];
|
||||||
protected $tpl = 'arena-teams';
|
protected $tpl = 'arena-teams';
|
||||||
protected $js = ['filters.js', 'profile_all.js', 'profile.js'];
|
protected $js = [[JS_FILE, 'filters.js'], [JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ class ArenaTeamsPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$conditions = [];
|
$conditions = [];
|
||||||
if (!User::isInGroup(U_GROUP_EMPLOYEE))
|
if (!User::isInGroup(U_GROUP_EMPLOYEE))
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class ClassPage extends GenericPage
|
|||||||
protected $path = [0, 12];
|
protected $path = [0, 12];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['swfobject.js'];
|
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||||
|
|
||||||
public function __construct($pageCall, $id)
|
public function __construct($pageCall, $id)
|
||||||
{
|
{
|
||||||
@@ -43,7 +43,7 @@ class ClassPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
|
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
|
||||||
$_mask = 1 << ($this->typeId - 1);
|
$_mask = 1 << ($this->typeId - 1);
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ class ComparePage extends GenericPage
|
|||||||
protected $path = [1, 3];
|
protected $path = [1, 3];
|
||||||
protected $mode = CACHE_TYPE_NONE;
|
protected $mode = CACHE_TYPE_NONE;
|
||||||
protected $js = array(
|
protected $js = array(
|
||||||
'profile.js',
|
[JS_FILE, 'profile.js'],
|
||||||
'Draggable.js',
|
[JS_FILE, 'Draggable.js'],
|
||||||
'filters.js',
|
[JS_FILE, 'filters.js'],
|
||||||
'Summary.js',
|
[JS_FILE, 'Summary.js'],
|
||||||
'swfobject.js',
|
[JS_FILE, 'swfobject.js'],
|
||||||
);
|
);
|
||||||
protected $css = [['path' => 'Summary.css']];
|
protected $css = [[CSS_FILE, 'Summary.css']];
|
||||||
|
|
||||||
protected $summary = [];
|
protected $summary = [];
|
||||||
protected $cmpItems = [];
|
protected $cmpItems = [];
|
||||||
@@ -44,7 +44,7 @@ class ComparePage extends GenericPage
|
|||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
// add conditional js
|
// add conditional js
|
||||||
$this->addJS('?data=weight-presets.gems.enchants.itemsets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=weight-presets.gems.enchants.itemsets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$this->summary = array(
|
$this->summary = array(
|
||||||
'template' => 'compare',
|
'template' => 'compare',
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class CurrencyPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$_itemId = $this->subject->getField('itemId');
|
$_itemId = $this->subject->getField('itemId');
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class EnchantmentsPage extends GenericPage
|
|||||||
protected $path = [0, 101];
|
protected $path = [0, 101];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['filters.js'];
|
protected $js =[JS_FILE, 'filters.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class EventPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
/***********/
|
/***********/
|
||||||
/* Infobox */
|
/* Infobox */
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class FactionPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
/***********/
|
/***********/
|
||||||
/* Infobox */
|
/* Infobox */
|
||||||
|
|||||||
@@ -426,35 +426,36 @@ class GenericPage
|
|||||||
$this->sumSQLStats();
|
$this->sumSQLStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addJS($name, bool $unshift = false) : void
|
public function addScript(array ...$structs) : void
|
||||||
{
|
{
|
||||||
if (is_array($name))
|
foreach ($structs as $s) // iType, sContent, bFront, sIeCnd
|
||||||
{
|
{
|
||||||
foreach ($name as $n)
|
if (empty($s[1]))
|
||||||
$this->addJS($n, $unshift);
|
|
||||||
}
|
|
||||||
else if (!in_array($name, $this->js))
|
|
||||||
{
|
{
|
||||||
if ($unshift)
|
trigger_error('GenericPage::addScript - content empty', E_USER_WARNING);
|
||||||
array_unshift($this->js, $name);
|
continue;
|
||||||
else
|
|
||||||
$this->js[] = $name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addCSS(array $struct, bool $unshift = false) : void
|
$s = array_pad($s, 4, '');
|
||||||
|
switch ($s[0])
|
||||||
{
|
{
|
||||||
if (is_array($struct) && empty($struct['path']) && empty($struct['string']))
|
case JS_FILE:
|
||||||
{
|
case JS_STRING:
|
||||||
foreach ($struct as $s)
|
if (empty($s[2]))
|
||||||
$this->addCSS($s, $unshift);
|
$this->js[] = $s;
|
||||||
}
|
|
||||||
else if (!in_array($struct, $this->css))
|
|
||||||
{
|
|
||||||
if ($unshift)
|
|
||||||
array_unshift($this->css, $struct);
|
|
||||||
else
|
else
|
||||||
$this->css[] = $struct;
|
array_unshift($this->js, $s);
|
||||||
|
break;
|
||||||
|
case CSS_FILE:
|
||||||
|
case CSS_STRING:
|
||||||
|
if (empty($s[2]))
|
||||||
|
$this->css[] = $s;
|
||||||
|
else
|
||||||
|
array_unshift($this->css, $s);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
trigger_error('GenericPage::addScript - unknown script type #'.$s[0], E_USER_WARNING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ class GuildPage extends GenericPage
|
|||||||
protected $tabId = 1;
|
protected $tabId = 1;
|
||||||
protected $path = [1, 5, 2];
|
protected $path = [1, 5, 2];
|
||||||
protected $tpl = 'roster';
|
protected $tpl = 'roster';
|
||||||
protected $js = ['profile_all.js', 'profile.js'];
|
protected $js = [[JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||||
protected $css = [['path' => 'Profiler.css']];
|
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||||
|
|
||||||
public function __construct($pageCall, $pageParam)
|
public function __construct($pageCall, $pageParam)
|
||||||
{
|
{
|
||||||
@@ -97,7 +97,7 @@ class GuildPage extends GenericPage
|
|||||||
if ($this->doResync)
|
if ($this->doResync)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$this->addJS('?data=realms.weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=realms.weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$this->redButtons[BUTTON_RESYNC] = [$this->subjectGUID, 'guild'];
|
$this->redButtons[BUTTON_RESYNC] = [$this->subjectGUID, 'guild'];
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class GuildsPage extends GenericPage
|
|||||||
protected $tabId = 1;
|
protected $tabId = 1;
|
||||||
protected $path = [1, 5, 2];
|
protected $path = [1, 5, 2];
|
||||||
protected $tpl = 'guilds';
|
protected $tpl = 'guilds';
|
||||||
protected $js = ['filters.js', 'profile_all.js', 'profile.js'];
|
protected $js = [[JS_FILE, 'filters.js'], [JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ class GuildsPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$conditions = array(
|
$conditions = array(
|
||||||
['c.deleteInfos_Account', null],
|
['c.deleteInfos_Account', null],
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ if (!defined('AOWOW_REVISION'))
|
|||||||
class HomePage extends GenericPage
|
class HomePage extends GenericPage
|
||||||
{
|
{
|
||||||
protected $tpl = 'home';
|
protected $tpl = 'home';
|
||||||
protected $js = ['home.js'];
|
protected $js = [[JS_FILE, 'home.js']];
|
||||||
protected $css = [['path' => 'home.css']];
|
protected $css = [[CSS_FILE, 'home.css']];
|
||||||
|
|
||||||
protected $featuredBox = [];
|
protected $featuredBox = [];
|
||||||
protected $oneliner = '';
|
protected $oneliner = '';
|
||||||
@@ -21,7 +21,7 @@ class HomePage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addCSS(['string' => '.announcement { margin: auto; max-width: 1200px; padding: 0px 15px 15px 15px }']);
|
$this->addScript([CSS_STRING, '.announcement { margin: auto; max-width: 1200px; padding: 0px 15px 15px 15px }']);
|
||||||
|
|
||||||
// load oneliner
|
// load oneliner
|
||||||
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_home_oneliner WHERE active = 1 LIMIT 1'))
|
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_home_oneliner WHERE active = 1 LIMIT 1'))
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class IconsPage extends GenericPage
|
|||||||
protected $path = [0, 31];
|
protected $path = [0, 31];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['filters.js'];
|
protected $js = [[JS_FILE, 'filters.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ class ItemPage extends genericPage
|
|||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $enhancedTT = [];
|
protected $enhancedTT = [];
|
||||||
protected $js = array(
|
protected $js = array(
|
||||||
'swfobject.js', // view in 3d, ok
|
[JS_FILE, 'swfobject.js'], // view in 3d, ok
|
||||||
'profile.js', // item upgrade search, also ok
|
[JS_FILE, 'profile.js'], // item upgrade search, also ok
|
||||||
'filters.js' // lolwut?
|
[JS_FILE, 'filters.js'] // lolwut?
|
||||||
);
|
);
|
||||||
|
|
||||||
protected $_get = array(
|
protected $_get = array(
|
||||||
@@ -121,7 +121,7 @@ class ItemPage extends genericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=weight-presets.zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=weight-presets.zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$_flags = $this->subject->getField('flags');
|
$_flags = $this->subject->getField('flags');
|
||||||
$_slot = $this->subject->getField('slot');
|
$_slot = $this->subject->getField('slot');
|
||||||
@@ -349,8 +349,10 @@ class ItemPage extends genericPage
|
|||||||
$pageText = [];
|
$pageText = [];
|
||||||
if ($this->pageText = Game::getPageText($this->subject->getField('pageTextId')))
|
if ($this->pageText = Game::getPageText($this->subject->getField('pageTextId')))
|
||||||
{
|
{
|
||||||
$this->addJS('Book.js');
|
$this->addScript(
|
||||||
$this->addCSS(['path' => 'Book.css']);
|
[JS_FILE, 'Book.js'],
|
||||||
|
[CSS_FILE, 'Book.css']
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->headIcons = [$this->subject->getField('iconString', true, true), $this->subject->getField('stackable')];
|
$this->headIcons = [$this->subject->getField('iconString', true, true), $this->subject->getField('stackable')];
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ItemsPage extends GenericPage
|
|||||||
protected $path = [0, 0];
|
protected $path = [0, 0];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['filters.js', 'swfobject.js'];
|
protected $js = [[JS_FILE, 'filters.js'], [JS_FILE, 'swfobject.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ class ItemsPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$conditions = [];
|
$conditions = [];
|
||||||
|
|
||||||
|
|||||||
@@ -16,10 +16,7 @@ class ItemsetPage extends GenericPage
|
|||||||
protected $path = [0, 2];
|
protected $path = [0, 2];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = array(
|
protected $js = [[JS_FILE, 'swfobject.js'], [JS_FILE, 'Summary.js']];
|
||||||
'swfobject.js',
|
|
||||||
'Summary.js'
|
|
||||||
);
|
|
||||||
|
|
||||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ItemsetsPage extends GenericPage
|
|||||||
protected $path = [0, 2];
|
protected $path = [0, 2];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['filters.js'];
|
protected $js = [[JS_FILE, 'filters.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ class ItemsetsPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$conditions = [];
|
$conditions = [];
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ class MapsPage extends GenericPage
|
|||||||
protected $tabId = 1;
|
protected $tabId = 1;
|
||||||
protected $path = [1, 1];
|
protected $path = [1, 1];
|
||||||
protected $mode = CACHE_TYPE_NONE;
|
protected $mode = CACHE_TYPE_NONE;
|
||||||
protected $js = ['maps.js'];
|
protected $js = [[JS_FILE, 'maps.js']];
|
||||||
protected $css = [['string' => 'zone-picker { margin-left: 4px }']];
|
protected $css = [[CSS_STRING, 'zone-picker { margin-left: 4px }']];
|
||||||
|
|
||||||
public function __construct($pageCall, $__)
|
public function __construct($pageCall, $__)
|
||||||
{
|
{
|
||||||
@@ -24,7 +24,7 @@ class MapsPage extends GenericPage
|
|||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
// add conditional js
|
// add conditional js
|
||||||
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function generateTitle()
|
protected function generateTitle()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class MorePage extends GenericPage
|
|||||||
protected $path = [];
|
protected $path = [];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_NONE;
|
protected $mode = CACHE_TYPE_NONE;
|
||||||
protected $js = ['swfobject.js'];
|
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||||
|
|
||||||
private $page = [];
|
private $page = [];
|
||||||
private $req2priv = array(
|
private $req2priv = array(
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ class NpcPage extends GenericPage
|
|||||||
protected $path = [0, 4];
|
protected $path = [0, 4];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['swfobject.js'];
|
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||||
protected $css = [['path' => 'Profiler.css']];
|
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||||
|
|
||||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ class NpcPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$_typeFlags = $this->subject->getField('typeFlags');
|
$_typeFlags = $this->subject->getField('typeFlags');
|
||||||
$_altIds = [];
|
$_altIds = [];
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class NpcsPage extends GenericPage
|
|||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $validCats = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
|
protected $validCats = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
|
||||||
protected $js = ['filters.js'];
|
protected $js = [[JS_FILE, 'filters.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ class NpcsPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$conditions = [];
|
$conditions = [];
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class ObjectPage extends GenericPage
|
|||||||
protected $path = [0, 5];
|
protected $path = [0, 5];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['swfobject.js'];
|
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||||
|
|
||||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ class ObjectPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
/***********/
|
/***********/
|
||||||
/* Infobox */
|
/* Infobox */
|
||||||
@@ -215,8 +215,10 @@ class ObjectPage extends GenericPage
|
|||||||
// pageText
|
// pageText
|
||||||
if ($this->pageText = Game::getPageText($next = $this->subject->getField('pageTextId')))
|
if ($this->pageText = Game::getPageText($next = $this->subject->getField('pageTextId')))
|
||||||
{
|
{
|
||||||
$this->addCSS(['path' => 'Book.css']);
|
$this->addScript(
|
||||||
$this->addJS('Book.js');
|
[JS_FILE, 'Book.js'],
|
||||||
|
[CSS_FILE, 'Book.css']
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get spawns and path
|
// get spawns and path
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class ObjectsPage extends GenericPage
|
|||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $validCats = [-2, -3, -4, -5, -6, 0, 3, 9, 25];
|
protected $validCats = [-2, -3, -4, -5, -6, 0, 3, 9, 25];
|
||||||
protected $js = ['filters.js'];
|
protected $js = [[JS_FILE, 'filters.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ class ObjectsPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$conditions = [];
|
$conditions = [];
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class PetPage extends GenericPage
|
|||||||
protected $path = [0, 8];
|
protected $path = [0, 8];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['swfobject.js'];
|
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||||
|
|
||||||
public function __construct($pageCall, $id)
|
public function __construct($pageCall, $id)
|
||||||
{
|
{
|
||||||
@@ -43,7 +43,7 @@ class PetPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
/***********/
|
/***********/
|
||||||
/* Infobox */
|
/* Infobox */
|
||||||
|
|||||||
@@ -18,10 +18,17 @@ class ProfilePage extends GenericPage
|
|||||||
protected $tabId = 1;
|
protected $tabId = 1;
|
||||||
protected $path = [1, 5, 1];
|
protected $path = [1, 5, 1];
|
||||||
protected $tpl = 'profile';
|
protected $tpl = 'profile';
|
||||||
protected $js = ['filters.js', 'TalentCalc.js', 'swfobject.js', 'profile_all.js', 'profile.js', 'Profiler.js'];
|
protected $js = array(
|
||||||
|
[JS_FILE, 'filters.js'],
|
||||||
|
[JS_FILE, 'TalentCalc.js'],
|
||||||
|
[JS_FILE, 'swfobject.js'],
|
||||||
|
[JS_FILE, 'profile_all.js'],
|
||||||
|
[JS_FILE, 'profile.js'],
|
||||||
|
[JS_FILE, 'Profiler.js']
|
||||||
|
);
|
||||||
protected $css = array(
|
protected $css = array(
|
||||||
['path' => 'talentcalc.css'],
|
[CSS_FILE, 'talentcalc.css'],
|
||||||
['path' => 'Profiler.css']
|
[CSS_FILE, 'Profiler.css']
|
||||||
);
|
);
|
||||||
|
|
||||||
protected $_get = array(
|
protected $_get = array(
|
||||||
@@ -142,7 +149,7 @@ class ProfilePage extends GenericPage
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// + .titles ?
|
// + .titles ?
|
||||||
$this->addJS('?data=enchants.gems.glyphs.itemsets.pets.pet-talents.quick-excludes.realms.statistics.weight-presets.achievements&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=enchants.gems.glyphs.itemsets.pets.pet-talents.quick-excludes.realms.statistics.weight-presets.achievements&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
// as demanded by the raid activity tracker
|
// as demanded by the raid activity tracker
|
||||||
$bossIds = array(
|
$bossIds = array(
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ class ProfilerPage extends GenericPage
|
|||||||
protected $tabId = 1;
|
protected $tabId = 1;
|
||||||
protected $tpl = 'profiler';
|
protected $tpl = 'profiler';
|
||||||
protected $gDataKey = true;
|
protected $gDataKey = true;
|
||||||
protected $js = ['profile_all.js', 'profile.js'];
|
protected $js = [[JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||||
protected $css = [['path' => 'Profiler.css']];
|
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||||
|
|
||||||
public function __construct($pageCall, $pageParam)
|
public function __construct($pageCall, $pageParam)
|
||||||
{
|
{
|
||||||
@@ -23,7 +23,7 @@ class ProfilerPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function generatePath() { }
|
protected function generatePath() { }
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ class ProfilesPage extends GenericPage
|
|||||||
protected $tabId = 1;
|
protected $tabId = 1;
|
||||||
protected $path = [1, 5, 0];
|
protected $path = [1, 5, 0];
|
||||||
protected $tpl = 'profiles';
|
protected $tpl = 'profiles';
|
||||||
protected $js = ['filters.js', 'profile_all.js', 'profile.js'];
|
protected $js = [[JS_FILE, 'filters.js'], [JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||||
protected $css = [['path' => 'Profiler.css']];
|
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ class ProfilesPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=weight-presets.realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=weight-presets.realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$conditions = [];
|
$conditions = [];
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ class QuestPage extends GenericPage
|
|||||||
protected $path = [0, 3];
|
protected $path = [0, 3];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $css = [['path' => 'Book.css']];
|
protected $js = [[JS_FILE, 'ShowOnMap.js']];
|
||||||
protected $js = ['ShowOnMap.js'];
|
protected $css = [[CSS_FILE, 'Book.css']];
|
||||||
|
|
||||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
||||||
|
|
||||||
@@ -570,7 +570,7 @@ class QuestPage extends GenericPage
|
|||||||
/* Mapper */
|
/* Mapper */
|
||||||
/**********/
|
/**********/
|
||||||
|
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
// gather points of interest
|
// gather points of interest
|
||||||
$mapNPCs = $mapGOs = []; // [typeId, start|end|objective, startItemId]
|
$mapNPCs = $mapGOs = []; // [typeId, start|end|objective, startItemId]
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class QuestsPage extends GenericPage
|
|||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $validCats = [];
|
protected $validCats = [];
|
||||||
protected $js = ['filters.js'];
|
protected $js = [[JS_FILE, 'filters.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class RacePage extends GenericPage
|
|||||||
protected $path = [0, 13];
|
protected $path = [0, 13];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['swfobject.js'];
|
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||||
|
|
||||||
public function __construct($pageCall, $id)
|
public function __construct($pageCall, $id)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ class ScreenshotPage extends GenericPage
|
|||||||
const MAX_H = 325;
|
const MAX_H = 325;
|
||||||
|
|
||||||
protected $tpl = 'screenshot';
|
protected $tpl = 'screenshot';
|
||||||
protected $js = ['Cropper.js'];
|
protected $js = [[JS_FILE, 'Cropper.js']];
|
||||||
protected $css = [['path' => 'Cropper.css']];
|
protected $css = [[CSS_FILE, 'Cropper.css']];
|
||||||
protected $reqAuth = true;
|
protected $reqAuth = true;
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class SearchPage extends GenericPage
|
|||||||
protected $tpl = 'search';
|
protected $tpl = 'search';
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_SEARCH;
|
protected $mode = CACHE_TYPE_SEARCH;
|
||||||
protected $js = ['swfobject.js'];
|
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||||
protected $lvTabs = []; // [file, data, extraInclude, osInfo] // osInfo:[type, appendix, nMatches, param1, param2]
|
protected $lvTabs = []; // [file, data, extraInclude, osInfo] // osInfo:[type, appendix, nMatches, param1, param2]
|
||||||
protected $forceTabs = true;
|
protected $forceTabs = true;
|
||||||
protected $search = ''; // output
|
protected $search = ''; // output
|
||||||
@@ -208,7 +208,7 @@ class SearchPage extends GenericPage
|
|||||||
if ($this->mode == CACHE_TYPE_NONE) // search is invalid
|
if ($this->mode == CACHE_TYPE_NONE) // search is invalid
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$this->performSearch();
|
$this->performSearch();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ class SkillPage extends GenericPage
|
|||||||
$list = $spellIds ? DB::World()->selectCol('SELECT cdt.CreatureId FROM creature_default_trainer cdt JOIN trainer_spell ts ON ts.TrainerId = cdt.TrainerId WHERE ts.SpellID IN (?a)', $spellIds) : [];
|
$list = $spellIds ? DB::World()->selectCol('SELECT cdt.CreatureId FROM creature_default_trainer cdt JOIN trainer_spell ts ON ts.TrainerId = cdt.TrainerId WHERE ts.SpellID IN (?a)', $spellIds) : [];
|
||||||
if ($list)
|
if ($list)
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$trainer = new CreatureList(array(CFG_SQL_LIMIT_NONE, ['ct.id', $list], ['s.guid', NULL, '!'], ['ct.npcflag', 0x10, '&']));
|
$trainer = new CreatureList(array(CFG_SQL_LIMIT_NONE, ['ct.id', $list], ['s.guid', NULL, '!'], ['ct.npcflag', 0x10, '&']));
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class SoundPage extends GenericPage
|
|||||||
/* Main Content */
|
/* Main Content */
|
||||||
/****************/
|
/****************/
|
||||||
|
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
// get spawns
|
// get spawns
|
||||||
$map = null;
|
$map = null;
|
||||||
@@ -331,7 +331,7 @@ class SoundPage extends GenericPage
|
|||||||
$npcs = new CreatureList($cnds);
|
$npcs = new CreatureList($cnds);
|
||||||
if (!$npcs->error)
|
if (!$npcs->error)
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$this->extendGlobalData($npcs->getJSGlobals(GLOBALINFO_SELF));
|
$this->extendGlobalData($npcs->getJSGlobals(GLOBALINFO_SELF));
|
||||||
$this->lvTabs[] = ['creature', ['data' => array_values($npcs->getListviewData())]];
|
$this->lvTabs[] = ['creature', ['data' => array_values($npcs->getListviewData())]];
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class SoundsPage extends GenericPage
|
|||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $validCats = [1, 2, 3, 4, 6, 9, 10, 12, 13, 14, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 50, 52, 53];
|
protected $validCats = [1, 2, 3, 4, 6, 9, 10, 12, 13, 14, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 50, 52, 53];
|
||||||
protected $js = ['filters.js'];
|
protected $js = [[JS_FILE, 'filters.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class SpellPage extends GenericPage
|
|||||||
protected $path = [0, 1];
|
protected $path = [0, 1];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['swfobject.js'];
|
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||||
|
|
||||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ class SpellPage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
$_cat = $this->subject->getField('typeCat');
|
$_cat = $this->subject->getField('typeCat');
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class SpellsPage extends GenericPage
|
|||||||
protected $path = [0, 1];
|
protected $path = [0, 1];
|
||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = ['filters.js'];
|
protected $js = [[JS_FILE, 'filters.js']];
|
||||||
|
|
||||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ class TalentPage extends GenericPage
|
|||||||
protected $path = [1];
|
protected $path = [1];
|
||||||
protected $mode = CACHE_TYPE_NONE;
|
protected $mode = CACHE_TYPE_NONE;
|
||||||
protected $gDataKey = true;
|
protected $gDataKey = true;
|
||||||
protected $js = ['TalentCalc.js'];
|
protected $js = [[JS_FILE, 'TalentCalc.js']];
|
||||||
protected $css = array(
|
protected $css = array(
|
||||||
['path' => 'talentcalc.css'],
|
[CSS_FILE, 'talentcalc.css'],
|
||||||
['path' => 'talent.css']
|
[CSS_FILE, 'talent.css']
|
||||||
);
|
);
|
||||||
|
|
||||||
private $isPetCalc = false;
|
private $isPetCalc = false;
|
||||||
@@ -31,12 +31,16 @@ class TalentPage extends GenericPage
|
|||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
// add conditional js & css
|
// add conditional js & css
|
||||||
$this->addJS(array(
|
$this->addScript(
|
||||||
($this->isPetCalc ? '?data=pet-talents.pets' : '?data=glyphs').'&locale='.User::$localeId.'&t='.$_SESSION['dataKey'],
|
[JS_FILE, ($this->isPetCalc ? '?data=pet-talents.pets' : '?data=glyphs').'&locale='.User::$localeId.'&t='.$_SESSION['dataKey']],
|
||||||
$this->isPetCalc ? 'petcalc.js' : 'talent.js',
|
[JS_FILE, $this->isPetCalc ? 'petcalc.js' : 'talent.js'],
|
||||||
$this->isPetCalc ? 'swfobject.js' : null
|
);
|
||||||
));
|
|
||||||
$this->addCSS($this->isPetCalc ? ['path' => 'petcalc.css'] : []);
|
if ($this->isPetCalc)
|
||||||
|
$this->addScript(
|
||||||
|
[JS_FILE, 'swfobject.css'],
|
||||||
|
[CSS_FILE, 'petcalc.css']
|
||||||
|
);
|
||||||
|
|
||||||
$this->tcType = $this->isPetCalc ? 'pc' : 'tc';
|
$this->tcType = $this->isPetCalc ? 'pc' : 'tc';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ if (!defined('AOWOW_REVISION'))
|
|||||||
class UserPage extends GenericPage
|
class UserPage extends GenericPage
|
||||||
{
|
{
|
||||||
protected $tpl = 'user';
|
protected $tpl = 'user';
|
||||||
protected $js = ['user.js', 'profile.js'];
|
protected $js = [[JS_FILE, 'user.js'], [JS_FILE, 'profile.js']];
|
||||||
protected $css = [['path' => 'Profiler.css']];
|
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||||
protected $mode = CACHE_TYPE_NONE;
|
protected $mode = CACHE_TYPE_NONE;
|
||||||
|
|
||||||
protected $typeId = 0;
|
protected $typeId = 0;
|
||||||
@@ -236,7 +236,7 @@ class UserPage extends GenericPage
|
|||||||
$profiles = new LocalProfileList($conditions);
|
$profiles = new LocalProfileList($conditions);
|
||||||
if (!$profiles->error)
|
if (!$profiles->error)
|
||||||
{
|
{
|
||||||
$this->addJS('?data=weight-presets&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
// Characters
|
// Characters
|
||||||
if ($chars = $profiles->getListviewData(PROFILEINFO_CHARACTER | PROFILEINFO_USER))
|
if ($chars = $profiles->getListviewData(PROFILEINFO_CHARACTER | PROFILEINFO_USER))
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class ZonePage extends GenericPage
|
|||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $type = TYPE_ZONE;
|
protected $type = TYPE_ZONE;
|
||||||
protected $tpl = 'detail-page-generic';
|
protected $tpl = 'detail-page-generic';
|
||||||
protected $js = ['ShowOnMap.js'];
|
protected $js = [[JS_FILE, 'ShowOnMap.js']];
|
||||||
|
|
||||||
protected $zoneMusic = [];
|
protected $zoneMusic = [];
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ class ZonePage extends GenericPage
|
|||||||
|
|
||||||
protected function generateContent()
|
protected function generateContent()
|
||||||
{
|
{
|
||||||
$this->addJS('?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||||
|
|
||||||
/***********/
|
/***********/
|
||||||
/* Infobox */
|
/* Infobox */
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class ZonesPage extends GenericPage
|
|||||||
protected $tabId = 0;
|
protected $tabId = 0;
|
||||||
protected $mode = CACHE_TYPE_PAGE;
|
protected $mode = CACHE_TYPE_PAGE;
|
||||||
protected $validCats = [true, true, [0, 1, 2], [0, 1, 2], false, false, true, false, true, true, true];
|
protected $validCats = [true, true, [0, 1, 2], [0, 1, 2], false, false, true, false, true, true, true];
|
||||||
protected $js = ['ShowOnMap.js'];
|
protected $js = [[JS_FILE, 'ShowOnMap.js']];
|
||||||
|
|
||||||
public function __construct($pageCall, $pageParam)
|
public function __construct($pageCall, $pageParam)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,13 +12,11 @@ if (User::isInGroup(U_GROUP_STAFF | U_GROUP_SCREENSHOT | U_GROUP_VIDEO)):
|
|||||||
echo ' <link rel="stylesheet" type="text/css" href="'.STATIC_URL.'/css/staff.css?'.AOWOW_REVISION."\" />\n";
|
echo ' <link rel="stylesheet" type="text/css" href="'.STATIC_URL.'/css/staff.css?'.AOWOW_REVISION."\" />\n";
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
foreach ($this->css as $css):
|
foreach ($this->css as [$type, $css]):
|
||||||
if (!empty($css['string'])):
|
if ($type == CSS_FILE):
|
||||||
echo ' <style type="text/css">'.$css['string']."</style>\n";
|
echo ' <link rel="stylesheet" type="text/css" href="'.STATIC_URL.'/css/'.$css.'?'.AOWOW_REVISION."\" />\n";
|
||||||
elseif (!empty($css['path'])):
|
elseif ($type == CSS_STRING):
|
||||||
echo ' '.(!empty($css['ieCond']) ? '<!--[if '.$css['ieCond'].']>' : null) .
|
echo ' <style type="text/css">'.$css."</style>\n";
|
||||||
'<link rel="stylesheet" type="text/css" href="'.STATIC_URL.'/css/'.$css['path'].'?'.AOWOW_REVISION.'" />' .
|
|
||||||
(!empty($css['ieCond']) ? '<![endif]-->' : null)."\n";
|
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
@@ -44,9 +42,11 @@ if (User::isInGroup(U_GROUP_STAFF | U_GROUP_SCREENSHOT | U_GROUP_VIDEO)):
|
|||||||
echo ' <script src="'.STATIC_URL.'/js/staff.js?'.AOWOW_REVISION."\" type=\"text/javascript\"></script>\n";
|
echo ' <script src="'.STATIC_URL.'/js/staff.js?'.AOWOW_REVISION."\" type=\"text/javascript\"></script>\n";
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
foreach ($this->js as $js):
|
foreach ($this->js as [$type, $js]):
|
||||||
if (!empty($js)):
|
if ($type == JS_FILE):
|
||||||
echo ' <script src="'.($js[0] == '?' ? $js.'&' : STATIC_URL.'/js/'.$js.'?').AOWOW_REVISION."\" type=\"text/javascript\"></script>\n";
|
echo ' <script type="text/javascript" src="'.($js[0] == '?' ? $js.'&' : STATIC_URL.'/js/'.$js.'?').AOWOW_REVISION."\"></script>\n";
|
||||||
|
elseif ($type == JS_STRING):
|
||||||
|
echo ' <script type="text/javascript">'.$js."</script>\n";
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user