mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Templates/Listviews
* removed most templates by sensibly restructuring lvTab-data. Util::toJSON() does the rest. * taught Util::toJSON() to recognize values prefixed with $ as js-code * use Util::toJSON whenever possible * misc - mail attachments are displyed again - always show all currency rewards on Quest-LVs - suppress an error, when encountering unused ItemMods
This commit is contained in:
@@ -312,10 +312,10 @@ class Loot
|
||||
break;
|
||||
}
|
||||
|
||||
$this->extraCols[] = "Listview.funcBox.createSimpleCol('group', 'Group', '7%', 'group')";
|
||||
$this->extraCols[] = "\$Listview.funcBox.createSimpleCol('group', 'Group', '7%', 'group')";
|
||||
foreach ($fields as $idx => $field)
|
||||
if ($set & (1 << $idx))
|
||||
$this->extraCols[] = "Listview.funcBox.createSimpleCol('".$field."', '".Util::ucFirst($field)."', '7%', '".$field."')";
|
||||
$this->extraCols[] = "\$Listview.funcBox.createSimpleCol('".$field."', '".Util::ucFirst($field)."', '7%', '".$field."')";
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -505,7 +505,7 @@ class Loot
|
||||
}
|
||||
|
||||
$tabsFinal[$tabId][1][] = array_merge($srcData[$srcObj->id], $result[$srcObj->getField('lootId')]);
|
||||
$tabsFinal[$tabId][4][] = 'Listview.extraCols.percent';
|
||||
$tabsFinal[$tabId][4][] = '$Listview.extraCols.percent';
|
||||
if ($tabId != 15)
|
||||
$tabsFinal[$tabId][6][] = 'skill';
|
||||
}
|
||||
@@ -563,7 +563,7 @@ class Loot
|
||||
$srcData = $srcObj->getListviewData();
|
||||
|
||||
if (!empty($result))
|
||||
$tabsFinal[16][4][] = 'Listview.extraCols.percent';
|
||||
$tabsFinal[16][4][] = '$Listview.extraCols.percent';
|
||||
|
||||
if ($srcObj->hasSetFields(['reagent1']))
|
||||
$tabsFinal[16][6][] = 'reagents';
|
||||
@@ -601,14 +601,33 @@ class Loot
|
||||
$tabId = abs($tabId); // general case (skinning)
|
||||
|
||||
$tabsFinal[$tabId][1][] = array_merge($srcData[$srcObj->id], $result[$srcObj->getField($field)]);
|
||||
$tabsFinal[$tabId][4][] = 'Listview.extraCols.percent';
|
||||
$tabsFinal[$tabId][4][] = '$Listview.extraCols.percent';
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->results = $tabsFinal;
|
||||
foreach ($tabsFinal as $tabId => $data)
|
||||
{
|
||||
$tabData = array(
|
||||
'data' => $data[1],
|
||||
'name' => $data[2],
|
||||
'id' => $data[3]
|
||||
);
|
||||
|
||||
if ($data[4])
|
||||
$tabData['extraCols'] = array_unique($data[4]);
|
||||
|
||||
if ($data[5])
|
||||
$tabData['hiddenCols'] = array_unique($data[5]);
|
||||
|
||||
if ($data[6])
|
||||
$tabData['visibleCols'] = array_unique($data[6]);
|
||||
|
||||
$this->results[$tabId] = [$data[0], $tabData];
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
define('AOWOW_REVISION', 16);
|
||||
define('AOWOW_REVISION', 17);
|
||||
define('CLI', PHP_SAPI === 'cli');
|
||||
|
||||
|
||||
|
||||
@@ -1318,11 +1318,19 @@ class ItemList extends BaseType
|
||||
$reqLvl = $this->curTpl['requiredLevel'] > 1 ? $this->curTpl['requiredLevel'] : MAX_LEVEL;
|
||||
$level = min(max($reqLvl, $ssdLvl), MAX_LEVEL);
|
||||
|
||||
if (!Lang::item('statType', $type)) // unknown rating
|
||||
return sprintf(Lang::item('statType', count(Lang::item('statType')) - 1), $type, $value);
|
||||
else if (in_array($type, Util::$lvlIndepRating)) // level independant Bonus
|
||||
// unknown rating
|
||||
if (in_array($type, [2, 8, 9, 10, 11]) || $type > ITEM_MOD_BLOCK_VALUE || $type < 0)
|
||||
{
|
||||
if (User::isInGroup(U_GROUP_EMPLOYEE))
|
||||
return sprintf(Lang::item('statType', count(Lang::item('statType')) - 1), $type, $value);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
// level independant Bonus
|
||||
else if (in_array($type, Util::$lvlIndepRating))
|
||||
return Lang::item('trigger', 1).str_replace('%d', '<!--rtg'.$type.'-->'.$value, Lang::item('statType', $type));
|
||||
else // rating-Bonuses
|
||||
// rating-Bonuses
|
||||
else
|
||||
{
|
||||
$scaling = true;
|
||||
|
||||
|
||||
@@ -400,10 +400,8 @@ class QuestList extends BaseType
|
||||
|
||||
// currencies
|
||||
if (!empty($this->rewards[$this->id][TYPE_CURRENCY]))
|
||||
{
|
||||
$_ = $this->rewards[$this->id][TYPE_CURRENCY];
|
||||
$data[TYPE_CURRENCY] = array_combine(array_keys($_), array_keys($_));
|
||||
}
|
||||
foreach ($this->rewards[$this->id][TYPE_CURRENCY] as $id => $__)
|
||||
$data[TYPE_CURRENCY][$id] = $id;
|
||||
}
|
||||
|
||||
if ($addMask & GLOBALINFO_SELF)
|
||||
|
||||
@@ -1576,10 +1576,13 @@ class Util
|
||||
if (CFG_DEBUG)
|
||||
$flags |= JSON_PRETTY_PRINT;
|
||||
|
||||
// just a thought: .. about prefixing variables with $ to mark them as function code and retroactively stripping escapes from them
|
||||
// like it's done already in with listviews for example
|
||||
$json = json_encode($data, $flags);
|
||||
|
||||
return json_encode($data, $flags);
|
||||
// handle strings prefixed with $ as js-variables
|
||||
// literal: match everything (lazy) between first pair of unescaped double quotes. First character must be $.
|
||||
$json = preg_replace_callback('/(?<!\\\\)"\$(.+?)(?<!\\\\)"/i', function($m) { return str_replace('\"', '"', $m[1]); }, $json);
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
public static function checkOrCreateDirectory($path)
|
||||
|
||||
@@ -47,7 +47,6 @@ class Lang
|
||||
self::$item['cat'][2][1][14] .= ' ('.self::$item['cat'][2][0].')';
|
||||
}
|
||||
|
||||
// todo: make static props private and access through this
|
||||
public static function __callStatic($prop, $args)
|
||||
{
|
||||
if (!isset(self::$$prop))
|
||||
|
||||
@@ -578,6 +578,7 @@ $lang = array(
|
||||
'spellLearn' => "Ihr erlernt",
|
||||
'bonusTalents' => "Talentpunkte",
|
||||
'spellDisplayed'=> ' (<a href="?spell=%d">%s</a> wird angezeigt)',
|
||||
'attachment' => "Anlage",
|
||||
'questInfo' => array(
|
||||
0 => "Normal", 1 => "Gruppe", 21 => "Leben", 41 => "PvP", 62 => "Schlachtzug", 81 => "Dungeon", 82 => "Weltereignis",
|
||||
83 => "Legendär", 84 => "Eskorte", 85 => "Heroisch", 88 => "Schlachtzug (10)", 89 => "Schlachtzug (25)"
|
||||
@@ -761,6 +762,8 @@ $lang = array(
|
||||
'pctCostOf' => "vom Grund%s",
|
||||
'costPerSec' => ", plus %s pro Sekunde",
|
||||
'costPerLevel' => ", plus %s pro Stufe",
|
||||
'stackGroup' => "Stack Gruppierung",
|
||||
'linkedWith' => "Verknüpft mit",
|
||||
'_scaling' => "Skalierung",
|
||||
'scaling' => array(
|
||||
'directSP' => "+%.2f%% der Zaubermacht zum direkten Effekt", 'directAP' => "+%.2f%% der Angriffskraft zum direkten Effekt",
|
||||
|
||||
@@ -573,6 +573,7 @@ $lang = array(
|
||||
'spellLearn' => "You will learn",
|
||||
'bonusTalents' => "talent points",
|
||||
'spellDisplayed'=> ' (<a href="?spell=%d">%s</a> is displayed)',
|
||||
'attachment' => "Attachment",
|
||||
'questInfo' => array(
|
||||
0 => "Normal", 1 => "Group", 21 => "Life", 41 => "PvP", 62 => "Raid", 81 => "Dungeon", 82 => "World Event",
|
||||
83 => "Legendary", 84 => "Escort", 85 => "Heroic", 88 => "Raid (10)", 89 => "Raid (25)"
|
||||
@@ -756,6 +757,8 @@ $lang = array(
|
||||
'pctCostOf' => "of base %s",
|
||||
'costPerSec' => ", plus %s per sec",
|
||||
'costPerLevel' => ", plus %s per level",
|
||||
'stackGroup' => "Stack Group",
|
||||
'linkedWith' => "Linked with",
|
||||
'_scaling' => "Scaling",
|
||||
'scaling' => array(
|
||||
'directSP' => "+%.2f%% of spell power to direct component", 'directAP' => "+%.2f%% of attack power to direct component",
|
||||
|
||||
@@ -577,6 +577,7 @@ $lang = array(
|
||||
'spellLearn' => "Aprenderás",
|
||||
'bonusTalents' => "puntos de talento",
|
||||
'spellDisplayed'=> ' (mostrando <a href="?spell=%d">%s</a>)',
|
||||
'attachment' => "[Attachment]",
|
||||
'questInfo' => array(
|
||||
0 => "Normal", 1 => "Élite", 21 => "Vida", 41 => "JcJ", 62 => "Banda", 81 => "Mazmorra", 82 => "Evento del mundo",
|
||||
83 => "Legendaria", 84 => "Escolta", 85 => "Heroica", 88 => "Banda (10)", 89 => "Banda (25)"
|
||||
@@ -760,6 +761,8 @@ $lang = array(
|
||||
'pctCostOf' => "del %s base",
|
||||
'costPerSec' => ", mas %s por segundo",
|
||||
'costPerLevel' => ", mas %s por nivel",
|
||||
'stackGroup' => "[Stack Group]",
|
||||
'linkedWith' => "[Linked with]",
|
||||
'_scaling' => "[Scaling]",
|
||||
'scaling' => array(
|
||||
'directSP' => "[+%.2f%% of spell power to direct component]", 'directAP' => "[+%.2f%% of attack power to direct component]",
|
||||
|
||||
@@ -576,6 +576,7 @@ $lang = array(
|
||||
'spellLearn' => "Vous apprendrez",
|
||||
'bonusTalents' => "points de talent",
|
||||
'spellDisplayed'=> ' (<a href="?spell=%d">%s</a> affichés)',
|
||||
'attachment' => "[Attachment]",
|
||||
'questInfo' => array(
|
||||
0 => "Standard", 1 => "Groupe", 21 => "Vie", 41 => "JcJ", 62 => "Raid", 81 => "Donjon", 82 => "Évènement mondial",
|
||||
83 => "Légendaire", 84 => "Escorte", 85 => "Héroïque", 88 => "Raid (10)", 89 => "Raid (25)"
|
||||
@@ -758,6 +759,8 @@ $lang = array(
|
||||
'pctCostOf' => "de la %s de base",
|
||||
'costPerSec' => ", plus %s par seconde",
|
||||
'costPerLevel' => ", plus %s par niveau",
|
||||
'stackGroup' => "[Stack Group]",
|
||||
'linkedWith' => "[Linked with]",
|
||||
'_scaling' => "[Scaling]",
|
||||
'scaling' => array(
|
||||
'directSP' => "+%.2f%% de la puissance des sorts directe", 'directAP' => "+%.2f%% de la puissance d'attaque directe",
|
||||
|
||||
@@ -576,6 +576,7 @@ $lang = array(
|
||||
'spellLearn' => "Вы изучите",
|
||||
'bonusTalents' => "очков талантов",
|
||||
'spellDisplayed'=> ' (показано: <a href="?spell=%d">%s</a>)',
|
||||
'attachment' => "[Attachment]",
|
||||
'questInfo' => array(
|
||||
0 => "Обычный", 1 => "Группа", 21 => "Жизнь", 41 => "PvP", 62 => "Рейд", 81 => "Подземелье", 82 => "Игровое событие",
|
||||
83 => "Легенда", 84 => "Сопровождение", 85 => "Героическое", 88 => "Рейд (10)", 89 => "Рейд (25)"
|
||||
@@ -760,6 +761,8 @@ $lang = array(
|
||||
'pctCostOf' => "от базовой %s",
|
||||
'costPerSec' => ", плюс %s в секунду",
|
||||
'costPerLevel' => ", плюс %s за уровень",
|
||||
'stackGroup' => "[Stack Group]",
|
||||
'linkedWith' => "[Linked with]",
|
||||
'_scaling' => "[Scaling]",
|
||||
'scaling' => array(
|
||||
'directSP' => "[+%.2f%% of spell power to direct component]", 'directAP' => "[+%.2f%% of attack power to direct component]",
|
||||
|
||||
@@ -218,7 +218,6 @@ class AccountPage extends GenericPage
|
||||
/* Listview */
|
||||
/************/
|
||||
|
||||
$this->lvTabs = [];
|
||||
$this->forceTabs = true;
|
||||
|
||||
// Reputation changelog (params only for comment-events)
|
||||
@@ -227,11 +226,7 @@ class AccountPage extends GenericPage
|
||||
foreach ($repData as &$r)
|
||||
$r['when'] = date(Util::$dateFormatInternal, $r['when']);
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'reputationhistory',
|
||||
'data' => $repData,
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['reputationhistory', ['data' => $repData]];
|
||||
}
|
||||
|
||||
// comments
|
||||
@@ -241,14 +236,11 @@ class AccountPage extends GenericPage
|
||||
// _totalCount: 377,
|
||||
// note: $WH.sprintf(LANG.lvnote_usercomments, 377),
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'commentpreview',
|
||||
'data' => $_,
|
||||
'params' => array(
|
||||
'hiddenCols' => "$['author']",
|
||||
'onBeforeCreate' => '$Listview.funcBox.beforeUserComments'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['commentpreview', array(
|
||||
'data' => $_,
|
||||
'hiddenCols' => ['author'],
|
||||
'onBeforeCreate' => '$Listview.funcBox.beforeUserComments'
|
||||
)];
|
||||
}
|
||||
|
||||
// replies
|
||||
@@ -259,13 +251,10 @@ class AccountPage extends GenericPage
|
||||
// _totalCount: 377,
|
||||
// note: $WH.sprintf(LANG.lvnote_usercomments, 377),
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'replypreview',
|
||||
'data' => $_,
|
||||
'params' => array(
|
||||
'hiddenCols' => "$['author']"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['replypreview', array(
|
||||
'data' => $_,
|
||||
'hiddenCols' => ['author']
|
||||
)];
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -219,15 +219,12 @@ class AchievementPage extends GenericPage
|
||||
['id', $this->typeId, '!']
|
||||
);
|
||||
$saList = new AchievementList($conditions);
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $saList->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'see-also',
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'visibleCols' => "$['category']"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['achievement', array(
|
||||
'data' => array_values($saList->getListviewData()),
|
||||
'id' => 'see-also',
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'visibleCols' => ['category']
|
||||
)];
|
||||
$this->extendGlobalData($saList->getJSGlobals());
|
||||
|
||||
// tab: criteria of
|
||||
@@ -238,15 +235,12 @@ class AchievementPage extends GenericPage
|
||||
if (!empty($refs))
|
||||
{
|
||||
$coList = new AchievementList(array(['id', $refs]));
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $coList->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'criteria-of',
|
||||
'name' => '$LANG.tab_criteriaof',
|
||||
'visibleCols' => "$['category']"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['achievement', array(
|
||||
'data' => array_values($coList->getListviewData()),
|
||||
'id' => 'criteria-of',
|
||||
'name' => '$LANG.tab_criteriaof',
|
||||
'visibleCols' => ['category']
|
||||
)];
|
||||
$this->extendGlobalData($coList->getJSGlobals());
|
||||
}
|
||||
|
||||
|
||||
@@ -88,37 +88,33 @@ class AchievementsPage extends GenericPage
|
||||
$acvList = new AchievementList($conditions);
|
||||
}
|
||||
|
||||
$params = $data = [];
|
||||
$tabData = [];
|
||||
if (!$acvList->error)
|
||||
{
|
||||
$data = $acvList->getListviewData();
|
||||
$tabData['data'] = array_values($acvList->getListviewData());
|
||||
|
||||
// fill g_items, g_titles, g_achievements
|
||||
$this->extendGlobalData($acvList->getJSGlobals());
|
||||
|
||||
// if we are have different cats display field
|
||||
if ($acvList->hasDiffFields(['category']))
|
||||
$params['visibleCols'] = "$['category']";
|
||||
$tabData['visibleCols'] = ['category'];
|
||||
|
||||
if (!empty($this->filter['fi']['extraCols']))
|
||||
$params['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($acvList->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
{
|
||||
$params['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$params['_truncated'] = 1;
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
if ($this->filterObj->error)
|
||||
$params['_errors'] = '$1';
|
||||
$tabData['_errors'] = 1;
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $data,
|
||||
'params' => $params
|
||||
);
|
||||
$this->lvTabs[] = ['achievement', $tabData];
|
||||
|
||||
// sort for dropdown-menus in filter
|
||||
Lang::sort('game', 'si');
|
||||
|
||||
@@ -362,24 +362,18 @@ class AdminPage extends GenericPage
|
||||
}
|
||||
|
||||
foreach ($mainTab as $n => $t)
|
||||
$this->lvTabs[] = array(
|
||||
'file' => null,
|
||||
'data' => $t,
|
||||
'params' => array(
|
||||
'name' => $n,
|
||||
'id' => Util::urlize($n)
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = [null, array(
|
||||
'data' => $t,
|
||||
'name' => $n,
|
||||
'id' => Util::urlize($n)
|
||||
)];
|
||||
|
||||
foreach ($miscTab as $n => $t)
|
||||
$this->lvTabs[] = array(
|
||||
'file' => null,
|
||||
'data' => $t,
|
||||
'params' => array(
|
||||
'name' => $n,
|
||||
'id' => Util::urlize($n)
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = [null, array(
|
||||
'data' => $t,
|
||||
'name' => $n,
|
||||
'id' => Util::urlize($n)
|
||||
)];
|
||||
}
|
||||
|
||||
private function handlePhpInfo()
|
||||
@@ -428,26 +422,20 @@ class AdminPage extends GenericPage
|
||||
else
|
||||
$name .= $p[0];
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => null,
|
||||
'data' => $body,
|
||||
'params' => array(
|
||||
'id' => strtolower(strtr($name, [' ' => ''])),
|
||||
'name' => $name
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = [null, array(
|
||||
'data' => $body,
|
||||
'id' => strtolower(strtr($name, [' ' => ''])),
|
||||
'name' => $name
|
||||
)];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => null,
|
||||
'data' => $buff,
|
||||
'params' => array(
|
||||
'id' => strtolower($names[$i]),
|
||||
'name' => $names[$i]
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = [null, array(
|
||||
'data' => $buff,
|
||||
'id' => strtolower($names[$i]),
|
||||
'name' => $names[$i]
|
||||
)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
100
pages/class.php
100
pages/class.php
@@ -135,19 +135,16 @@ class ClassPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($genSpells->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $genSpells->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'spells',
|
||||
'name' => '$LANG.tab_spells',
|
||||
'visibleCols' => "$['level', 'schools', 'type', 'classes']",
|
||||
'hiddenCols' => "$['reagents', 'skill']",
|
||||
'sort' => "$['-level', 'type', 'name']",
|
||||
'computeDataFunc' => '$Listview.funcBox.initSpellFilter',
|
||||
'onAfterCreate' => '$Listview.funcBox.addSpellIndicator'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($genSpells->getListviewData()),
|
||||
'id' => 'spells',
|
||||
'name' => '$LANG.tab_spells',
|
||||
'visibleCols' => ['level', 'schools', 'type', 'classes'],
|
||||
'hiddenCols' => ['reagents', 'skill'],
|
||||
'sort' => ['-level', 'type', 'name'],
|
||||
'computeDataFunc' => '$Listview.funcBox.initSpellFilter',
|
||||
'onAfterCreate' => '$Listview.funcBox.addSpellIndicator'
|
||||
)];
|
||||
}
|
||||
|
||||
// Tab: Items (grouped)
|
||||
@@ -156,7 +153,7 @@ class ClassPage extends GenericPage
|
||||
['requiredClass', $_mask, '&'],
|
||||
[['requiredClass', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL, '!'],
|
||||
['itemset', 0], // hmm, do or dont..?
|
||||
0
|
||||
CFG_SQL_LIMIT_NONE
|
||||
);
|
||||
|
||||
$items = new ItemList($conditions);
|
||||
@@ -164,23 +161,21 @@ class ClassPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($items->getJSGlobals());
|
||||
|
||||
if (!$items->hasDiffFields(['requiredRace']))
|
||||
$hidden = "$['side']";
|
||||
$hiddenCols = null;
|
||||
if ($items->hasDiffFields(['requiredRace']))
|
||||
$hiddenCols = ['side'];
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $items->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'items',
|
||||
'name' => '$LANG.tab_items',
|
||||
'visibleCols' => "$['dps', 'armor', 'slot']",
|
||||
'hiddenCols' => isset($hidden) ? $hidden : null,
|
||||
'computeDataFunc' => '$Listview.funcBox.initSubclassFilter',
|
||||
'onAfterCreate' => '$Listview.funcBox.addSubclassIndicator',
|
||||
'note' => sprintf(Util::$filterResultString, '?items&filter=cr=152;crs='.$this->typeId.';crv=0'),
|
||||
'_truncated' => 1
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($items->getListviewData()),
|
||||
'id' => 'items',
|
||||
'name' => '$LANG.tab_items',
|
||||
'visibleCols' => ['dps', 'armor', 'slot'],
|
||||
'hiddenCols' => $hiddenCols,
|
||||
'computeDataFunc' => '$Listview.funcBox.initSubclassFilter',
|
||||
'onAfterCreate' => '$Listview.funcBox.addSubclassIndicator',
|
||||
'note' => sprintf(Util::$filterResultString, '?items&filter=cr=152;crs='.$this->typeId.';crv=0'),
|
||||
'_truncated' => 1
|
||||
)];
|
||||
}
|
||||
|
||||
// Tab: Quests
|
||||
@@ -194,11 +189,10 @@ class ClassPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($quests->getJSGlobals());
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $quests->getListviewData(),
|
||||
'params' => ['sort' => "$['reqlevel', 'name']"]
|
||||
);
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($quests->getListviewData()),
|
||||
'sort' => ['reqlevel', 'name']
|
||||
)];
|
||||
}
|
||||
|
||||
// Tab: Itemsets
|
||||
@@ -207,15 +201,12 @@ class ClassPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($sets->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'itemset',
|
||||
'data' => $sets->getListviewData(),
|
||||
'params' => array(
|
||||
'note' => sprintf(Util::$filterResultString, '?itemsets&filter=cl='.$this->typeId),
|
||||
'hiddenCols' => "$['classes']",
|
||||
'sort' => "$['-level', 'name']"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['itemset', array(
|
||||
'data' => array_values($sets->getListviewData()),
|
||||
'note' => sprintf(Util::$filterResultString, '?itemsets&filter=cl='.$this->typeId),
|
||||
'hiddenCols' => ['classes'],
|
||||
'sort' => ['-level', 'name']
|
||||
)];
|
||||
}
|
||||
|
||||
// Tab: Trainer
|
||||
@@ -228,26 +219,17 @@ class ClassPage extends GenericPage
|
||||
$trainer = new CreatureList($conditions);
|
||||
if (!$trainer->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'creature',
|
||||
'data' => $trainer->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'trainers',
|
||||
'name' => '$LANG.tab_trainers'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['creature', array(
|
||||
'data' => array_values($trainer->getListviewData()),
|
||||
'id' => 'trainers',
|
||||
'name' => '$LANG.tab_trainers'
|
||||
)];
|
||||
}
|
||||
|
||||
// Tab: Races
|
||||
$races = new CharRaceList(array(['classMask', $_mask, '&']));
|
||||
if (!$races->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'race',
|
||||
'data' => $races->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['race', ['data' => array_values($races->getListviewData())]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,13 +27,7 @@ class ClassesPage extends GenericPage
|
||||
{
|
||||
$classes = new CharClassList();
|
||||
if (!$classes->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'class',
|
||||
'data' => $classes->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['class', ['data' => array_values($classes->getListviewData())]];
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
|
||||
@@ -64,7 +64,12 @@ class ComparePage extends GenericPage
|
||||
|
||||
$outSet[] = $outString;
|
||||
}
|
||||
$this->summary = $outSet;
|
||||
$this->summary = array(
|
||||
'template' => 'compare',
|
||||
'id' => 'compare',
|
||||
'parent' => 'compare-generic',
|
||||
'groups' => $outSet
|
||||
);
|
||||
|
||||
$iList = new ItemList(array(['i.id', $items]));
|
||||
$data = $iList->getListviewData(ITEMINFO_SUBITEMS | ITEMINFO_JSON);
|
||||
@@ -78,12 +83,11 @@ class ComparePage extends GenericPage
|
||||
foreach ($data[$itemId]['subitems'] as &$si)
|
||||
$si['enchantment'] = implode(', ', $si['enchantment']);
|
||||
|
||||
$this->cmpItems[] = [
|
||||
$itemId,
|
||||
$iList->getField('name', true),
|
||||
$iList->getField('quality'),
|
||||
$iList->getField('iconString'),
|
||||
$data[$itemId]
|
||||
$this->cmpItems[$itemId] = [
|
||||
'name_'.User::$localeString => $iList->getField('name', true),
|
||||
'quality' => $iList->getField('quality'),
|
||||
'icon' => $iList->getField('iconString'),
|
||||
'jsonequip' => $data[$itemId]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,11 +37,7 @@ class CurrenciesPage extends GenericPage
|
||||
$conditions[] = ['category', (int)$this->category[0]];
|
||||
|
||||
$money = new CurrencyList($conditions);
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'currency',
|
||||
'data' => $money->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['currency', ['data' => array_values($money->getListviewData())]];
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
|
||||
@@ -87,20 +87,8 @@ class CurrencyPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($lootTabs->jsGlobals);
|
||||
|
||||
foreach ($lootTabs->iterate() as $tab)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => $tab[0],
|
||||
'data' => $tab[1],
|
||||
'params' => [
|
||||
'name' => $tab[2],
|
||||
'id' => $tab[3],
|
||||
'extraCols' => $tab[4] ? '$['.implode(', ', array_unique($tab[4])).']' : null,
|
||||
'hiddenCols' => $tab[5] ? '$['.implode(', ', array_unique($tab[5])).']' : null,
|
||||
'visibleCols' => $tab[6] ? '$'. Util::toJSON( array_unique($tab[6])) : null
|
||||
]
|
||||
);
|
||||
}
|
||||
foreach ($lootTabs->iterate() as list($file, $tabData))
|
||||
$this->lvTabs[] = [$file, $tabData];
|
||||
}
|
||||
|
||||
// tab: sold by
|
||||
@@ -114,7 +102,7 @@ class CurrencyPage extends GenericPage
|
||||
if (!$soldBy->error)
|
||||
{
|
||||
$sbData = $soldBy->getListviewData();
|
||||
$extraCols = ['Listview.extraCols.stock', "Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", 'Listview.extraCols.cost'];
|
||||
$extraCols = ['$Listview.extraCols.stock', "\$Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", 'Listview.extraCols.cost'];
|
||||
$holidays = [];
|
||||
|
||||
foreach ($sbData as $k => &$row)
|
||||
@@ -135,7 +123,7 @@ class CurrencyPage extends GenericPage
|
||||
if ($vendors[$k]['event'])
|
||||
{
|
||||
if (count($extraCols) == 3) // not already pushed
|
||||
$extraCols[] = 'Listview.extraCols.condition';
|
||||
$extraCols[] = '$Listview.extraCols.condition';
|
||||
|
||||
$this->extendGlobalIds(TYPE_WORLDEVENT, $vendors[$k]['event']);
|
||||
$row['condition'][0][$this->typeId][] = [[CND_ACTIVE_EVENT, $vendors[$k]['event']]];
|
||||
@@ -150,16 +138,13 @@ class CurrencyPage extends GenericPage
|
||||
);
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'creature',
|
||||
'data' => $sbData,
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_soldby',
|
||||
'id' => 'sold-by-npc',
|
||||
'extraCols' => '$['.implode(', ', $extraCols).']',
|
||||
'hiddenCols' => "$['level', 'type']"
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['creature', array(
|
||||
'data' => array_values($sbData),
|
||||
'name' => '$LANG.tab_soldby',
|
||||
'id' => 'sold-by-npc',
|
||||
'extraCols' => $extraCols,
|
||||
'hiddenCols' => ['level', 'type']
|
||||
)];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,18 +157,16 @@ class CurrencyPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($createdBy->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
|
||||
if ($createdBy->hasSetFields(['reagent1']))
|
||||
$visCols = ['reagents'];
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $createdBy->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_createdby',
|
||||
'id' => 'created-by',
|
||||
'visibleCols' => isset($visCols) ? '$'.Util::toJSON($visCols) : null
|
||||
]
|
||||
$tabData = array(
|
||||
'data' => array_values($createdBy->getListviewData()),
|
||||
'name' => '$LANG.tab_createdby',
|
||||
'id' => 'created-by',
|
||||
);
|
||||
|
||||
if ($createdBy->hasSetFields(['reagent1']))
|
||||
$tabData['visibleCols'] = ['reagents'];
|
||||
|
||||
$this->lvTabs[] = ['spell', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,20 +194,18 @@ class CurrencyPage extends GenericPage
|
||||
$boughtBy = new ItemList(array(['id', $boughtBy]));
|
||||
if (!$boughtBy->error)
|
||||
{
|
||||
if ($boughtBy->getMatches() <= CFG_SQL_LIMIT_DEFAULT)
|
||||
$n = null;
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $boughtBy->getListviewData(ITEMINFO_VENDOR, [TYPE_CURRENCY => $this->typeId]),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_currencyfor',
|
||||
'id' => 'currency-for',
|
||||
'extraCols' => "$[Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')]",
|
||||
'note' => $n ? sprintf(Util::$filterResultString, $n) : null
|
||||
]
|
||||
$tabData = array(
|
||||
'data' => array_values($boughtBy->getListviewData(ITEMINFO_VENDOR, [TYPE_CURRENCY => $this->typeId])),
|
||||
'name' => '$LANG.tab_currencyfor',
|
||||
'id' => 'currency-for',
|
||||
'extraCols' => ["\$Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')"],
|
||||
);
|
||||
|
||||
if ($boughtBy->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, $n);
|
||||
|
||||
$this->lvTabs[] = ['item', $tabData];
|
||||
|
||||
$this->extendGlobalData($boughtBy->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,11 +93,7 @@ class EmotePage extends GenericPage
|
||||
);
|
||||
$acv = new AchievementList($condition);
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $acv->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['achievement', ['data' => array_values($acv->getListviewData())]];
|
||||
|
||||
$this->extendGlobalData($acv->getJsGlobals());
|
||||
}
|
||||
|
||||
@@ -25,11 +25,12 @@ class EmotesPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'emote',
|
||||
'data' => (new EmoteList())->getListviewData(),
|
||||
'params' => []
|
||||
$tabData = array(
|
||||
'data' => array_values((new EmoteList())->getListviewData()),
|
||||
'name' => Util::ucFirst(Lang::game('emotes'))
|
||||
);
|
||||
|
||||
$this->lvTabs[] = ['emote', $tabData, 'emote'];
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
|
||||
@@ -175,14 +175,11 @@ class EnchantmentPage extends GenericPage
|
||||
$gemList = new ItemList(array(['gemEnchantmentId', $this->typeId]));
|
||||
if (!$gemList->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $gemList->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_usedby + \' \' + LANG.gems',
|
||||
'id' => 'used-by-gem',
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($gemList->getListviewData()),
|
||||
'name' => '$LANG.tab_usedby + \' \' + LANG.gems',
|
||||
'id' => 'used-by-gem',
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($gemList->getJsGlobals());
|
||||
}
|
||||
@@ -191,14 +188,11 @@ class EnchantmentPage extends GenericPage
|
||||
$socketsList = new ItemList(array(['socketBonus', $this->typeId]));
|
||||
if (!$socketsList->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $socketsList->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_usedby + \' \' + \''.Lang::item('socketBonus').'\'',
|
||||
'id' => 'used-by-socketbonus',
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($socketsList->getListviewData()),
|
||||
'name' => '$LANG.tab_usedby + \' \' + \''.Lang::item('socketBonus').'\'',
|
||||
'id' => 'used-by-socketbonus',
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($socketsList->getJsGlobals());
|
||||
}
|
||||
@@ -230,14 +224,11 @@ class EnchantmentPage extends GenericPage
|
||||
$ubItems = new ItemList($conditions);
|
||||
if (!$ubItems->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $ubItems->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_usedby + \' \' + LANG.types[3][0]',
|
||||
'id' => 'used-by-item',
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($ubItems->getListviewData()),
|
||||
'name' => '$LANG.tab_usedby + \' \' + LANG.types[3][0]',
|
||||
'id' => 'used-by-item',
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($ubItems->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
@@ -266,14 +257,11 @@ class EnchantmentPage extends GenericPage
|
||||
}
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $spellData,
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_usedby + \' \' + LANG.types[6][0]',
|
||||
'id' => 'used-by-spell',
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($spellData),
|
||||
'name' => '$LANG.tab_usedby + \' \' + LANG.types[6][0]',
|
||||
'id' => 'used-by-spell',
|
||||
)];
|
||||
}
|
||||
|
||||
// used by randomAttrItem
|
||||
@@ -303,15 +291,12 @@ class EnchantmentPage extends GenericPage
|
||||
$data[$iId]['name'] .= ' '.Util::localizedString($ire[$iet[abs($re)]['ench']], 'name');
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $data,
|
||||
'params' => array(
|
||||
'id' => 'used-by-rand',
|
||||
'name' => '$LANG.tab_usedby + \' \' + \''.Lang::item('_rndEnchants').'\'',
|
||||
'extraCols' => '$[Listview.extraCols.percent]'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($data),
|
||||
'id' => 'used-by-rand',
|
||||
'name' => '$LANG.tab_usedby + \' \' + \''.Lang::item('_rndEnchants').'\'',
|
||||
'extraCols' => ['$Listview.extraCols.percent']
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($randItems->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
|
||||
@@ -30,10 +30,9 @@ class EnchantmentsPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$tab = array(
|
||||
'file' => 'enchantment',
|
||||
'data' => [],
|
||||
'params' => []
|
||||
$tabData = array(
|
||||
'data' => [],
|
||||
'name' => Util::ucFirst(Lang::game('enchantments'))
|
||||
);
|
||||
|
||||
$conditions = [];
|
||||
@@ -46,7 +45,7 @@ class EnchantmentsPage extends GenericPage
|
||||
|
||||
$ench = new EnchantmentList($conditions);
|
||||
|
||||
$tab['data'] = $ench->getListviewData();
|
||||
$tabData['data'] = array_values($ench->getListviewData());
|
||||
$this->extendGlobalData($ench->getJSGlobals());
|
||||
|
||||
// recreate form selection
|
||||
@@ -56,34 +55,34 @@ class EnchantmentsPage extends GenericPage
|
||||
|
||||
$xCols = $this->filterObj->getForm('extraCols', true);
|
||||
foreach (Util::$itemFilter as $fiId => $str)
|
||||
if (array_column($tab['data'], $str))
|
||||
if (array_column($tabData['data'], $str))
|
||||
$xCols[] = $fiId;
|
||||
|
||||
if (array_column($tab['data'], 'dmg'))
|
||||
if (array_column($tabData['data'], 'dmg'))
|
||||
$xCols[] = 34;
|
||||
|
||||
if ($xCols)
|
||||
$this->filter['fi']['extraCols'] = "fi_extraCols = ".Util::toJSON(array_values(array_unique($xCols))).";";
|
||||
|
||||
if (!empty($this->filter['fi']['extraCols']))
|
||||
$tab['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
if ($ench->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
{
|
||||
$tab['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_enchantmentsfound', $ench->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tab['params']['_truncated'] = 1;
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_enchantmentsfound', $ench->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
if (array_filter(array_column($tab['data'], 'spells')))
|
||||
$tab['params']['visibleCols'] = '$[\'trigger\']';
|
||||
if (array_filter(array_column($tabData['data'], 'spells')))
|
||||
$tabData['visibleCols'] = ['trigger'];
|
||||
|
||||
if (!$ench->hasSetFields(['skillLine']))
|
||||
$tab['params']['hiddenCols'] = '$[\'skill\']';
|
||||
$tabData['hiddenCols'] = ['skill'];
|
||||
|
||||
if ($this->filterObj->error)
|
||||
$tab['params']['_errors'] = '$1';
|
||||
$tabData['_errors'] = '$1';
|
||||
|
||||
$this->lvTabs[] = $tab;
|
||||
$this->lvTabs[] = ['enchantment', $tabData, 'enchantment'];
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
|
||||
@@ -112,11 +112,12 @@ class EventPage extends GenericPage
|
||||
foreach ($data as &$d)
|
||||
$d['method'] = $npcIds[$d['id']];
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => CreatureList::$brickFile,
|
||||
'data' => $data,
|
||||
'params' => ['note' => $hasFilter ? sprintf(Util::$filterResultString, '?npcs&filter=cr=38;crs='.$this->hId.';crv=0') : null]
|
||||
);
|
||||
$tabData = ['data' => array_values($data)];
|
||||
|
||||
if ($hasFilter)
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=38;crs='.$this->hId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = ['creature', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,11 +131,12 @@ class EventPage extends GenericPage
|
||||
foreach ($data as &$d)
|
||||
$d['method'] = $objectIds[$d['id']];
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => GameObjectList::$brickFile,
|
||||
'data' => $data,
|
||||
'params' => ['note' => $hasFilter ? sprintf(Util::$filterResultString, '?objects&filter=cr=16;crs='.$this->hId.';crv=0') : null]
|
||||
);
|
||||
$tabData = ['data' => array_values($data)];
|
||||
|
||||
if ($hasFilter)
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?objects&filter=cr=16;crs='.$this->hId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = ['object', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,14 +149,15 @@ class EventPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($acvs->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => AchievementList::$brickFile,
|
||||
'data' => $acvs->getListviewData(),
|
||||
'params' => array(
|
||||
'note' => $hasFilter ? sprintf(Util::$filterResultString, '?achievements&filter=cr=11;crs='.$this->hId.';crv=0') : null,
|
||||
'visibleCols' => "$['category']"
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($acvs->getListviewData()),
|
||||
'visibleCols' => ['category']
|
||||
);
|
||||
|
||||
if ($hasFilter)
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?achievements&filter=cr=11;crs='.$this->hId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = ['achievement', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,11 +175,12 @@ class EventPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($quests->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_REWARDS));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => QuestList::$brickFile,
|
||||
'data' => $quests->getListviewData(),
|
||||
'params' => ['note' => $hasFilter ? sprintf(Util::$filterResultString, '?quests&filter=cr=33;crs='.$this->hId.';crv=0') : null]
|
||||
);
|
||||
$tabData = ['data'=> array_values($quests->getListviewData())];
|
||||
|
||||
if ($hasFilter)
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=33;crs='.$this->hId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = ['quest', $tabData];
|
||||
|
||||
$questItems = [];
|
||||
foreach (array_column($quests->rewards, TYPE_ITEM) as $arr)
|
||||
@@ -208,11 +212,12 @@ class EventPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($eventItems->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => ItemList::$brickFile,
|
||||
'data' => $eventItems->getListviewData(),
|
||||
'params' => ['note' => $hasFilter ? sprintf(Util::$filterResultString, '?items&filter=cr=160;crs='.$this->hId.';crv=0') : null]
|
||||
);
|
||||
$tabData = ['data'=> array_values($eventItems->getListviewData())];
|
||||
|
||||
if ($hasFilter)
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=160;crs='.$this->hId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = ['item', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,16 +254,13 @@ class EventPage extends GenericPage
|
||||
$relData = array_merge($relData, $d);
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => WorldEventList::$brickFile,
|
||||
'data' => $relData,
|
||||
'params' => array(
|
||||
'id' => 'see-also',
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'hiddenCols' => "$['date']",
|
||||
'extraCols' => '$[Listview.extraCols.condition]'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['event', array(
|
||||
'data' => array_values($relData),
|
||||
'id' => 'see-also',
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'hiddenCols' => ['date'],
|
||||
'extraCols' => ['$Listview.extraCols.condition']
|
||||
)];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -308,10 +310,10 @@ class EventPage extends GenericPage
|
||||
|
||||
foreach ($this->lvTabs as &$view)
|
||||
{
|
||||
if ($view['file'] != WorldEventList::$brickFile)
|
||||
if ($view[0] != WorldEventList::$brickFile)
|
||||
continue;
|
||||
|
||||
foreach ($view['data'] as &$data)
|
||||
foreach ($view[1]['data'] as &$data)
|
||||
{
|
||||
$updated = WorldEventList::updateDates($data['_date']);
|
||||
unset($data['_date']);
|
||||
|
||||
@@ -52,19 +52,16 @@ class EventsPage extends GenericPage
|
||||
if ($d = $events->getField('requires'))
|
||||
$this->deps[$events->id] = $d;
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'event',
|
||||
'data' => $events->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
$data = array_values($events->getListviewData());
|
||||
|
||||
if ($_ = array_filter($events->getListviewData(), function($x) {return $x['id'] > 0;}))
|
||||
$this->lvTabs[] = ['event', ['data' => $data]];
|
||||
|
||||
if ($_ = array_filter($data, function($x) {return $x['id'] > 0;}))
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'calendar',
|
||||
'data' => $_,
|
||||
'params' => ['hideCount' => 1]
|
||||
);
|
||||
$this->lvTabs[] = ['calendar', array(
|
||||
'data' => $_,
|
||||
'hideCount' => 1
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +83,7 @@ class EventsPage extends GenericPage
|
||||
// recalculate dates with now()
|
||||
foreach ($this->lvTabs as &$views)
|
||||
{
|
||||
foreach ($views['data'] as &$data)
|
||||
foreach ($views[1]['data'] as &$data)
|
||||
{
|
||||
// is a followUp-event
|
||||
if (!empty($this->deps[$data['id']]))
|
||||
|
||||
@@ -175,20 +175,16 @@ class FactionPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($items->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$tab = array(
|
||||
'file' => 'item',
|
||||
'data' => $items->getListviewData(),
|
||||
'showRep' => true,
|
||||
'params' => array(
|
||||
'extraCols' => '$_',
|
||||
'sort' => "$['standing', 'name']"
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($items->getListviewData()),
|
||||
'extraCols' => '$_',
|
||||
'sort' => ['standing', 'name']
|
||||
);
|
||||
|
||||
if ($items->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
$tab['params']['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$this->typeId.';crv=0');
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$this->typeId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = $tab;
|
||||
$this->lvTabs[] = ['item', $tabData, 'itemStandingCol'];
|
||||
}
|
||||
|
||||
// tab: creatures with onKill reputation
|
||||
@@ -212,20 +208,16 @@ class FactionPage extends GenericPage
|
||||
foreach ($data as $id => &$d)
|
||||
$d['reputation'] = $cRep[$id];
|
||||
|
||||
$tab = array(
|
||||
'file' => 'creature',
|
||||
'data' => $data,
|
||||
'showRep' => true,
|
||||
'params' => array(
|
||||
'extraCols' => '$_',
|
||||
'sort' => "$['-reputation', 'name']"
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($data),
|
||||
'extraCols' => '$_',
|
||||
'sort' => ['-reputation', 'name']
|
||||
);
|
||||
|
||||
if ($killCreatures->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
$tab['params']['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=42;crs='.$this->typeId.';crv=0');
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=42;crs='.$this->typeId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = $tab;
|
||||
$this->lvTabs[] = ['creature', $tabData, 'npcRepCol'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,20 +228,16 @@ class FactionPage extends GenericPage
|
||||
$members = new CreatureList(array(['faction', $_]));
|
||||
if (!$members->error)
|
||||
{
|
||||
$tab = array(
|
||||
'file' => 'creature',
|
||||
'data' => $members->getListviewData(),
|
||||
'showRep' => true,
|
||||
'params' => array(
|
||||
'id' => 'member',
|
||||
'name' => '$LANG.tab_members'
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($members->getListviewData()),
|
||||
'id' => 'member',
|
||||
'name' => '$LANG.tab_members'
|
||||
);
|
||||
|
||||
if ($members->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
$tab['params']['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=3;crs='.$this->typeId.';crv=0');
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=3;crs='.$this->typeId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = $tab;
|
||||
$this->lvTabs[] = ['creature', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,13 +246,7 @@ class FactionPage extends GenericPage
|
||||
{
|
||||
$objects = new GameObjectList(array(['faction', $_]));
|
||||
if (!$objects->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'object',
|
||||
'data' => $objects->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['object', ['data' => array_values($objects->getListviewData())]];
|
||||
}
|
||||
|
||||
// tab: quests
|
||||
@@ -281,17 +263,15 @@ class FactionPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($quests->getJSGlobals(GLOBALINFO_ANY));
|
||||
|
||||
$tab = array(
|
||||
'file' => 'quest',
|
||||
'data' => $quests->getListviewData($this->typeId),
|
||||
'showRep' => true,
|
||||
'params' => ['extraCols' => '$_']
|
||||
$tabData = array(
|
||||
'data' => array_values($quests->getListviewData($this->typeId)),
|
||||
'extraCols' => '$_'
|
||||
);
|
||||
|
||||
if ($quests->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
$tab['params']['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=1;crs='.$this->typeId.';crv=0');
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=1;crs='.$this->typeId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = $tab;
|
||||
$this->lvTabs[] = ['quest', $tabData, 'questRepCol'];
|
||||
}
|
||||
|
||||
// tab: achievements
|
||||
@@ -304,15 +284,12 @@ class FactionPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($acvs->getJSGlobals(GLOBALINFO_ANY));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $acvs->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'criteria-of',
|
||||
'name' => '$LANG.tab_criteriaof',
|
||||
'visibleCols' => "$['category']"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['achievement', array(
|
||||
'data' => array_values($acvs->getListviewData()),
|
||||
'id' => 'criteria-of',
|
||||
'name' => '$LANG.tab_criteriaof',
|
||||
'visibleCols' => ['category']
|
||||
)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,13 +53,9 @@ class FactionsPage extends GenericPage
|
||||
$data = [];
|
||||
$factions = new FactionList($conditions);
|
||||
if (!$factions->error)
|
||||
$data = $factions->getListviewData();
|
||||
$data = array_values($factions->getListviewData());
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'faction',
|
||||
'data' => $data,
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['faction', ['data' => $data]];
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
|
||||
@@ -103,6 +103,36 @@ class GenericPage
|
||||
private $memcached = null;
|
||||
private $mysql = ['time' => 0, 'count' => 0];
|
||||
|
||||
private $lvTemplates = array(
|
||||
'achievement' => ['template' => 'achievement', 'id' => 'achievements', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_achievements' ],
|
||||
'calendar' => ['template' => 'holidaycal', 'id' => 'calendar', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_calendar' ],
|
||||
'class' => ['template' => 'classs', 'id' => 'classes', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_classes' ],
|
||||
'commentpreview' => ['template' => 'commentpreview', 'id' => 'comments', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_comments' ],
|
||||
'creature' => ['template' => 'npc', 'id' => 'npcs', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_npcs' ],
|
||||
'currency' => ['template' => 'currency', 'id' => 'currencies', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_currencies' ],
|
||||
'emote' => ['template' => 'emote', 'id' => 'emotes', 'parent' => 'lv-generic', 'data' => [] ],
|
||||
'enchantment' => ['template' => 'enchantment', 'id' => 'enchantments', 'parent' => 'lv-generic', 'data' => [] ],
|
||||
'event' => ['template' => 'holiday', 'id' => 'holidays', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_holidays' ],
|
||||
'faction' => ['template' => 'faction', 'id' => 'factions', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_factions' ],
|
||||
'genericmodel' => ['template' => 'genericmodel', 'id' => 'same-model-as', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_samemodelas' ],
|
||||
'item' => ['template' => 'item', 'id' => 'items', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_items' ],
|
||||
'itemset' => ['template' => 'itemset', 'id' => 'itemsets', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_itemsets' ],
|
||||
'model' => ['template' => 'model', 'id' => 'gallery', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_gallery' ],
|
||||
'object' => ['template' => 'object', 'id' => 'objects', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_objects' ],
|
||||
'pet' => ['template' => 'pet', 'id' => 'hunter-pets', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_pets' ],
|
||||
'profile' => ['template' => 'profile', 'id' => 'profiles', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_profiles' ],
|
||||
'quest' => ['template' => 'quest', 'id' => 'quests', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_quests' ],
|
||||
'race' => ['template' => 'race', 'id' => 'races', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_races' ],
|
||||
'replypreview' => ['template' => 'replypreview', 'id' => 'comment-replies', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_commentreplies'],
|
||||
'reputationhistory' => ['template' => 'reputationhistory', 'id' => 'reputation', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_reputation' ],
|
||||
'screenshot' => ['template' => 'screenshot', 'id' => 'screenshots', 'parent' => 'lv-generic', 'data' => [] ],
|
||||
'skill' => ['template' => 'skill', 'id' => 'skills', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_skills' ],
|
||||
'spell' => ['template' => 'spell', 'id' => 'spells', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_spells' ],
|
||||
'title' => ['template' => 'title', 'id' => 'titles', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_titles' ],
|
||||
'video' => ['template' => 'video', 'id' => 'videos', 'parent' => 'lv-generic', 'data' => [], ],
|
||||
'zone' => ['template' => 'zone', 'id' => 'zones', 'parent' => 'lv-generic', 'data' => [], 'name' => '$LANG.tab_zones' ]
|
||||
);
|
||||
|
||||
public function __construct($pageCall/*, $pageParam */)
|
||||
{
|
||||
$this->time = microtime(true);
|
||||
@@ -518,18 +548,15 @@ class GenericPage
|
||||
$$n = $v;
|
||||
|
||||
if (!$this->isSaneInclude('template/bricks/', $file))
|
||||
echo User::isInGroup(U_GROUP_EMPLOYEE) ? "\n\nError: nonexistant template requested: template/bricks/".$file.".tpl.php\n\n" : null;
|
||||
trigger_error("Nonexistant template requested: template/bricks/".$file.".tpl.php");
|
||||
else
|
||||
include('template/bricks/'.$file.'.tpl.php');
|
||||
}
|
||||
|
||||
public function lvBrick($file, array $localVars = []) // load listview
|
||||
public function lvBrick($file) // load listview addIns
|
||||
{
|
||||
foreach ($localVars as $n => $v)
|
||||
$$n = $v;
|
||||
|
||||
if (!$this->isSaneInclude('template/listviews/', $file))
|
||||
echo User::isInGroup(U_GROUP_EMPLOYEE) ? "\n\nError: nonexistant template requested: template/listviews/".$file.".tpl.php\n\n" : null;
|
||||
trigger_error('Nonexistant Listview addin requested: template/listviews/'.$file.'.tpl.php');
|
||||
else
|
||||
include('template/listviews/'.$file.'.tpl.php');
|
||||
}
|
||||
@@ -539,7 +566,7 @@ class GenericPage
|
||||
if (!$this->isSaneInclude('template/localized/', $file.'_'.$loc))
|
||||
{
|
||||
if ($loc == LOCALE_EN || !$this->isSaneInclude('template/localized/', $file.'_'.LOCALE_EN))
|
||||
echo User::isInGroup(U_GROUP_EMPLOYEE) ? "\n\nError: nonexistant template requested: template/localized/".$file.'_'.$loc.".tpl.php\n\n" : null;
|
||||
trigger_error("Nonexistant template requested: template/localized/".$file.'_'.$loc.".tpl.php");
|
||||
else
|
||||
include('template/localized/'.$file.'_'.LOCALE_EN.'.tpl.php');
|
||||
}
|
||||
|
||||
301
pages/item.php
301
pages/item.php
@@ -438,15 +438,12 @@ class ItemPage extends genericPage
|
||||
$this->extendGlobalIDs(TYPE_SPELL, $perfItem[$sId]['requiredSpecialization']);
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $lvData,
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_createdby',
|
||||
'id' => 'created-by', // should by exclusive with created-by from spell_loot
|
||||
'extraCols' => '$[Listview.extraCols.percent, Listview.extraCols.condition]'
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($lvData),
|
||||
'name' => '$LANG.tab_createdby',
|
||||
'id' => 'created-by', // should by exclusive with created-by from spell_loot
|
||||
'extraCols' => ['$Listview.extraCols.percent', '$Listview.extraCols.condition']
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,34 +454,24 @@ class ItemPage extends genericPage
|
||||
{
|
||||
$this->extendGlobalData($lootTabs->jsGlobals);
|
||||
|
||||
foreach ($lootTabs->iterate() as $idx => $tab)
|
||||
foreach ($lootTabs->iterate() as $idx => list($file, $tabData))
|
||||
{
|
||||
if (!$tab[1])
|
||||
if (!$tabData['data'])
|
||||
continue;
|
||||
|
||||
if ($idx == 16)
|
||||
$createdBy = array_column($tab[1], 'id');
|
||||
$createdBy = array_column($tabData['data'], 'id');
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => $tab[0],
|
||||
'data' => $tab[1],
|
||||
'params' => [
|
||||
'name' => $tab[2],
|
||||
'id' => $tab[3],
|
||||
'extraCols' => $tab[4] ? '$['.implode(', ', array_unique($tab[4])).']' : null,
|
||||
'hiddenCols' => $tab[5] ? '$ '.Util::toJSON( array_unique($tab[5])) : null,
|
||||
'visibleCols' => $tab[6] ? '$'. Util::toJSON( array_unique($tab[6])) : null
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = [$file, $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
// tabs: this item contains..
|
||||
$sourceFor = array(
|
||||
[LOOT_ITEM, $this->subject->id, '$LANG.tab_contains', 'contains', ['Listview.extraCols.percent'], [] , []],
|
||||
[LOOT_PROSPECTING, $this->subject->id, '$LANG.tab_prospecting', 'prospecting', ['Listview.extraCols.percent'], ['side', 'slot', 'reqlevel'], []],
|
||||
[LOOT_MILLING, $this->subject->id, '$LANG.tab_milling', 'milling', ['Listview.extraCols.percent'], ['side', 'slot', 'reqlevel'], []],
|
||||
[LOOT_DISENCHANT, $this->subject->getField('disenchantId'), '$LANG.tab_disenchanting', 'disenchanting', ['Listview.extraCols.percent'], ['side', 'slot', 'reqlevel'], []]
|
||||
[LOOT_ITEM, $this->subject->id, '$LANG.tab_contains', 'contains', ['$Listview.extraCols.percent'], [] , []],
|
||||
[LOOT_PROSPECTING, $this->subject->id, '$LANG.tab_prospecting', 'prospecting', ['$Listview.extraCols.percent'], ['side', 'slot', 'reqlevel'], []],
|
||||
[LOOT_MILLING, $this->subject->id, '$LANG.tab_milling', 'milling', ['$Listview.extraCols.percent'], ['side', 'slot', 'reqlevel'], []],
|
||||
[LOOT_DISENCHANT, $this->subject->getField('disenchantId'), '$LANG.tab_disenchanting', 'disenchanting', ['$Listview.extraCols.percent'], ['side', 'slot', 'reqlevel'], []]
|
||||
);
|
||||
|
||||
$reqQuest = [];
|
||||
@@ -508,17 +495,22 @@ class ItemPage extends genericPage
|
||||
$lv['condition'][0][$this->typeId][] = [[CND_QUESTTAKEN, &$reqQuest[$lv['id']]]];
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $lootTab->getResult(),
|
||||
'params' => [
|
||||
'name' => $sf[2],
|
||||
'id' => $sf[3],
|
||||
'extraCols' => $sf[4] ? "$[".implode(', ', array_unique($sf[4]))."]" : null,
|
||||
'hiddenCols' => $sf[5] ? "$".Util::toJSON($sf[5]) : null,
|
||||
'visibleCols' => $sf[6] ? '$'.Util::toJSON($sf[6]) : null
|
||||
]
|
||||
$tabData = array(
|
||||
'data' => array_values($lootTab->getResult()),
|
||||
'name' => $sf[2],
|
||||
'id' => $sf[3],
|
||||
);
|
||||
|
||||
if ($sf[4])
|
||||
$tabData['extraCols'] = array_unique($sf[4]);
|
||||
|
||||
if ($sf[5])
|
||||
$tabData['hiddenCols'] = array_unique($sf[5]);
|
||||
|
||||
if ($sf[6])
|
||||
$tabData['visibleCols'] = array_unique($sf[6]);
|
||||
|
||||
$this->lvTabs[] = ['item', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -558,15 +550,12 @@ class ItemPage extends genericPage
|
||||
if (!$contains->hasSetFields(['slot']))
|
||||
$hCols[] = 'slot';
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $contains->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_cancontain',
|
||||
'id' => 'can-contain',
|
||||
'hiddenCols' => '$'.Util::toJSON($hCols)
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($contains->getListviewData()),
|
||||
'name' => '$LANG.tab_cancontain',
|
||||
'id' => 'can-contain',
|
||||
'hiddenCols' => $hCols
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -578,15 +567,12 @@ class ItemPage extends genericPage
|
||||
{
|
||||
$this->extendGlobalData($contains->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $contains->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_canbeplacedin',
|
||||
'id' => 'can-be-placed-in',
|
||||
'hiddenCols' => "$['side']"
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($contains->getListviewData()),
|
||||
'name' => '$LANG.tab_canbeplacedin',
|
||||
'id' => 'can-be-placed-in',
|
||||
'hiddenCols' => ['side']
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -599,22 +585,19 @@ class ItemPage extends genericPage
|
||||
$criteriaOf = new AchievementList($conditions);
|
||||
if (!$criteriaOf->error)
|
||||
{
|
||||
$this->extendGlobalData($criteriaOf->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_REWARDS));
|
||||
$this->extendGlobalData($criteriaOf->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_REWARDS));
|
||||
|
||||
$hCols = [];
|
||||
if (!$criteriaOf->hasSetFields(['reward_loc0']))
|
||||
$hCols = ['rewards'];
|
||||
$tabData = array(
|
||||
'data' => array_values($criteriaOf->getListviewData()),
|
||||
'name' => '$LANG.tab_criteriaof',
|
||||
'id' => 'criteria-of',
|
||||
'visibleCols' => ['category']
|
||||
);
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $criteriaOf->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_criteriaof',
|
||||
'id' => 'criteria-of',
|
||||
'visibleCols' => "$['category']",
|
||||
'hiddenCols' => '$'.Util::toJSON($hCols)
|
||||
]
|
||||
);
|
||||
if (!$criteriaOf->hasSetFields(['reward_loc0']))
|
||||
$tabData['hiddenCols'] = ['rewards'];
|
||||
|
||||
$this->lvTabs[] = ['achievement', $tabData];
|
||||
}
|
||||
|
||||
// tab: reagent for
|
||||
@@ -629,15 +612,12 @@ class ItemPage extends genericPage
|
||||
{
|
||||
$this->extendGlobalData($reagent->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $reagent->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_reagentfor',
|
||||
'id' => 'reagent-for',
|
||||
'visibleCols' => "$['reagents']"
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($reagent->getListviewData()),
|
||||
'name' => '$LANG.tab_reagentfor',
|
||||
'id' => 'reagent-for',
|
||||
'visibleCols' => ['reagents']
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: unlocks (object or item)
|
||||
@@ -654,14 +634,11 @@ class ItemPage extends genericPage
|
||||
$lockedObj = new GameObjectList(array(['lockId', $lockIds]));
|
||||
if (!$lockedObj->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'object',
|
||||
'data' => $lockedObj->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_unlocks',
|
||||
'id' => 'unlocks-object'
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['object', array(
|
||||
'data' => array_values($lockedObj->getListviewData()),
|
||||
'name' => '$LANG.tab_unlocks',
|
||||
'id' => 'unlocks-object'
|
||||
)];
|
||||
}
|
||||
|
||||
// items (generally unused. It's the spell on the item, that unlocks stuff)
|
||||
@@ -670,14 +647,11 @@ class ItemPage extends genericPage
|
||||
{
|
||||
$this->extendGlobalData($lockedItm->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $lockedItm->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_unlocks',
|
||||
'id' => 'unlocks-item'
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($lockedItm->getListviewData()),
|
||||
'name' => '$LANG.tab_unlocks',
|
||||
'id' => 'unlocks-item'
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,14 +679,11 @@ class ItemPage extends genericPage
|
||||
{
|
||||
$this->extendGlobalData($saItems->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $saItems->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'id' => 'see-also'
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($saItems->getListviewData()),
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'id' => 'see-also'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: starts (quest)
|
||||
@@ -723,14 +694,11 @@ class ItemPage extends genericPage
|
||||
{
|
||||
$this->extendGlobalData($starts->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_REWARDS));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $starts->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_starts',
|
||||
'id' => 'starts-quest'
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($starts->getListviewData()),
|
||||
'name' => '$LANG.tab_starts',
|
||||
'id' => 'starts-quest'
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -745,14 +713,11 @@ class ItemPage extends genericPage
|
||||
{
|
||||
$this->extendGlobalData($objective->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_REWARDS));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $objective->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_objectiveof',
|
||||
'id' => 'objective-of-quest'
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($objective->getListviewData()),
|
||||
'name' => '$LANG.tab_objectiveof',
|
||||
'id' => 'objective-of-quest'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: provided for (quest)
|
||||
@@ -766,14 +731,11 @@ class ItemPage extends genericPage
|
||||
{
|
||||
$this->extendGlobalData($provided->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_REWARDS));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $provided->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_providedfor',
|
||||
'id' => 'provided-for-quest'
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($provided->getListviewData()),
|
||||
'name' => '$LANG.tab_providedfor',
|
||||
'id' => 'provided-for-quest'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: same model as
|
||||
@@ -785,15 +747,12 @@ class ItemPage extends genericPage
|
||||
{
|
||||
$this->extendGlobalData($sameModel->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'genericmodel',
|
||||
'data' => $sameModel->getListviewData(ITEMINFO_MODEL),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_samemodelas',
|
||||
'id' => 'same-model-as',
|
||||
'genericlinktype' => 'item'
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['genericmodel', array(
|
||||
'data' => array_values($sameModel->getListviewData(ITEMINFO_MODEL)),
|
||||
'name' => '$LANG.tab_samemodelas',
|
||||
'id' => 'same-model-as',
|
||||
'genericlinktype' => 'item'
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -807,7 +766,7 @@ class ItemPage extends genericPage
|
||||
$sbData = $soldBy->getListviewData();
|
||||
$this->extendGlobalData($soldBy->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$extraCols = ['Listview.extraCols.stock', "Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", 'Listview.extraCols.cost'];
|
||||
$extraCols = ['$Listview.extraCols.stock', "\$Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", '$Listview.extraCols.cost'];
|
||||
|
||||
$holidays = [];
|
||||
foreach ($sbData as $k => &$row)
|
||||
@@ -837,7 +796,7 @@ class ItemPage extends genericPage
|
||||
if ($e = $vendors[$k]['event'])
|
||||
{
|
||||
if (count($extraCols) == 3)
|
||||
$extraCols[] = 'Listview.extraCols.condition';
|
||||
$extraCols[] = '$Listview.extraCols.condition';
|
||||
|
||||
$this->extendGlobalIds(TYPE_WORLDEVENT, $e);
|
||||
$row['condition'][0][$this->typeId][] = [[CND_ACTIVE_EVENT, $e]];
|
||||
@@ -860,16 +819,13 @@ class ItemPage extends genericPage
|
||||
}
|
||||
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'creature',
|
||||
'data' => $sbData,
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_soldby',
|
||||
'id' => 'sold-by-npc',
|
||||
'extraCols' => '$['.implode(', ', $extraCols).']',
|
||||
'hiddenCols' => "$['level', 'type']"
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['creature', array(
|
||||
'data' => array_values($sbData),
|
||||
'name' => '$LANG.tab_soldby',
|
||||
'id' => 'sold-by-npc',
|
||||
'extraCols' => $extraCols,
|
||||
'hiddenCols' => ['level', 'type']
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -898,22 +854,21 @@ class ItemPage extends genericPage
|
||||
$boughtBy = new ItemList(array(['id', $boughtBy]));
|
||||
if (!$boughtBy->error)
|
||||
{
|
||||
if ($boughtBy->getMatches() <= CFG_SQL_LIMIT_DEFAULT)
|
||||
$n = null;
|
||||
|
||||
$iCur = new CurrencyList(array(['itemId', $this->typeId]));
|
||||
$filter = $iCur->error ? [TYPE_ITEM => $this->typeId] : [TYPE_CURRENCY => $iCur->id];
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $boughtBy->getListviewData(ITEMINFO_VENDOR, $filter),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_currencyfor',
|
||||
'id' => 'currency-for',
|
||||
'extraCols' => "$[Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack'), Listview.extraCols.cost]",
|
||||
'note' => $n ? sprintf(Util::$filterResultString, $n) : null
|
||||
]
|
||||
$tabData = array(
|
||||
'data' => array_values($boughtBy->getListviewData(ITEMINFO_VENDOR, $filter)),
|
||||
'name' => '$LANG.tab_currencyfor',
|
||||
'id' => 'currency-for',
|
||||
'extraCols' => ["\$Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", '$Listview.extraCols.cost'],
|
||||
);
|
||||
|
||||
if ($boughtBy->getMatches() > CFG_SQL_LIMIT_DEFAULT && $n)
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, $n);
|
||||
|
||||
$this->lvTabs[] = ['item', $tabData];
|
||||
|
||||
$this->extendGlobalData($boughtBy->getJSGlobals(GLOBALINFO_ANY));
|
||||
}
|
||||
}
|
||||
@@ -951,15 +906,12 @@ class ItemPage extends genericPage
|
||||
if ($taughtSpells->hasSetFields(['reagent1']))
|
||||
$visCols[] = 'reagents';
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $taughtSpells->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_teaches',
|
||||
'id' => 'teaches',
|
||||
'visibleCols' => '$'.Util::toJSON($visCols)
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($taughtSpells->getListviewData()),
|
||||
'name' => '$LANG.tab_teaches',
|
||||
'id' => 'teaches',
|
||||
'visibleCols' => $visCols
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -982,14 +934,11 @@ class ItemPage extends genericPage
|
||||
$cdItems = new ItemList($conditions);
|
||||
if (!$cdItems->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $cdItems->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_sharedcooldown',
|
||||
'id' => 'shared-cooldown'
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($cdItems->getListviewData()),
|
||||
'name' => '$LANG.tab_sharedcooldown',
|
||||
'id' => 'shared-cooldown'
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($cdItems->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
|
||||
@@ -306,10 +306,9 @@ class ItemsPage extends GenericPage
|
||||
continue;
|
||||
|
||||
$this->extendGlobalData($items->getJSGlobals());
|
||||
$tab = array(
|
||||
'file' => 'item',
|
||||
'data' => $items->getListviewData($infoMask),
|
||||
'params' => $this->sharedLV
|
||||
$tabData = array_merge(
|
||||
['data' => $items->getListviewData($infoMask)],
|
||||
$this->sharedLV
|
||||
);
|
||||
|
||||
$upg = [];
|
||||
@@ -322,17 +321,17 @@ class ItemsPage extends GenericPage
|
||||
}));
|
||||
|
||||
foreach ($upg as $uId)
|
||||
$tab['data'][$uId] = $upgItemData[$uId];
|
||||
$tabData['data'][$uId] = $upgItemData[$uId];
|
||||
|
||||
if ($upg)
|
||||
$tab['params']['_upgradeIds'] = '$'.Util::toJSON($upg);
|
||||
$tabData['_upgradeIds'] = $upg;
|
||||
}
|
||||
else if ($grouping)
|
||||
{
|
||||
$upg = array_keys($this->filter['upg']);
|
||||
$tab['params']['_upgradeIds'] = '$'.Util::toJSON($upg);
|
||||
$tabData['_upgradeIds'] = $upg;
|
||||
foreach ($upgItemData as $uId => $data) // using numeric keys => cant use array_merge
|
||||
$tab['data'][$uId] = $data;
|
||||
$tabData['data'][$uId] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,28 +340,28 @@ class ItemsPage extends GenericPage
|
||||
switch ($grouping)
|
||||
{
|
||||
case 1:
|
||||
$tab['params']['id'] = 'slot-'.$group;
|
||||
$tabData['id'] = 'slot-'.$group;
|
||||
break;
|
||||
case 2:
|
||||
$tab['params']['id'] = $group > 0 ? 'level-'.$group : 'other';
|
||||
$tabData['id'] = $group > 0 ? 'level-'.$group : 'other';
|
||||
break;
|
||||
case 3:
|
||||
$tab['params']['id'] = $group ? 'source-'.$group : 'unknown';
|
||||
$tabData['id'] = $group ? 'source-'.$group : 'unknown';
|
||||
break;
|
||||
}
|
||||
|
||||
$tab['params']['name'] = $nameSource[$group];
|
||||
$tab['params']['tabs'] = '$tabsGroups';
|
||||
$tabData['name'] = $nameSource[$group];
|
||||
$tabData['tabs'] = '$tabsGroups';
|
||||
}
|
||||
|
||||
if (!empty($this->filter['fi']['setWeights']))
|
||||
if ($items->hasSetFields(['armor']))
|
||||
$tab['params']['visibleCols'][] = 'armor';
|
||||
$tabData['visibleCols'][] = 'armor';
|
||||
|
||||
// create note if search limit was exceeded; overwriting 'note' is intentional
|
||||
if ($items->getMatches() > $maxResults && count($groups) > 1)
|
||||
{
|
||||
$tab['params']['_truncated'] = 1;
|
||||
$tabData['_truncated'] = 1;
|
||||
|
||||
$cls = isset($this->category[0]) ? '='.$this->category[0] : '';
|
||||
$override = ['gb' => ''];
|
||||
@@ -373,7 +372,7 @@ class ItemsPage extends GenericPage
|
||||
{
|
||||
case 1:
|
||||
$override['sl'] = $group;
|
||||
$tab['params']['note'] = '$$WH.sprintf(LANG.lvnote_viewmoreslot, \''.$cls.'\', \''.$this->filterObj->urlize($override).'\')';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_viewmoreslot, \''.$cls.'\', \''.$this->filterObj->urlize($override).'\')';
|
||||
break;
|
||||
case 2:
|
||||
if ($group > 0)
|
||||
@@ -384,35 +383,31 @@ class ItemsPage extends GenericPage
|
||||
else
|
||||
$override['maxle'] = abs($group) - 1;
|
||||
|
||||
$tab['params']['note'] = '$$WH.sprintf(LANG.lvnote_viewmorelevel, \''.$cls.'\', \''.$this->filterObj->urlize($override).'\')';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_viewmorelevel, \''.$cls.'\', \''.$this->filterObj->urlize($override).'\')';
|
||||
break;
|
||||
case 3:
|
||||
if ($_ = [null, 3, 4, 5, 6, 7, 9, 10, 11][$group])
|
||||
$tab['params']['note'] = '$$WH.sprintf(LANG.lvnote_viewmoresource, \''.$cls.'\', \''.$this->filterObj->urlize($override, ['cr' => 128, 'crs' => $_, 'crv' => 0]).'\')';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_viewmoresource, \''.$cls.'\', \''.$this->filterObj->urlize($override, ['cr' => 128, 'crs' => $_, 'crv' => 0]).'\')';
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ($items->getMatches() > $maxResults)
|
||||
{
|
||||
$tab['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tab['params']['_truncated'] = 1;
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
if (!empty($tab['params']['hiddenCols']))
|
||||
$tab['params']['hiddenCols'] = '$'.Util::toJSON($tab['params']['hiddenCols']);
|
||||
|
||||
if (!empty($tab['params']['visibleCols']))
|
||||
$tab['params']['visibleCols'] = '$'.Util::toJSON($tab['params']['visibleCols']);
|
||||
|
||||
foreach ($tab['params'] as $k => $p)
|
||||
if (!$p)
|
||||
unset($tab['params'][$k]);
|
||||
foreach ($tabData as $k => $p)
|
||||
if (!$p && $k != 'data')
|
||||
unset($tabData[$k]);
|
||||
|
||||
if ($grouping)
|
||||
$tab['params']['hideCount'] = '$1';
|
||||
$tabData['hideCount'] = 1;
|
||||
|
||||
$this->lvTabs[] = $tab;
|
||||
$tabData['data'] = array_values($tabData['data']);
|
||||
|
||||
$this->lvTabs[] = ['item', $tabData];
|
||||
}
|
||||
|
||||
// reformat for use in template
|
||||
@@ -423,7 +418,7 @@ class ItemsPage extends GenericPage
|
||||
if (empty($this->lvTabs))
|
||||
{
|
||||
$this->forceTabs = false;
|
||||
$this->lvTabs[] = ['file' => 'item', 'data' => [], 'params' => []];
|
||||
$this->lvTabs[] = ['item', ['data' => []]];
|
||||
}
|
||||
|
||||
// sort for dropdown-menus
|
||||
@@ -502,7 +497,7 @@ class ItemsPage extends GenericPage
|
||||
|
||||
$this->sharedLV['onBeforeCreate'] = '$fi_initWeightedListview';
|
||||
$this->sharedLV['onAfterCreate'] = '$fi_addUpgradeIndicator';
|
||||
$this->sharedLV['sort'] = "$['-score', 'name']";
|
||||
$this->sharedLV['sort'] = ['-score', 'name'];
|
||||
|
||||
array_push($this->sharedLV['hiddenCols'], 'type', 'source');
|
||||
|
||||
|
||||
@@ -139,12 +139,11 @@ class ItemsetPage extends GenericPage
|
||||
|
||||
$compare[] = $itemId;
|
||||
|
||||
$pieces[] = array(
|
||||
'id' => $itemId,
|
||||
'name' => $iList->getField('name', true),
|
||||
'quality' => $iList->getField('quality'),
|
||||
'icon' => $iList->getField('iconString'),
|
||||
'json' => $data[$itemId]
|
||||
$pieces[$itemId] = array(
|
||||
'name_'.User::$localeString => $iList->getField('name', true),
|
||||
'quality' => $iList->getField('quality'),
|
||||
'icon' => $iList->getField('iconString'),
|
||||
'jsonequip' => $data[$itemId]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -168,11 +167,12 @@ class ItemsetPage extends GenericPage
|
||||
BUTTON_VIEW3D => ['type' => TYPE_ITEMSET, 'typeId' => $this->typeId, 'equipList' => $eqList],
|
||||
BUTTON_COMPARE => ['eqList' => implode(':', $compare), 'qty' => $_cnt]
|
||||
);
|
||||
$this->compare = array(
|
||||
'level' => $this->subject->getField('reqLevel'),
|
||||
'items' => array_map(function ($v) {
|
||||
return [[$v]];
|
||||
}, $compare)
|
||||
$this->summary = array(
|
||||
'id' => 'itemset',
|
||||
'template' => 'itemset',
|
||||
'parent' => 'summary-generic',
|
||||
'groups' => array_map(function ($v) { return [[$v]]; }, $compare),
|
||||
'level' => $this->subject->getField('reqLevel'),
|
||||
);
|
||||
|
||||
/**************/
|
||||
@@ -213,19 +213,16 @@ class ItemsetPage extends GenericPage
|
||||
$relSets = new ItemsetList($rel);
|
||||
if (!$relSets->error)
|
||||
{
|
||||
$lv = array(
|
||||
'file' => 'itemset',
|
||||
'data' => $relSets->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'see-also',
|
||||
'name' => '$LANG.tab_seealso'
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($relSets->getListviewData()),
|
||||
'id' => 'see-also',
|
||||
'name' => '$LANG.tab_seealso'
|
||||
);
|
||||
|
||||
if (!$relSets->hasDiffFields(['classMask']))
|
||||
$lv['params']['hiddenCols'] = "$['classes']";
|
||||
$tabData['hiddenCols'] = ['classes'];
|
||||
|
||||
$this->lvTabs[] = $lv;
|
||||
$this->lvTabs[] = ['itemset', $tabData];
|
||||
|
||||
$this->extendGlobalData($relSets->getJSGlobals());
|
||||
}
|
||||
|
||||
@@ -47,26 +47,22 @@ class ItemsetsPage extends GenericPage
|
||||
|
||||
$this->addJS('?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
||||
|
||||
$lv = array(
|
||||
'file' => 'itemset',
|
||||
'data' => $itemsets->getListviewData(), // listview content
|
||||
'params' => []
|
||||
);
|
||||
$tabData = ['data' => array_values($itemsets->getListviewData())];
|
||||
|
||||
if (!empty($this->filter['fi']['extraCols']))
|
||||
$lv['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($itemsets->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
{
|
||||
$lv['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$lv['params']['_truncated'] = 1;
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
if ($this->filterObj->error)
|
||||
$lv['params']['_errors'] = '$1';
|
||||
$tabData['_errors'] = 1;
|
||||
|
||||
$this->lvTabs[] = $lv;
|
||||
$this->lvTabs[] = ['itemset', $tabData];
|
||||
|
||||
// sort for dropdown-menus
|
||||
Lang::sort('itemset', 'notes', SORT_NATURAL);
|
||||
|
||||
186
pages/npc.php
186
pages/npc.php
@@ -403,24 +403,18 @@ class NpcPage extends GenericPage
|
||||
}
|
||||
|
||||
if ($normal)
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $normal,
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_abilities',
|
||||
'id' => 'abilities'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($normal),
|
||||
'name' => '$LANG.tab_abilities',
|
||||
'id' => 'abilities'
|
||||
)];
|
||||
|
||||
if ($controled)
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $controled,
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_controlledabilities',
|
||||
'id' => 'controlled-abilities'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($controled),
|
||||
'name' => '$LANG.tab_controlledabilities',
|
||||
'id' => 'controlled-abilities'
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,14 +431,11 @@ class NpcPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($summoned->getJSGlobals());
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $summoned->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_summonedby',
|
||||
'id' => 'summoned-by'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($summoned->getListviewData()),
|
||||
'name' => '$LANG.tab_summonedby',
|
||||
'id' => 'summoned-by'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: teaches
|
||||
@@ -496,16 +487,17 @@ class NpcPage extends GenericPage
|
||||
$data[$sId]['trainingcost'] = $_;
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $data,
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_teaches',
|
||||
'id' => 'teaches',
|
||||
'visibleCols' => "$['trainingcost']",
|
||||
'extraCols' => $extra ? '$['.implode(', ', $extra).']' : null
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($data),
|
||||
'name' => '$LANG.tab_teaches',
|
||||
'id' => 'teaches',
|
||||
'visibleCols' => ['trainingcost']
|
||||
);
|
||||
|
||||
if ($extra)
|
||||
$tabData['extraCols'] = $extra;
|
||||
|
||||
$this->lvTabs[] = ['spell', $tabData];
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -518,9 +510,9 @@ class NpcPage extends GenericPage
|
||||
$soldItems = new ItemList(array(['id', $sells]));
|
||||
if (!$soldItems->error)
|
||||
{
|
||||
$extraCols = ["Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", 'Listview.extraCols.cost'];
|
||||
$extraCols = ["\$Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", '$Listview.extraCols.cost'];
|
||||
if ($soldItems->hasSetFields(['condition']))
|
||||
$extraCols[] = 'Listview.extraCols.condition';
|
||||
$extraCols[] = '$Listview.extraCols.condition';
|
||||
|
||||
$lvData = $soldItems->getListviewData(ITEMINFO_VENDOR, [TYPE_NPC => [$this->typeId]]);
|
||||
|
||||
@@ -529,8 +521,7 @@ class NpcPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($sc[1]);
|
||||
|
||||
if (!array_search('Listview.extraCols.condition', $extraCols))
|
||||
$extraCols[] = 'Listview.extraCols.condition';
|
||||
$extraCols[] = 'Listview.extraCols.condition';
|
||||
|
||||
foreach ($lvData as $id => &$row)
|
||||
foreach ($sc[0] as $srcType => $cndData)
|
||||
@@ -538,15 +529,12 @@ class NpcPage extends GenericPage
|
||||
$row['condition'][0][$id.':'.$this->typeId] = $cndData[$id.':'.$this->typeId];
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $lvData,
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_sells',
|
||||
'id' => 'currency-for',
|
||||
'extraCols' => '$['.implode(', ', $extraCols).']'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($lvData),
|
||||
'name' => '$LANG.tab_sells',
|
||||
'id' => 'currency-for',
|
||||
'extraCols' => array_unique($extraCols)
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($soldItems->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
}
|
||||
@@ -610,7 +598,7 @@ class NpcPage extends GenericPage
|
||||
if ($creatureLoot->getByContainer($sf[0], $sf[1]))
|
||||
{
|
||||
$extraCols = $creatureLoot->extraCols;
|
||||
$extraCols[] = 'Listview.extraCols.percent';
|
||||
$extraCols[] = '$Listview.extraCols.percent';
|
||||
|
||||
$this->extendGlobalData($creatureLoot->jsGlobals);
|
||||
|
||||
@@ -619,27 +607,26 @@ class NpcPage extends GenericPage
|
||||
if (!$lv['quest'])
|
||||
continue;
|
||||
|
||||
$extraCols[] = 'Listview.extraCols.condition';
|
||||
$extraCols[] = '$Listview.extraCols.condition';
|
||||
$reqQuest[$lv['id']] = 0;
|
||||
$lv['condition'][0][$this->typeId][] = [[CND_QUESTTAKEN, &$reqQuest[$lv['id']]]];
|
||||
}
|
||||
|
||||
$lootTab = array(
|
||||
'file' => 'item',
|
||||
'data' => $creatureLoot->getResult(),
|
||||
'params' => array(
|
||||
'name' => $sf[2],
|
||||
'id' => $sf[3],
|
||||
'extraCols' => "$[".implode(', ', array_unique($extraCols))."]",
|
||||
'hiddenCols' => $sf[4] ? "$".Util::toJSON($sf[4]) : null,
|
||||
'sort' => "$['-percent', 'name']",
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($creatureLoot->getResult()),
|
||||
'name' => $sf[2],
|
||||
'id' => $sf[3],
|
||||
'extraCols' => array_unique($extraCols),
|
||||
'sort' => ['-percent', 'name'],
|
||||
);
|
||||
|
||||
if (!empty($sf['note']))
|
||||
$lootTab['params']['note'] = $sf['note'];
|
||||
$lootTab['note'] = $sf['note'];
|
||||
|
||||
$this->lvTabs[] = $lootTab;
|
||||
if ($sf[4])
|
||||
$lootTab['hiddenCols'] = $sf[4];
|
||||
|
||||
$this->lvTabs[] = ['item', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,28 +673,18 @@ class NpcPage extends GenericPage
|
||||
}
|
||||
|
||||
if ($_[0])
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $_[0],
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_starts',
|
||||
'id' => 'starts'
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($_[0]),
|
||||
'name' => '$LANG.tab_starts',
|
||||
'id' => 'starts'
|
||||
)];
|
||||
|
||||
if ($_[1])
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $_[1],
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_ends',
|
||||
'id' => 'ends'
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($_[1]),
|
||||
'name' => '$LANG.tab_ends',
|
||||
'id' => 'ends'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: objective of quest
|
||||
@@ -724,14 +701,11 @@ class NpcPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($objectiveOf->getJSGlobals());
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $objectiveOf->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_objectiveof',
|
||||
'id' => 'objective-of'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => aray_values($objectiveOf->getListviewData()),
|
||||
'name' => '$LANG.tab_objectiveof',
|
||||
'id' => 'objective-of'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: criteria of [ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE have no data set to check for]
|
||||
@@ -745,14 +719,11 @@ class NpcPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($crtOf->getJSGlobals());
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $crtOf->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_criteriaof',
|
||||
'id' => 'criteria-of'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['achievement', array(
|
||||
'data' => array_values($crtOf->getListviewData()),
|
||||
'name' => '$LANG.tab_criteriaof',
|
||||
'id' => 'criteria-of'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: passengers
|
||||
@@ -763,25 +734,22 @@ class NpcPage extends GenericPage
|
||||
{
|
||||
$data = $passengers->getListviewData();
|
||||
|
||||
$xCols = null;
|
||||
if (User::isInGroup(U_GROUP_STAFF))
|
||||
{
|
||||
foreach ($data as $id => &$d)
|
||||
$d['seat'] = str_replace(',', ', ', $_[$id]);
|
||||
|
||||
$xCols = "$[Listview.funcBox.createSimpleCol('seat', '".Lang::npc('seat')."', '10%', 'seat')]";
|
||||
}
|
||||
|
||||
$this->extendGlobalData($passengers->getJSGlobals(GLOBALINFO_SELF));
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'creature',
|
||||
'data' => $data,
|
||||
'params' => array(
|
||||
'extraCols' => $xCols,
|
||||
'name' => Lang::npc('accessory'),
|
||||
'id' => 'accessory'
|
||||
)
|
||||
|
||||
$tabData = array(
|
||||
'data' => array_values($data),
|
||||
'name' => Lang::npc('accessory'),
|
||||
'id' => 'accessory'
|
||||
);
|
||||
|
||||
if (User::isInGroup(U_GROUP_STAFF))
|
||||
$tabData['extraCols'] = ["\$Listview.funcBox.createSimpleCol('seat', '".Lang::npc('seat')."', '10%', 'seat')"];
|
||||
|
||||
$this->lvTabs[] = ['creature', $tabData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,31 +59,29 @@ class NpcsPage extends GenericPage
|
||||
|
||||
$repCols = $this->filterObj->getForm('reputationCols');
|
||||
|
||||
$lv = array(
|
||||
'file' => 'creature',
|
||||
'data' => $npcs->getListviewData($repCols ? NPCINFO_REP : 0x0),
|
||||
'params' => []
|
||||
$tabData = array(
|
||||
'data' => array_values($npcs->getListviewData($repCols ? NPCINFO_REP : 0x0)),
|
||||
);
|
||||
|
||||
if ($repCols)
|
||||
$lv['params']['extraCols'] = '$fi_getReputationCols('.Util::toJSON($repCols).')';
|
||||
$tabData['extraCols'] = '$fi_getReputationCols('.Util::toJSON($repCols).')';
|
||||
else if (!empty($this->filter['fi']['extraCols']))
|
||||
$lv['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
if ($this->category)
|
||||
$lv['params']['hiddenCols'] = "$['type']";
|
||||
$tabData['hiddenCols'] = ['type'];
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($npcs->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
{
|
||||
$lv['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_npcsfound', $npcs->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$lv['params']['_truncated'] = 1;
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_npcsfound', $npcs->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
if ($this->filterObj->error)
|
||||
$lv['params']['_errors'] = '$1';
|
||||
$tabData['_errors'] = 1;
|
||||
|
||||
$this->lvTabs[] = $lv;
|
||||
$this->lvTabs[] = ['creature', $tabData];
|
||||
|
||||
// sort for dropdown-menus
|
||||
Lang::sort('game', 'fa');
|
||||
|
||||
119
pages/object.php
119
pages/object.php
@@ -271,14 +271,11 @@ class ObjectPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($summons->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $summons->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'summoned-by',
|
||||
'name' => '$LANG.tab_summonedby'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($summons->getListviewData()),
|
||||
'id' => 'summoned-by',
|
||||
'name' => '$LANG.tab_summonedby'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: related spells
|
||||
@@ -293,16 +290,13 @@ class ObjectPage extends GenericPage
|
||||
foreach ($data as $relId => $d)
|
||||
$data[$relId]['trigger'] = array_search($relId, $_);
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $data,
|
||||
'params' => array(
|
||||
'id' => 'spells',
|
||||
'name' => '$LANG.tab_spells',
|
||||
'hiddenCols' => "$['skill']",
|
||||
'extraCols' => "$[Listview.funcBox.createSimpleCol('trigger', 'Condition', '10%', 'trigger')]"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($data),
|
||||
'id' => 'spells',
|
||||
'name' => '$LANG.tab_spells',
|
||||
'hiddenCols' => ['skill'],
|
||||
'extraCols' => ["\$Listview.funcBox.createSimpleCol('trigger', 'Condition', '10%', 'trigger')"]
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,14 +306,11 @@ class ObjectPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($acvs->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $acvs->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'criteria-of',
|
||||
'name' => '$LANG.tab_criteriaof'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['achievement', array(
|
||||
'data' => array_values($acvs->getListviewData()),
|
||||
'id' => 'criteria-of',
|
||||
'name' => '$LANG.tab_criteriaof'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: starts quest
|
||||
@@ -341,28 +332,18 @@ class ObjectPage extends GenericPage
|
||||
}
|
||||
|
||||
if ($_[0])
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $_[0],
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_starts',
|
||||
'id' => 'starts'
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($_[0]),
|
||||
'name' => '$LANG.tab_starts',
|
||||
'id' => 'starts'
|
||||
)];
|
||||
|
||||
if ($_[1])
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $_[1],
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_ends',
|
||||
'id' => 'ends'
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($_[1]),
|
||||
'name' => '$LANG.tab_ends',
|
||||
'id' => 'ends'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: related quests
|
||||
@@ -373,14 +354,11 @@ class ObjectPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($relQuest->getJSGlobals());
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $relQuest->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_quests',
|
||||
'id' => 'quests'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($relQuest->getListviewData()),
|
||||
'name' => '$LANG.tab_quests',
|
||||
'id' => 'quests'
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,17 +390,17 @@ class ObjectPage extends GenericPage
|
||||
$lv['condition'][0][$this->typeId][] = [[CND_QUESTTAKEN, &$reqQuest[$lv['id']]]];
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $goLoot->getResult(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_contains',
|
||||
'id' => 'contains',
|
||||
'extraCols' => "$[".implode(', ', array_unique($extraCols))."]",
|
||||
'hiddenCols' => $hiddenCols ? '$'.Util::toJSON(array_values($hiddenCols)) : null,
|
||||
'sort' => "$['-percent', 'name']"
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($goLoot->getResult()),
|
||||
'id' => 'contains',
|
||||
'name' => '$LANG.tab_contains',
|
||||
'sort' => ['-percent', 'name']
|
||||
);
|
||||
|
||||
if ($hiddenCols)
|
||||
$tabData['hiddenCols'] = $hiddenCols;
|
||||
|
||||
$this->lvTabs[] = ['item', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,14 +434,11 @@ class ObjectPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($sameModel->getJSGlobals());
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'object',
|
||||
'data' => $sameModel->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_samemodelas',
|
||||
'id' => 'same-model-as'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['object', array(
|
||||
'data' => array_values($sameModel->getListviewData()),
|
||||
'name' => '$LANG.tab_samemodelas',
|
||||
'id' => 'same-model-as'
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,31 +47,26 @@ class ObjectsPage extends GenericPage
|
||||
if ($_ = $this->filterObj->getConditions())
|
||||
$conditions[] = $_;
|
||||
|
||||
$params = $data = [];
|
||||
$tabData = ['data' => []];
|
||||
$objects = new GameObjectList($conditions, ['extraOpts' => $this->filterObj->extraOpts]);
|
||||
if (!$objects->error)
|
||||
{
|
||||
$data = $objects->getListviewData();
|
||||
$tabData['data'] = array_values($objects->getListviewData());
|
||||
if ($objects->hasSetFields(['reqSkill']))
|
||||
$params['visibleCols'] = "$['skill']";
|
||||
|
||||
$tabData['visibleCols'] = ['skill'];
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($objects->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
{
|
||||
$params['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_objectsfound', $objects->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$params['_truncated'] = 1;
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_objectsfound', $objects->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
if ($this->filterObj->error)
|
||||
$params['_errors'] = '$1';
|
||||
$tabData['_errors'] = 1;
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'object',
|
||||
'data' => $data,
|
||||
'params' => $params
|
||||
);
|
||||
$this->lvTabs[] = ['object', $tabData];
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
|
||||
@@ -88,23 +88,17 @@ class PetPage extends GenericPage
|
||||
);
|
||||
$tng = new CreatureList($condition);
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'creature',
|
||||
'data' => $tng->getListviewData(NPCINFO_TAMEABLE),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_tameable',
|
||||
'hiddenCols' => "$['type']",
|
||||
'visibleCols' => "$['skin']",
|
||||
'note' => sprintf(Util::$filterResultString, '?npcs=1&filter=fa=38'),
|
||||
'id' => 'tameable'
|
||||
)
|
||||
);
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'model',
|
||||
'data' => $tng->getListviewData(NPCINFO_MODEL),
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['creature', array(
|
||||
'data' => array_values($tng->getListviewData(NPCINFO_TAMEABLE)),
|
||||
'name' => '$LANG.tab_tameable',
|
||||
'hiddenCols' => ['type'],
|
||||
'visibleCols' => ['skin'],
|
||||
'note' => sprintf(Util::$filterResultString, '?npcs=1&filter=fa=38'),
|
||||
'id' => 'tameable'
|
||||
)];
|
||||
$this->lvTabs[] = ['model', array(
|
||||
'data' => array_values($tng->getListviewData(NPCINFO_MODEL))
|
||||
)];
|
||||
|
||||
// tab: diet
|
||||
$list = [];
|
||||
@@ -116,16 +110,13 @@ class PetPage extends GenericPage
|
||||
$food = new ItemList(array(['i.subClass', [5, 8]], ['i.FoodType', $list], CFG_SQL_LIMIT_NONE));
|
||||
$this->extendGlobalData($food->getJSGlobals());
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $food->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.diet',
|
||||
'hiddenCols' => "$['source', 'slot', 'side']",
|
||||
'sort' => "$['level']",
|
||||
'id' => 'diet'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($food->getListviewData()),
|
||||
'name' => '$LANG.diet',
|
||||
'hiddenCols' => ['source', 'slot', 'side'],
|
||||
'sort' => ['level'],
|
||||
'id' => 'diet'
|
||||
)];
|
||||
|
||||
// tab: spells
|
||||
$mask = 0x0;
|
||||
@@ -153,15 +144,12 @@ class PetPage extends GenericPage
|
||||
$spells = new SpellList($conditions);
|
||||
$this->extendGlobalData($spells->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $spells->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_abilities',
|
||||
'visibleCols' => "$['schools', 'level']",
|
||||
'id' => 'abilities'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($spells->getListviewData()),
|
||||
'name' => '$LANG.tab_abilities',
|
||||
'visibleCols' => ['schools', 'level'],
|
||||
'id' => 'abilities'
|
||||
)];
|
||||
|
||||
// tab: talents
|
||||
$conditions = array(
|
||||
@@ -183,17 +171,14 @@ class PetPage extends GenericPage
|
||||
$talents = new SpellList($conditions);
|
||||
$this->extendGlobalData($talents->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $talents->getListviewData(),
|
||||
'params' => array(
|
||||
'visibleCols' => "$['tier', 'level']",
|
||||
'name' => '$LANG.tab_talents',
|
||||
'id' => 'talents',
|
||||
'sort' => "$['tier', 'name']",
|
||||
'_petTalents' => 1
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($talents->getListviewData()),
|
||||
'visibleCols' => ['tier', 'level'],
|
||||
'name' => '$LANG.tab_talents',
|
||||
'id' => 'talents',
|
||||
'sort' => ['tier', 'name'],
|
||||
'_petTalents' => 1
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,15 +41,16 @@ class PetsPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($pets->getJSGlobals(GLOBALINFO_RELATED));
|
||||
|
||||
$params = ['visibleCols' => "$['abilities']"];
|
||||
if (!$pets->hasDiffFields(['type']))
|
||||
$params['hiddenCols'] = "$['type']";
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'pet',
|
||||
'data' => $pets->getListviewData(),
|
||||
'params' => $params
|
||||
$data = array(
|
||||
'data' => array_values($pets->getListviewData()),
|
||||
'visibleCols' => ['abilities'],
|
||||
'computeDataFunc' => '$_'
|
||||
);
|
||||
|
||||
if (!$pets->hasDiffFields(['type']))
|
||||
$data['hiddenCols'] = ['type'];
|
||||
|
||||
$this->lvTabs[] = ['pet', $data, 'petFoodCol'];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -93,20 +93,17 @@ class ProfilesPage extends GenericPage
|
||||
// dont send ID for real chars unless they have some kind of custom avatar
|
||||
// on second thought .. ids are required for resync, but the function that generates the icon is faulty
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'profile',
|
||||
'data' => [$exampleRow],
|
||||
'params' => [
|
||||
'id' => 'characters',
|
||||
'name' => '$LANG.tab_characters',
|
||||
'hideCount' => 1,
|
||||
'_truncated' => 1,
|
||||
'roster' => 3,
|
||||
'visibleCols' => "$['race','classs','level','talents','achievementpoints']",
|
||||
'note' => '$$WH.sprintf(LANG.lvnote_charactersfound, \'20,592,390\', 200) + LANG.dash + LANG.lvnote_tryfiltering.replace(\'<a>\', \'<a href="javascript:;" onclick="fi_toggle()">\')',
|
||||
'onBeforeCreate' => '$pr_initRosterListview' // $_GET['roster'] = 1|2|3|4 .. 2,3,4 arenateam-size (4 => 5-man), 1 guild .. it puts a resync button on the lv...
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['profile', array(
|
||||
'data' => [$exampleRow],
|
||||
'id' => 'characters',
|
||||
'name' => '$LANG.tab_characters',
|
||||
'hideCount' => 1,
|
||||
'_truncated' => 1,
|
||||
'roster' => 3,
|
||||
'visibleCols' => ['race','classs','level','talents','achievementpoints'],
|
||||
'note' => '$$WH.sprintf(LANG.lvnote_charactersfound, \'20,592,390\', 200) + LANG.dash + LANG.lvnote_tryfiltering.replace(\'<a>\', \'<a href="javascript:;" onclick="fi_toggle()">\')',
|
||||
'onBeforeCreate' => '$pr_initRosterListview' // $_GET['roster'] = 1|2|3|4 .. 2,3,4 arenateam-size (4 => 5-man), 1 guild .. it puts a resync button on the lv...
|
||||
)];
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -591,14 +591,11 @@ class QuestPage extends GenericPage
|
||||
if (!$seeAlso->error)
|
||||
{
|
||||
$this->extendGlobalData($seeAlso->getJSGlobals());
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $seeAlso->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'id' => 'see-also'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($seeAlso->getListviewData()),
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'id' => 'see-also'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: criteria of
|
||||
@@ -606,14 +603,11 @@ class QuestPage extends GenericPage
|
||||
if (!$criteriaOf->error)
|
||||
{
|
||||
$this->extendGlobalData($criteriaOf->getJSGlobals());
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $criteriaOf->getListviewData(),
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_criteriaof',
|
||||
'id' => 'criteria-of'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['achievement', array(
|
||||
'data' => array_values($criteriaOf->getListviewData()),
|
||||
'name' => '$LANG.tab_criteriaof',
|
||||
'id' => 'criteria-of'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: conditions
|
||||
@@ -655,14 +649,11 @@ class QuestPage extends GenericPage
|
||||
"Markup.printHtml(markup, 'tab-conditions', { allow: Markup.CLASS_STAFF })" .
|
||||
"</script>";
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => null,
|
||||
$this->lvTabs[] = [null, array(
|
||||
'data' => $tab,
|
||||
'params' => array(
|
||||
'id' => 'conditions',
|
||||
'name' => '$LANG.requires'
|
||||
)
|
||||
);
|
||||
'id' => 'conditions',
|
||||
'name' => '$LANG.requires'
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -891,29 +882,26 @@ class QuestPage extends GenericPage
|
||||
if (!($se['method'] & 0x2) || $se['type'] != TYPE_NPC)
|
||||
continue;
|
||||
|
||||
if ($_ = CreatureList::getName($se['typeId']))
|
||||
if ($ti = CreatureList::getName($se['typeId']))
|
||||
{
|
||||
$mail['sender'] = sprintf(Lang::quest('mailBy'), $se['typeId'], $_);
|
||||
$mail['sender'] = sprintf(Lang::quest('mailBy'), $se['typeId'], $ti);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$extraCols = ['Listview.extraCols.percent'];
|
||||
$extraCols = ['$Listview.extraCols.percent'];
|
||||
$mailLoot = new Loot();
|
||||
|
||||
if ($mailLoot->getByContainer(LOOT_MAIL, $_))
|
||||
{
|
||||
$this->extendGlobalData($mailLoot->jsGlobals);
|
||||
$attachmentTab = array(
|
||||
'file' => 'item',
|
||||
'data' => $mailLoot->getResult(),
|
||||
'params' => array(
|
||||
'name' => '[Mail Attachments]',
|
||||
'id' => 'mail-attachments',
|
||||
'extraCols' => "$[".implode(', ', array_merge($extraCols, $mailLoot->extraCols))."]",
|
||||
'hiddenCols' => "$['side', 'slot', 'reqlevel']"
|
||||
)
|
||||
);
|
||||
$attachmentTab = ['item', array(
|
||||
'data' => array_values($mailLoot->getResult()),
|
||||
'name' => Lang::quest('attachment'),
|
||||
'id' => 'mail-attachments',
|
||||
'extraCols' => array_merge($extraCols, $mailLoot->extraCols),
|
||||
'hiddenCols' => ['side', 'slot', 'reqlevel']
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,30 +54,26 @@ class QuestsPage extends GenericPage
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
|
||||
$lv = array(
|
||||
'file' => 'quest',
|
||||
'data' => $quests->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
$tabData = ['data' => array_values($quests->getListviewData())];
|
||||
|
||||
if ($_ = $this->filterObj->getForm('reputationCols'))
|
||||
$lv['params']['extraCols'] = '$fi_getReputationCols('.Util::toJSON($_).')';
|
||||
$tabData['extraCols'] = '$fi_getReputationCols('.json_encode($_, JSON_NUMERIC_CHECK).')';
|
||||
else if (!empty($this->filter['fi']['extraCols']))
|
||||
$lv['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($quests->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
{
|
||||
$lv['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_questsfound', $quests->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$lv['params']['_truncated'] = 1;
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_questsfound', $quests->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
else if (isset($this->category[1]) && $this->category[1] > 0)
|
||||
$lv['params']['note'] = '$$WH.sprintf(LANG.lvnote_questgivers, '.$this->category[1].', g_zones['.$this->category[1].'], '.$this->category[1].')';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_questgivers, '.$this->category[1].', g_zones['.$this->category[1].'], '.$this->category[1].')';
|
||||
|
||||
if ($this->filterObj->error)
|
||||
$lv['params']['_errors'] = '$1';
|
||||
$tabData['_errors'] = 1;
|
||||
|
||||
$this->lvTabs[] = $lv;
|
||||
$this->lvTabs[] = ['quest', $tabData];
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
|
||||
@@ -109,11 +109,7 @@ class RacePage extends GenericPage
|
||||
if (!$classes->error)
|
||||
{
|
||||
$this->extendGlobalData($classes->getJSGlobals());
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'class',
|
||||
'data' => $classes->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['class', ['data' => array_values($classes->getListviewData())]];
|
||||
}
|
||||
|
||||
// Tongues
|
||||
@@ -126,15 +122,12 @@ class RacePage extends GenericPage
|
||||
if (!$tongues->error)
|
||||
{
|
||||
$this->extendGlobalData($tongues->getJSGlobals());
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $tongues->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'languages',
|
||||
'name' => '$LANG.tab_languages',
|
||||
'hiddenCols' => "$['reagents']"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($tongues->getListviewData()),
|
||||
'id' => 'languages',
|
||||
'name' => '$LANG.tab_languages',
|
||||
'hiddenCols' => ['reagents']
|
||||
)];
|
||||
}
|
||||
|
||||
// Racials
|
||||
@@ -147,15 +140,12 @@ class RacePage extends GenericPage
|
||||
if (!$racials->error)
|
||||
{
|
||||
$this->extendGlobalData($racials->getJSGlobals());
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $racials->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'racial-traits',
|
||||
'name' => '$LANG.tab_racialtraits',
|
||||
'hiddenCols' => "$['reagents']"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($racials->getListviewData()),
|
||||
'id' => 'racial-traits',
|
||||
'name' => '$LANG.tab_racialtraits',
|
||||
'hiddenCols' => ['reagents']
|
||||
)];
|
||||
}
|
||||
|
||||
// Quests
|
||||
@@ -169,11 +159,7 @@ class RacePage extends GenericPage
|
||||
if (!$quests->error)
|
||||
{
|
||||
$this->extendGlobalData($quests->getJSGlobals());
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $quests->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['quest', ['data' => array_values($quests->getListviewData())]];
|
||||
}
|
||||
|
||||
// Mounts
|
||||
@@ -190,15 +176,12 @@ class RacePage extends GenericPage
|
||||
if (!$mounts->error)
|
||||
{
|
||||
$this->extendGlobalData($mounts->getJSGlobals());
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $mounts->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'mounts',
|
||||
'name' => '$LANG.tab_mounts',
|
||||
'hiddenCols' => "$['slot', 'type']"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($mounts->getListviewData()),
|
||||
'id' => 'mounts',
|
||||
'name' => '$LANG.tab_mounts',
|
||||
'hiddenCols' => ['slot', 'type']
|
||||
)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,13 +32,7 @@ class RacesPage extends GenericPage
|
||||
|
||||
$races = new CharRaceList($conditions);
|
||||
if (!$races->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'race',
|
||||
'data' => $races->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['race', ['data' => array_values($races->getListviewData())]];
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
|
||||
894
pages/search.php
894
pages/search.php
File diff suppressed because it is too large
Load Diff
140
pages/skill.php
140
pages/skill.php
@@ -76,16 +76,13 @@ class SkillPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($recipes->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $recipes->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'recipes',
|
||||
'name' => '$LANG.tab_recipes',
|
||||
'visibleCols' => "$['reagents', 'source']",
|
||||
'note' => sprintf(Util::$filterResultString, '?spells='.$this->cat.'.'.$this->typeId.'&filter=cr=20;crs=1;crv=0')
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($recipes->getListviewData()),
|
||||
'id' => 'recipes',
|
||||
'name' => '$LANG.tab_recipes',
|
||||
'visibleCols' => ['reagents', 'source'],
|
||||
'note' => sprintf(Util::$filterResultString, '?spells='.$this->cat.'.'.$this->typeId.'&filter=cr=20;crs=1;crv=0')
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: recipe Items [items] (Books)
|
||||
@@ -101,18 +98,16 @@ class SkillPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($recipeItems->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
if ($_ = array_search($this->typeId, $filterRecipe))
|
||||
$_ = sprintf(Util::$filterResultString, "?items=9.".$_);
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $recipeItems->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'recipe-items',
|
||||
'name' => '$LANG.tab_recipeitems',
|
||||
'note' => $_
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($recipeItems->getListviewData()),
|
||||
'id' => 'recipe-items',
|
||||
'name' => '$LANG.tab_recipeitems',
|
||||
);
|
||||
|
||||
if ($_ = array_search($this->typeId, $filterRecipe))
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, "?items=9.".$_);
|
||||
|
||||
$this->lvTabs[] = ['item', $tabData];
|
||||
}
|
||||
|
||||
// tab: crafted items [items]
|
||||
@@ -130,18 +125,16 @@ class SkillPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($created->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
if ($_ = array_search($this->typeId, $filterItem))
|
||||
$_ = sprintf(Util::$filterResultString, "?items&filter=cr=86;crs=".$_.";crv=0");
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $created->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'crafted-items',
|
||||
'name' => '$LANG.tab_crafteditems',
|
||||
'note' => $_
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($created->getListviewData()),
|
||||
'id' => 'crafted-items',
|
||||
'name' => '$LANG.tab_crafteditems',
|
||||
);
|
||||
|
||||
if ($_ = array_search($this->typeId, $filterItem))
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, "?items&filter=cr=86;crs=".$_.";crv=0");
|
||||
|
||||
$this->lvTabs[] = ['item', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,18 +150,16 @@ class SkillPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($reqBy->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
if ($_ = array_search($this->typeId, $filterItem))
|
||||
$_ = sprintf(Util::$filterResultString, "?items&filter=cr=99:168;crs=".$_.":2;crv=0:0");
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $reqBy->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'required-by',
|
||||
'name' => '$LANG.tab_requiredby',
|
||||
'note' => $_
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($reqBy->getListviewData()),
|
||||
'id' => 'required-by',
|
||||
'name' => '$LANG.tab_requiredby',
|
||||
);
|
||||
|
||||
if ($_ = array_search($this->typeId, $filterItem))
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, "?items&filter=99:168;crs=".$_.":2;crv=0:0");
|
||||
|
||||
$this->lvTabs[] = ['item', $tabData];
|
||||
}
|
||||
|
||||
// tab: required by [itemset]
|
||||
@@ -182,14 +173,11 @@ class SkillPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($reqBy->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'itemset',
|
||||
'data' => $reqBy->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'required-by-set',
|
||||
'name' => '$LANG.tab_requiredby'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['itemset', array(
|
||||
'data' => array_values($reqBy->getListviewData()),
|
||||
'id' => 'required-by-set',
|
||||
'name' => '$LANG.tab_requiredby'
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,28 +209,27 @@ class SkillPage extends GenericPage
|
||||
|
||||
$this->extendGlobalData($spells->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$lv = array(
|
||||
'file' => 'spell',
|
||||
'data' => $spells->getListviewData(),
|
||||
'params' => ['visibleCols' => "$['source']"]
|
||||
$tabData = array(
|
||||
'data' => array_values($spells->getListviewData()),
|
||||
'visibleCols' => ['source']
|
||||
);
|
||||
|
||||
switch ($this->cat)
|
||||
{
|
||||
case -4:
|
||||
$lv['params']['note'] = sprintf(Util::$filterResultString, '?spells=-4');
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?spells=-4');
|
||||
break;
|
||||
case 7:
|
||||
if ($this->typeId != 769) // Internal
|
||||
$lv['params']['note'] = sprintf(Util::$filterResultString, '?spells='.$this->cat.'.'.(log($reqClass, 2) + 1).'.'.$this->typeId); // doesn't matter what spell; reqClass should be identical for all Class Spells
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?spells='.$this->cat.'.'.(log($reqClass, 2) + 1).'.'.$this->typeId); // doesn't matter what spell; reqClass should be identical for all Class Spells
|
||||
break;
|
||||
case 9:
|
||||
case 11:
|
||||
$lv['params']['note'] = sprintf(Util::$filterResultString, '?spells='.$this->cat.'.'.$this->typeId);
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?spells='.$this->cat.'.'.$this->typeId);
|
||||
break;
|
||||
}
|
||||
|
||||
$this->lvTabs[] = $lv;
|
||||
$this->lvTabs[] = ['spell', $tabData];
|
||||
}
|
||||
|
||||
// tab: trainers [npcs]
|
||||
@@ -284,14 +271,11 @@ class SkillPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($trainer->getJSGlobals());
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'creature',
|
||||
'data' => $trainer->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'trainer',
|
||||
'name' => '$LANG.tab_trainers',
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['creature', array(
|
||||
'data' => array_values($trainer->getListviewData()),
|
||||
'id' => 'trainer',
|
||||
'name' => '$LANG.tab_trainers',
|
||||
)];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -321,11 +305,7 @@ class SkillPage extends GenericPage
|
||||
if (!$quests->error)
|
||||
{
|
||||
$this->extendGlobalData($quests->getJSGlobals());
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $quests->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['quest', ['data' => array_values($quests->getListviewData())]];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -340,13 +320,7 @@ class SkillPage extends GenericPage
|
||||
{
|
||||
$classes = new CharClassList(array(['id', $class]));
|
||||
if (!$classes->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'class',
|
||||
'data' => $classes->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['class', ['data' => array_values($classes->getListviewData())]];
|
||||
}
|
||||
|
||||
// tab: related races (apply races from [spells])
|
||||
@@ -359,13 +333,7 @@ class SkillPage extends GenericPage
|
||||
{
|
||||
$races = new CharRaceList(array(['id', $race]));
|
||||
if (!$races->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'race',
|
||||
'data' => $races->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['race', ['data' => array_values($races->getListviewData())]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,11 +38,7 @@ class SkillsPage extends GenericPage
|
||||
|
||||
$skills = new SkillList($conditions);
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'skill',
|
||||
'data' => $skills->getListviewData(), // listview content
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['skill', ['data' => array_values($skills->getListviewData())]];
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
|
||||
342
pages/spell.php
342
pages/spell.php
@@ -321,20 +321,18 @@ class SpellPage extends GenericPage
|
||||
$abilities = new SpellList(array(['id', $formSpells]));
|
||||
if (!$abilities->error)
|
||||
{
|
||||
if (!$abilities->hasSetFields(['skillLines']))
|
||||
$abH = "$['skill']";
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $abilities->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'controlledabilities',
|
||||
'name' => '$LANG.tab_controlledabilities',
|
||||
'visibleCols' => "$['level']",
|
||||
'hiddenCols' => isset($abH) ? $abH : null
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($abilities->getListviewData()),
|
||||
'id' => 'controlledabilities',
|
||||
'name' => '$LANG.tab_controlledabilities',
|
||||
'visibleCols' => ['level'],
|
||||
);
|
||||
|
||||
if (!$abilities->hasSetFields(['skillLines']))
|
||||
$tabData['hiddenCols'] = ['skill'];
|
||||
|
||||
$this->lvTabs[] = ['spell', $tabData];
|
||||
|
||||
$this->extendGlobalData($abilities->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
}
|
||||
@@ -370,20 +368,18 @@ class SpellPage extends GenericPage
|
||||
$modSpells = new SpellList($conditions);
|
||||
if (!$modSpells->error)
|
||||
{
|
||||
if (!$modSpells->hasSetFields(['skillLines']))
|
||||
$msH = "$['skill']";
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $modSpells->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'modifies',
|
||||
'name' => '$LANG.tab_modifies',
|
||||
'visibleCols' => "$['level']",
|
||||
'hiddenCols' => isset($msH) ? $msH : null
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($modSpells->getListviewData()),
|
||||
'id' => 'modifies',
|
||||
'name' => '$LANG.tab_modifies',
|
||||
'visibleCols' => ['level'],
|
||||
);
|
||||
|
||||
if (!$modSpells->hasSetFields(['skillLines']))
|
||||
$tabData['hiddenCols'] = ['skill'];
|
||||
|
||||
$this->lvTabs[] = ['spell', $tabData];
|
||||
|
||||
$this->extendGlobalData($modSpells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
}
|
||||
}
|
||||
@@ -421,20 +417,18 @@ class SpellPage extends GenericPage
|
||||
$modsSpell = new SpellList($conditions);
|
||||
if (!$modsSpell->error)
|
||||
{
|
||||
if (!$modsSpell->hasSetFields(['skillLines']))
|
||||
$mbH = "$['skill']";
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $modsSpell->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'modified-by',
|
||||
'name' => '$LANG.tab_modifiedby',
|
||||
'visibleCols' => "$['level']",
|
||||
'hiddenCols' => isset($mbH) ? $mbH : null
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($modsSpell->getListviewData()),
|
||||
'id' => 'modified-by',
|
||||
'name' => '$LANG.tab_modifiedby',
|
||||
'visibleCols' => ['level'],
|
||||
);
|
||||
|
||||
if (!$modsSpell->hasSetFields(['skillLines']))
|
||||
$tabData['hiddenCols'] = ['skill'];
|
||||
|
||||
$this->lvTabs[] = ['spell', $tabData];
|
||||
|
||||
$this->extendGlobalData($modsSpell->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
}
|
||||
}
|
||||
@@ -455,7 +449,7 @@ class SpellPage extends GenericPage
|
||||
$data = $saSpells->getListviewData();
|
||||
if ($this->difficulties) // needs a way to distinguish between dungeon and raid :x; creature using this -> map -> areaType?
|
||||
{
|
||||
$saE = '$[Listview.extraCols.mode]';
|
||||
$saE = ['$Listview.extraCols.mode'];
|
||||
|
||||
foreach ($data as $id => &$d)
|
||||
{
|
||||
@@ -485,21 +479,21 @@ class SpellPage extends GenericPage
|
||||
}
|
||||
}
|
||||
|
||||
if (!$saSpells->hasSetFields(['skillLines']))
|
||||
$saH = "$['skill']";
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $data,
|
||||
'params' => array(
|
||||
'id' => 'see-also',
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'visibleCols' => "$['level']",
|
||||
'extraCols' => isset($saE) ? $saE : null,
|
||||
'hiddenCols' => isset($saH) ? $saH : null
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($data),
|
||||
'id' => 'see-also',
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'visibleCols' => ['level'],
|
||||
);
|
||||
|
||||
if (!$saSpells->hasSetFields(['skillLines']))
|
||||
$tabData['hiddenCols'] = ['skill'];
|
||||
|
||||
if (isset($saE))
|
||||
$tabData['extraCols'] = $saE;
|
||||
|
||||
$this->lvTabs[] = ['spell', $tabData];
|
||||
|
||||
$this->extendGlobalData($saSpells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
}
|
||||
|
||||
@@ -513,14 +507,11 @@ class SpellPage extends GenericPage
|
||||
$ubSets = new ItemsetList($conditions);
|
||||
if (!$ubSets->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'itemset',
|
||||
'data' => $ubSets->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'used-by-itemset',
|
||||
'name' => '$LANG.tab_usedby'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['itemset', array(
|
||||
'data' => array_values($ubSets->getListviewData()),
|
||||
'id' => 'used-by-itemset',
|
||||
'name' => '$LANG.tab_usedby'
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($ubSets->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
}
|
||||
@@ -538,14 +529,11 @@ class SpellPage extends GenericPage
|
||||
$ubItems = new ItemList($conditions);
|
||||
if (!$ubItems->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $ubItems->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'used-by-item',
|
||||
'name' => '$LANG.tab_usedby'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($ubItems->getListviewData()),
|
||||
'id' => 'used-by-item',
|
||||
'name' => '$LANG.tab_usedby'
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($ubItems->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
@@ -560,14 +548,11 @@ class SpellPage extends GenericPage
|
||||
$ubObjects = new GameObjectList($conditions);
|
||||
if (!$ubObjects->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'object',
|
||||
'data' => $ubObjects->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'used-by-object',
|
||||
'name' => '$LANG.tab_usedby'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['object', array(
|
||||
'data' => array_values($ubObjects->getListviewData()),
|
||||
'id' => 'used-by-object',
|
||||
'name' => '$LANG.tab_usedby'
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($ubObjects->getJSGlobals());
|
||||
}
|
||||
@@ -582,14 +567,11 @@ class SpellPage extends GenericPage
|
||||
$coAchievemnts = new AchievementList($conditions);
|
||||
if (!$coAchievemnts->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $coAchievemnts->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'criteria-of',
|
||||
'name' => '$LANG.tab_criteriaof'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['achievement', array(
|
||||
'data' => array_values($coAchievemnts->getListviewData()),
|
||||
'id' => 'criteria-of',
|
||||
'name' => '$LANG.tab_criteriaof'
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($coAchievemnts->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
}
|
||||
@@ -605,7 +587,7 @@ class SpellPage extends GenericPage
|
||||
|
||||
$lv = $spellLoot->getResult();
|
||||
$extraCols = $spellLoot->extraCols;
|
||||
$extraCols[] = 'Listview.extraCols.percent';
|
||||
$extraCols[] = '$Listview.extraCols.percent';
|
||||
|
||||
if ($extraItem && $this->subject->canCreateItem())
|
||||
{
|
||||
@@ -619,7 +601,7 @@ class SpellPage extends GenericPage
|
||||
$lv[$bar]['percent'] = $extraItem['additionalCreateChance'];
|
||||
$lv[$bar]['condition'][0][$this->typeId][] = [[CND_SPELL, $extraItem['requiredSpecialization']]];
|
||||
$this->extendGlobalIds(TYPE_SPELL, $extraItem['requiredSpecialization']);
|
||||
$extraCols[] = 'Listview.extraCols.condition';
|
||||
$extraCols[] = '$Listview.extraCols.condition';
|
||||
if ($max = $extraItem['additionalMaxNum'])
|
||||
{
|
||||
$lv[$bar]['mincount'] = 1;
|
||||
@@ -631,16 +613,13 @@ class SpellPage extends GenericPage
|
||||
}
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $lv,
|
||||
'params' => array(
|
||||
'name' => '$LANG.tab_contains',
|
||||
'id' => 'contains',
|
||||
'hiddenCols' => "$['side', 'slot', 'source', 'reqlevel']",
|
||||
'extraCols' => '$['.implode(', ', $extraCols).']'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($lv),
|
||||
'name' => '$LANG.tab_contains',
|
||||
'id' => 'contains',
|
||||
'hiddenCols' => ['side', 'slot', 'source', 'reqlevel'],
|
||||
'extraCols' => $extraCols
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: exclusive with
|
||||
@@ -689,19 +668,20 @@ class SpellPage extends GenericPage
|
||||
$data[$k]['stackRule'] = $groups[$k];
|
||||
|
||||
if (!$stacks->hasSetFields(['skillLines']))
|
||||
$sH = "$['skill']";
|
||||
$sH = ['skill'];
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $data,
|
||||
'params' => array(
|
||||
'id' => 'spell-group-stack',
|
||||
'name' => 'Stack Group', // todo (med): localize
|
||||
'visibleCols' => "$['stackRules']",
|
||||
'hiddenCols' => isset($sH) ? $sH : null
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($data),
|
||||
'id' => 'spell-group-stack',
|
||||
'name' => Lang::spell('stackGroup'),
|
||||
'visibleCols' => ['stackRules']
|
||||
);
|
||||
|
||||
if (isset($sH))
|
||||
$tabData['hiddenCols'] = $sH;
|
||||
|
||||
$this->lvTabs[] = ['spell', $tabData];
|
||||
|
||||
$this->extendGlobalData($stacks->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
}
|
||||
}
|
||||
@@ -743,16 +723,13 @@ class SpellPage extends GenericPage
|
||||
}
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $data,
|
||||
'params' => array(
|
||||
'id' => 'spell-link',
|
||||
'name' => 'Linked with', // todo (med): localize
|
||||
'hiddenCols' => "$['skill', 'name']",
|
||||
'visibleCols' => "$['linkedTrigger', 'linkedEffect']"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($data),
|
||||
'id' => 'spell-link',
|
||||
'name' => Lang::spell('linkedWith'),
|
||||
'hiddenCols' => ['skill', 'name'],
|
||||
'visibleCols' => ['linkedTrigger', 'linkedEffect']
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($linked->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
}
|
||||
@@ -769,14 +746,11 @@ class SpellPage extends GenericPage
|
||||
$trigger = new SpellList($conditions);
|
||||
if (!$trigger->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $trigger->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'triggered-by',
|
||||
'name' => '$LANG.tab_triggeredby'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($trigger->getListviewData()),
|
||||
'id' => 'triggered-by',
|
||||
'name' => '$LANG.tab_triggeredby'
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($trigger->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
@@ -794,14 +768,11 @@ class SpellPage extends GenericPage
|
||||
$ubCreature = new CreatureList($conditions);
|
||||
if (!$ubCreature->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'creature',
|
||||
'data' => $ubCreature->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'used-by-npc',
|
||||
'name' => '$LANG.tab_usedby'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['creature', array(
|
||||
'data' => array_values($ubCreature->getListviewData()),
|
||||
'id' => 'used-by-npc',
|
||||
'name' => '$LANG.tab_usedby'
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($ubCreature->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
@@ -944,14 +915,15 @@ class SpellPage extends GenericPage
|
||||
$_ = array_merge($_, $parents[$_['parentArea']]);
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'zone',
|
||||
'data' => $lv,
|
||||
'params' => array(
|
||||
'extraCols' => $extra ? '$[Listview.extraCols.condition]' : null,
|
||||
'hiddenCols' => $extra ? "$['instancetype']" : null
|
||||
)
|
||||
);
|
||||
$tabData = ['data' => array_values($lv)];
|
||||
|
||||
if ($extra)
|
||||
{
|
||||
$tabData['extraCols'] = ['$Listview.extraCols.condition'];
|
||||
$tabData['hiddenCols'] = ['instancetype'];
|
||||
}
|
||||
|
||||
$this->lvTabs[] = ['zone', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -963,9 +935,6 @@ class SpellPage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($teaches->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
$vis = ['level', 'schools'];
|
||||
$hid = [];
|
||||
if (!$teaches->hasSetFields(['skillLines']))
|
||||
$hid[] = 'skill';
|
||||
|
||||
foreach ($teaches->iterate() as $__)
|
||||
{
|
||||
@@ -976,16 +945,17 @@ class SpellPage extends GenericPage
|
||||
break;
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $teaches->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'teaches-spell',
|
||||
'name' => '$LANG.tab_teaches',
|
||||
'visibleCols' => '$'.Util::toJSON($vis),
|
||||
'hiddenCols' => $hid ? '$'.Util::toJSON($hid) : null
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($teaches->getListviewData()),
|
||||
'id' => 'teaches-spell',
|
||||
'name' => '$LANG.tab_teaches',
|
||||
'visibleCols' => $vis,
|
||||
);
|
||||
|
||||
if (!$teaches->hasSetFields(['skillLines']))
|
||||
$tabData['hiddenCols'] = ['skill'];
|
||||
|
||||
$this->lvTabs[] = ['spell', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1036,14 +1006,11 @@ class SpellPage extends GenericPage
|
||||
if (!$tbTrainer->error)
|
||||
{
|
||||
$this->extendGlobalData($tbTrainer->getJSGlobals());
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'creature',
|
||||
'data' => $tbTrainer->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'taught-by-npc',
|
||||
'name' => '$LANG.tab_taughtby',
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['creature', array(
|
||||
'data' => array_values($tbTrainer->getListviewData()),
|
||||
'id' => 'taught-by-npc',
|
||||
'name' => '$LANG.tab_taughtby',
|
||||
)];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1061,14 +1028,11 @@ class SpellPage extends GenericPage
|
||||
if (!$tbSpell->error)
|
||||
{
|
||||
$tbsData = $tbSpell->getListviewData();
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $tbsData,
|
||||
'params' => array(
|
||||
'id' => 'taught-by-spell',
|
||||
'name' => '$LANG.tab_taughtby'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['spell', array(
|
||||
'data' => array_values($tbsData),
|
||||
'id' => 'taught-by-spell',
|
||||
'name' => '$LANG.tab_taughtby'
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($tbSpell->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
@@ -1087,14 +1051,11 @@ class SpellPage extends GenericPage
|
||||
$tbQuest = new QuestList($conditions);
|
||||
if (!$tbQuest->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $tbQuest->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'reward-from-quest',
|
||||
'name' => '$LANG.tab_rewardfrom'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($tbQuest->getListviewData()),
|
||||
'id' => 'reward-from-quest',
|
||||
'name' => '$LANG.tab_rewardfrom'
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($tbQuest->getJSGlobals());
|
||||
}
|
||||
@@ -1112,14 +1073,11 @@ class SpellPage extends GenericPage
|
||||
$tbItem = new ItemList($conditions);
|
||||
if (!$tbItem->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $tbItem->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'taught-by-item',
|
||||
'name' => '$LANG.tab_taughtby'
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($tbItem->getListviewData()),
|
||||
'id' => 'taught-by-item',
|
||||
'name' => '$LANG.tab_taughtby'
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($tbItem->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
@@ -1134,11 +1092,10 @@ class SpellPage extends GenericPage
|
||||
$enchList = new EnchantmentList($conditions);
|
||||
if (!$enchList->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'enchantment',
|
||||
'data' => $enchList->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['enchantment', array(
|
||||
'data' => array_values($enchList->getListviewData()),
|
||||
'name' => Util::ucFirst(Lang::game('enchantments'))
|
||||
), 'enchantment'];
|
||||
|
||||
$this->extendGlobalData($enchList->getJSGlobals());
|
||||
}
|
||||
@@ -1159,14 +1116,11 @@ class SpellPage extends GenericPage
|
||||
"Markup.printHtml(markup, 'tab-conditions', { allow: Markup.CLASS_STAFF })" .
|
||||
"</script>";
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => null,
|
||||
$this->lvTabs[] = [null, array(
|
||||
'data' => $tab,
|
||||
'params' => array(
|
||||
'id' => 'conditions',
|
||||
'name' => '$LANG.requires'
|
||||
)
|
||||
);
|
||||
'id' => 'conditions',
|
||||
'name' => '$LANG.requires'
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,11 +100,7 @@ class SpellsPage extends GenericPage
|
||||
$conditions = [];
|
||||
$visibleCols = [];
|
||||
$hiddenCols = [];
|
||||
$tab = array(
|
||||
'file' => 'spell',
|
||||
'data' => [],
|
||||
'params' => []
|
||||
);
|
||||
$tabData = ['data' => []];
|
||||
|
||||
// the next lengthy ~250 lines determine $conditions and lvParams
|
||||
if ($this->category)
|
||||
@@ -200,10 +196,10 @@ class SpellsPage extends GenericPage
|
||||
break;
|
||||
}
|
||||
|
||||
$tab['params']['note'] = '$$WH.sprintf(LANG.lvnote_pettalents, "'.$url.'")';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_pettalents, "'.$url.'")';
|
||||
}
|
||||
|
||||
$tab['params']['_petTalents'] = 1; // not conviced, this is correct, but .. it works
|
||||
$tabData['_petTalents'] = 1; // not conviced, this is correct, but .. it works
|
||||
|
||||
break;
|
||||
case -11: // Proficiencies ... the subIds are actually SkillLineCategories
|
||||
@@ -299,8 +295,8 @@ class SpellsPage extends GenericPage
|
||||
if (is_array($note))
|
||||
$note = $note[0];
|
||||
|
||||
$tab['params']['note'] = sprintf(Lang::spell('relItems', 'base'), $txt, $note);
|
||||
$tab['params']['sort'] = "$['skill', 'name']";
|
||||
$tabData['note'] = sprintf(Lang::spell('relItems', 'base'), $txt, $note);
|
||||
$tabData['sort'] = ['skill', 'name'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,8 +335,8 @@ class SpellsPage extends GenericPage
|
||||
if (is_array($note))
|
||||
$note = $note[0];
|
||||
|
||||
$tab['params']['note'] = sprintf(Lang::spell('relItems', 'base'), $txt, $note);
|
||||
$tab['params']['sort'] = "$['skill', 'name']";
|
||||
$tabData['note'] = sprintf(Lang::spell('relItems', 'base'), $txt, $note);
|
||||
$tabData['sort'] = ['skill', 'name'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,7 +363,7 @@ class SpellsPage extends GenericPage
|
||||
$spells = new SpellList($conditions);
|
||||
|
||||
$this->extendGlobalData($spells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
$tab['data'] = $spells->getListviewData();
|
||||
$tabData['data'] = array_values($spells->getListviewData());
|
||||
|
||||
// recreate form selection
|
||||
$this->filter = array_merge($this->filterObj->getForm('form'), $this->filter);
|
||||
@@ -375,17 +371,17 @@ class SpellsPage extends GenericPage
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
|
||||
if (!empty($this->filter['fi']['extraCols']))
|
||||
$tab['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
// create note if search limit was exceeded; overwriting 'note' is intentional
|
||||
if ($spells->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
{
|
||||
$tab['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_spellsfound', $spells->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tab['params']['_truncated'] = 1;
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_spellsfound', $spells->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
if ($this->filterObj->error)
|
||||
$tab['params']['_errors'] = '$1';
|
||||
$tabData['_errors'] = 1;
|
||||
|
||||
// add source to cols if explicitly searching for it
|
||||
if ($_ = $this->filterObj->getForm('setCriteria', true))
|
||||
@@ -404,12 +400,12 @@ class SpellsPage extends GenericPage
|
||||
|
||||
|
||||
if ($visibleCols)
|
||||
$tab['params']['visibleCols'] = '$'.Util::toJSON($visibleCols);
|
||||
$tabData['visibleCols'] = $visibleCols;
|
||||
|
||||
if ($hiddenCols)
|
||||
$tab['params']['hiddenCols'] = '$'.Util::toJSON($hiddenCols);
|
||||
$tabData['hiddenCols'] = $hiddenCols;
|
||||
|
||||
$this->lvTabs[] = $tab;
|
||||
$this->lvTabs[] = ['spell', $tabData];
|
||||
|
||||
// sort for dropdown-menus
|
||||
Lang::sort('game', 'ra');
|
||||
|
||||
@@ -104,16 +104,13 @@ class TitlePage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($quests->getJSGlobals(GLOBALINFO_REWARDS));
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $quests->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'reward-from-quest',
|
||||
'name' => '$LANG.tab_rewardfrom',
|
||||
'hiddenCols' => "$['experience', 'money']",
|
||||
'visibleCols' => "$['category']"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($quests->getListviewData()),
|
||||
'id' => 'reward-from-quest',
|
||||
'name' => '$LANG.tab_rewardfrom',
|
||||
'hiddenCols' => ['experience', 'money'],
|
||||
'visibleCols' => ['category']
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: achievement source
|
||||
@@ -124,16 +121,13 @@ class TitlePage extends GenericPage
|
||||
{
|
||||
$this->extendGlobalData($acvs->getJSGlobals());
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $acvs->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'reward-from-achievement',
|
||||
'name' => '$LANG.tab_rewardfrom',
|
||||
'visibleCols' => "$['category']",
|
||||
'sort' => "$['reqlevel', 'name']"
|
||||
)
|
||||
);
|
||||
$this->lvTabs[] = ['achievement', array(
|
||||
'data' => array_values($acvs->getListviewData()),
|
||||
'id' => 'reward-from-achievement',
|
||||
'name' => '$LANG.tab_rewardfrom',
|
||||
'visibleCols' => ['category'],
|
||||
'sort' => ['reqlevel', 'name']
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,22 +36,20 @@ class TitlesPage extends GenericPage
|
||||
if ($this->category)
|
||||
$conditions[] = ['category', $this->category[0]];
|
||||
|
||||
$titles = new TitleList($conditions);
|
||||
$tabData = ['data' => []];
|
||||
$titles = new TitleList($conditions);
|
||||
if (!$titles->error)
|
||||
{
|
||||
$params = [];
|
||||
$tabData['data'] = array_values($titles->getListviewData());
|
||||
|
||||
if ($titles->hasDiffFields(['category']))
|
||||
$params['visibleCols'] = "$['category']";
|
||||
$tabData['visibleCols'] = ['category'];
|
||||
|
||||
if (!$titles->hasAnySource())
|
||||
$params['hiddenCols'] = "$['source']";
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'title',
|
||||
'data' => $titles->getListviewData(),
|
||||
'params' => $params
|
||||
);
|
||||
$tabData['hiddenCols'] = ['source'];
|
||||
}
|
||||
|
||||
$this->lvTabs[] = ['title', $tabData];
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
|
||||
102
pages/user.php
102
pages/user.php
@@ -138,95 +138,79 @@ class UserPage extends GenericPage
|
||||
foreach ($repData as &$r)
|
||||
$r['when'] = date(Util::$dateFormatInternal, $r['when']);
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'reputationhistory',
|
||||
'data' => $repData,
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['reputationhistory', ['data' => $repData]];
|
||||
}
|
||||
|
||||
// Comments
|
||||
if ($_ = CommunityContent::getCommentPreviews(['user' => $this->user['id'], 'replies' => false], $nFound))
|
||||
{
|
||||
$lvData = array(
|
||||
'file' => 'commentpreview',
|
||||
'data' => $_,
|
||||
'params' => array(
|
||||
'hiddenCols' => "$['author']",
|
||||
'onBeforeCreate' => '$Listview.funcBox.beforeUserComments',
|
||||
'_totalCount' => $nFound
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => $_,
|
||||
'hiddenCols' => ['author'],
|
||||
'onBeforeCreate' => '$Listview.funcBox.beforeUserComments',
|
||||
'_totalCount' => $nFound
|
||||
);
|
||||
|
||||
if ($nFound > CFG_SQL_LIMIT_DEFAULT)
|
||||
{
|
||||
$lvData['params']['name'] = '$LANG.tab_latestcomments';
|
||||
$lvData['params']['note'] = '$$WH.sprintf(LANG.lvnote_usercomments, '.$nFound.')';
|
||||
$tabData['name'] = '$LANG.tab_latestcomments';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_usercomments, '.$nFound.')';
|
||||
}
|
||||
|
||||
$this->lvTabs[] = $lvData;
|
||||
$this->lvTabs[] = ['commentpreview', $tabData];
|
||||
}
|
||||
|
||||
// Comment Replies
|
||||
if ($_ = CommunityContent::getCommentPreviews(['user' => $this->user['id'], 'replies' => true], $nFound))
|
||||
{
|
||||
$lvData = array(
|
||||
'file' => 'replypreview',
|
||||
'data' => $_,
|
||||
'params' => array(
|
||||
'hiddenCols' => "$['author']",
|
||||
'onBeforeCreate' => '$Listview.funcBox.beforeUserComments',
|
||||
'_totalCount' => $nFound
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => $_,
|
||||
'hiddenCols' => ['author'],
|
||||
'onBeforeCreate' => '$Listview.funcBox.beforeUserComments',
|
||||
'_totalCount' => $nFound
|
||||
);
|
||||
|
||||
if ($nFound > CFG_SQL_LIMIT_DEFAULT)
|
||||
{
|
||||
$lvData['params']['name'] = '$LANG.tab_latestreplies';
|
||||
$lvData['params']['note'] = '$$WH.sprintf(LANG.lvnote_userreplies, '.$nFound.')';
|
||||
$tabData['name'] = '$LANG.tab_latestreplies';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_userreplies, '.$nFound.')';
|
||||
}
|
||||
|
||||
$this->lvTabs[] = $lvData;
|
||||
$this->lvTabs[] = ['replypreview', $tabData];
|
||||
}
|
||||
|
||||
// Screenshots
|
||||
if ($_ = CommunityContent::getScreenshots(-$this->user['id'], 0, $nFound))
|
||||
{
|
||||
$lvData = array(
|
||||
'file' => 'screenshot',
|
||||
'data' => $_,
|
||||
'params' => array(
|
||||
'_totalCount' => $nFound
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => $_,
|
||||
'_totalCount' => $nFound
|
||||
);
|
||||
|
||||
if ($nFound > CFG_SQL_LIMIT_DEFAULT)
|
||||
{
|
||||
$lvData['params']['name'] = '$LANG.tab_latestscreenshots';
|
||||
$lvData['params']['note'] = '$$WH.sprintf(LANG.lvnote_userscreenshots, '.$nFound.')';
|
||||
$tabData['name'] = '$LANG.tab_latestscreenshots';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_userscreenshots, '.$nFound.')';
|
||||
}
|
||||
|
||||
$this->lvTabs[] = $lvData;
|
||||
$this->lvTabs[] = ['screenshot', $tabData];
|
||||
}
|
||||
|
||||
// Videos
|
||||
if ($_ = CommunityContent::getVideos(-$this->user['id'], 0, $nFound))
|
||||
{
|
||||
$lvData = array(
|
||||
'file' => 'video',
|
||||
'data' => $_,
|
||||
'params' => array(
|
||||
'_totalCount' => $nFound
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => $_,
|
||||
'_totalCount' => $nFound
|
||||
);
|
||||
|
||||
if ($nFound > CFG_SQL_LIMIT_DEFAULT)
|
||||
{
|
||||
$lvData['params']['name'] = '$LANG.tab_latestvideos';
|
||||
$lvData['params']['note'] = '$$WH.sprintf(LANG.lvnote_uservideos, '.$nFound.')';
|
||||
$tabData['name'] = '$LANG.tab_latestvideos';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_uservideos, '.$nFound.')';
|
||||
}
|
||||
|
||||
$this->lvTabs[] = $lvData;
|
||||
$this->lvTabs[] = ['video', $tabData];
|
||||
}
|
||||
|
||||
// forum -> latest topics [unused]
|
||||
@@ -235,6 +219,34 @@ class UserPage extends GenericPage
|
||||
|
||||
// Characters [todo]
|
||||
$this->user['characterData'] = [];
|
||||
/*
|
||||
us_addCharactersTab([
|
||||
{
|
||||
id:763,
|
||||
"name":"Lilywhite",
|
||||
"achievementpoints":"0",
|
||||
"guild":"whatever",
|
||||
"guildrank":"0",
|
||||
"realm":"draenor",
|
||||
"realmname":"Draenor",
|
||||
"battlegroup":"cyclone",
|
||||
"battlegroupname":"Cyclone",
|
||||
"region":"us",
|
||||
"level":"10",
|
||||
"race":"7",
|
||||
"gender":"0",
|
||||
"classs":"1",
|
||||
"faction":"0",
|
||||
"gearscore":"0",
|
||||
"talenttree1":"0",
|
||||
"talenttree2":"0",
|
||||
"talenttree3":"0",
|
||||
"talentspec":0,
|
||||
"published":1,
|
||||
"pinned":0
|
||||
}
|
||||
]);
|
||||
*/
|
||||
|
||||
// Profiles [todo]
|
||||
$this->user['profileData'] = [];
|
||||
|
||||
@@ -91,13 +91,8 @@ class UtilityPage extends GenericPage
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'commentpreview',
|
||||
'data' => $data,
|
||||
'params' => []
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['commentpreview', ['data' => $data]];
|
||||
|
||||
break;
|
||||
case 'latest-screenshots': // rss
|
||||
$data = CommunityContent::getScreenshots();
|
||||
@@ -124,13 +119,8 @@ class UtilityPage extends GenericPage
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'screenshot',
|
||||
'data' => $data,
|
||||
'params' => []
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['screenshot', ['data' => $data]];
|
||||
|
||||
break;
|
||||
case 'latest-videos': // rss
|
||||
$data = CommunityContent::getVideos();
|
||||
@@ -157,13 +147,8 @@ class UtilityPage extends GenericPage
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'video',
|
||||
'data' => $data,
|
||||
'params' => []
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['video', ['data' => $data]];
|
||||
|
||||
break;
|
||||
case 'latest-articles': // rss
|
||||
$this->lvTabs = [];
|
||||
@@ -172,11 +157,7 @@ class UtilityPage extends GenericPage
|
||||
$extraText = '';
|
||||
break;
|
||||
case 'unrated-comments':
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'commentpreview',
|
||||
'data' => [],
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = ['commentpreview', ['data' => []]];
|
||||
break;
|
||||
case 'missing-screenshots':
|
||||
// limit to 200 entries each (it generates faster, consumes less memory and should be enough options)
|
||||
@@ -193,11 +174,7 @@ class UtilityPage extends GenericPage
|
||||
if (!$typeObj->error)
|
||||
{
|
||||
$this->extendGlobalData($typeObj->getJSGlobals(GLOBALINFO_ANY));
|
||||
$this->lvTabs[] = array(
|
||||
'file' => $typeObj::$brickFile,
|
||||
'data' => $typeObj->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
$this->lvTabs[] = [$typeObj::$brickFile, ['data' => array_values($typeObj->getListviewData())]];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -205,9 +182,9 @@ class UtilityPage extends GenericPage
|
||||
if ($this->category && !in_array($this->category[0], [1, 7, 30]))
|
||||
header('Location: ?most-comments=1'.($this->rss ? '&rss' : null), true, 302);
|
||||
|
||||
$params = array(
|
||||
'extraCols' => '$[Listview.funcBox.createSimpleCol(\'ncomments\', \'tab_comments\', \'10%\', \'ncomments\')]',
|
||||
'sort' => '$[\'-ncomments\']'
|
||||
$tabBase = array(
|
||||
'extraCols' => ["\$Listview.funcBox.createSimpleCol('ncomments', 'tab_comments', '10%', 'ncomments')"],
|
||||
'sort' => ['-ncomments']
|
||||
);
|
||||
|
||||
foreach (Util::$typeClasses as $type => $classStr)
|
||||
@@ -250,11 +227,7 @@ class UtilityPage extends GenericPage
|
||||
$d['ncomments'] = $comments[$typeId];
|
||||
|
||||
$this->extendGlobalData($typeClass->getJSGlobals(GLOBALINFO_ANY));
|
||||
$this->lvTabs[] = array(
|
||||
'file' => $typeClass::$brickFile,
|
||||
'data' => $data,
|
||||
'params' => $params
|
||||
);
|
||||
$this->lvTabs[] = [$typeClass::$brickFile, array_merge($tabBase, ['data' => array_values($data)])];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,14 +236,9 @@ class UtilityPage extends GenericPage
|
||||
}
|
||||
|
||||
// found nothing => set empty content
|
||||
// tpl: commentpreview - anything, doesn't matter what
|
||||
if (!$this->lvTabs && !$this->rss)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'commentpreview', // anything, doesn't matter what
|
||||
'data' => [],
|
||||
'params' => []
|
||||
);
|
||||
}
|
||||
$this->lvTabs[] = ['commentpreview', ['data' => []]];
|
||||
}
|
||||
|
||||
protected function generateRSS()
|
||||
|
||||
110
pages/zone.php
110
pages/zone.php
@@ -460,45 +460,42 @@ class ZonePage extends GenericPage
|
||||
// tab: NPCs
|
||||
if ($cSpawns && !$creatureSpawns->error)
|
||||
{
|
||||
$lvData = array(
|
||||
'file' => 'creature',
|
||||
'data' => $creatureSpawns->getListviewData(),
|
||||
'params' => ['note' => sprintf(Util::$filterResultString, '?npcs&filter=cr=6;crs='.$this->typeId.';crv=0')]
|
||||
$tabData = array(
|
||||
'data' => array_values($creatureSpawns->getListviewData()),
|
||||
'note' => sprintf(Util::$filterResultString, '?npcs&filter=cr=6;crs='.$this->typeId.';crv=0')
|
||||
);
|
||||
|
||||
if ($creatureSpawns->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
$lvData['params']['_truncated'] = 1;
|
||||
$tabData['_truncated'] = 1;
|
||||
|
||||
$this->extendGlobalData($creatureSpawns->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = $lvData;
|
||||
$this->lvTabs[] = ['creature', $tabData];
|
||||
}
|
||||
|
||||
// tab: Objects
|
||||
if ($oSpawns && !$objectSpawns->error)
|
||||
{
|
||||
$lvData = array(
|
||||
'file' => 'object',
|
||||
'data' => $objectSpawns->getListviewData(),
|
||||
'params' => ['note' => sprintf(Util::$filterResultString, '?objects&filter=cr=1;crs='.$this->typeId.';crv=0')]
|
||||
$tabData = array(
|
||||
'data' => array_values($objectSpawns->getListviewData()),
|
||||
'note' => sprintf(Util::$filterResultString, '?objects&filter=cr=1;crs='.$this->typeId.';crv=0')
|
||||
);
|
||||
|
||||
if ($objectSpawns->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
$lvData['params']['_truncated'] = 1;
|
||||
$tabData['_truncated'] = 1;
|
||||
|
||||
$this->extendGlobalData($objectSpawns->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
$this->lvTabs[] = $lvData;
|
||||
$this->lvTabs[] = ['object', $tabData];
|
||||
}
|
||||
|
||||
// tab: Quests [data collected by SOM-routine]
|
||||
if ($questsLV)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $questsLV,
|
||||
'params' => ['note' => '$$WH.sprintf(LANG.lvnote_zonequests, '.$this->subject->getField('mapId').', '.$this->typeId.', \''.Util::jsEscape($this->subject->getField('name', true)).'\', '.$this->typeId.')']
|
||||
);
|
||||
$this->lvTabs[] = ['quest', array(
|
||||
'data' => array_values($questsLV),
|
||||
'note' => '$$WH.sprintf(LANG.lvnote_zonequests, '.$this->subject->getField('mapId').', '.$this->typeId.', \''.Util::jsEscape($this->subject->getField('name', true)).'\', '.$this->typeId.')'
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: item-quest starter
|
||||
@@ -517,14 +514,11 @@ class ZonePage extends GenericPage
|
||||
$qsiList = new ItemList(array(['id', array_keys($questStartItem)]));
|
||||
if (!$qsiList->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $qsiList->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_startsquest',
|
||||
'id' => 'starts-quest'
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($qsiList->getListviewData()),
|
||||
'name' => '$LANG.tab_startsquest',
|
||||
'id' => 'starts-quest'
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($qsiList->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
@@ -536,15 +530,12 @@ class ZonePage extends GenericPage
|
||||
$rewards = new ItemList(array(['id', array_unique($rewardsLV)]));
|
||||
if (!$rewards->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $rewards->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_questrewards',
|
||||
'id' => 'quest-rewards',
|
||||
'note' => sprintf(Util::$filterResultString, '?items&filter=cr=126;crs='.$this->typeId.';crv=0')
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($rewards->getListviewData()),
|
||||
'name' => '$LANG.tab_questrewards',
|
||||
'id' => 'quest-rewards',
|
||||
'note' => sprintf(Util::$filterResultString, '?items&filter=cr=126;crs='.$this->typeId.';crv=0')
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($rewards->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
@@ -557,30 +548,27 @@ class ZonePage extends GenericPage
|
||||
if ($fish->getByContainer(LOOT_FISHING, $this->typeId))
|
||||
{
|
||||
$this->extendGlobalData($fish->jsGlobals);
|
||||
$xCols = array_merge(['Listview.extraCols.percent'], $fish->extraCols);
|
||||
$xCols = array_merge(['$Listview.extraCols.percent'], $fish->extraCols);
|
||||
|
||||
foreach ($fish->iterate() as $lv)
|
||||
{
|
||||
if (!$lv['quest'])
|
||||
continue;
|
||||
|
||||
$xCols = array_merge($xCols, ['Listview.extraCols.condition']);
|
||||
$xCols = array_merge($xCols, ['$Listview.extraCols.condition']);
|
||||
|
||||
$reqQuest[$lv['id']] = 0;
|
||||
|
||||
$lv['condition'][0][$this->typeId][] = [[CND_QUESTTAKEN, &$reqQuest[$lv['id']]]];
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'item',
|
||||
'data' => $fish->getResult(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_fishing',
|
||||
'id' => 'fishing',
|
||||
'extraCols' => $xCols ? "$[".implode(', ', array_unique($xCols))."]" : null,
|
||||
'hiddenCols' => "$['side']"
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['item', array(
|
||||
'data' => array_values($fish->getResult()),
|
||||
'name' => '$LANG.tab_fishing',
|
||||
'id' => 'fishing',
|
||||
'extraCols' => array_unique($xCols),
|
||||
'hiddenCols' => ['side']
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: spells
|
||||
@@ -672,14 +660,15 @@ class ZonePage extends GenericPage
|
||||
}
|
||||
}
|
||||
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'spell',
|
||||
'data' => $lvSpells,
|
||||
'params' => array(
|
||||
'extraCols' => $extra ? '$[Listview.extraCols.condition]' : null,
|
||||
'hiddenCols' => "$['skill']"
|
||||
)
|
||||
$tabData = array(
|
||||
'data' => array_values($lvSpells),
|
||||
'hiddenCols' => ['skill']
|
||||
);
|
||||
|
||||
if ($extra)
|
||||
$tabData['extraCols'] = ['$Listview.extraCols.condition'];
|
||||
|
||||
$this->lvTabs[] = ['spell', $tabData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -687,15 +676,12 @@ class ZonePage extends GenericPage
|
||||
$subZones = new ZoneList(array(['parentArea', $this->typeId]));
|
||||
if (!$subZones->error)
|
||||
{
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'zone',
|
||||
'data' => $subZones->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_zones',
|
||||
'id' => 'subzones',
|
||||
'hiddenCols' => "$['territory', 'instancetype']"
|
||||
]
|
||||
);
|
||||
$this->lvTabs[] = ['zone', array(
|
||||
'data' => array_values($subZones->getListviewData()),
|
||||
'name' => '$LANG.tab_zones',
|
||||
'id' => 'subzones',
|
||||
'hiddenCols' => ['territory', 'instancetype']
|
||||
)];
|
||||
|
||||
$this->extendGlobalData($subZones->getJSGlobals(GLOBALINFO_SELF));
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ class ZonesPage extends GenericPage
|
||||
$conditions = [CFG_SQL_LIMIT_NONE];
|
||||
$visibleCols = [];
|
||||
$hiddenCols = [];
|
||||
$params = [];
|
||||
$mapFile = 0;
|
||||
$spawnMap = -1;
|
||||
|
||||
@@ -75,18 +74,16 @@ class ZonesPage extends GenericPage
|
||||
if (!$zones->hasSetFields(['type']))
|
||||
$hiddenCols[] = 'instancetype';
|
||||
|
||||
$tabData = ['data' => array_values($zones->getListviewData())];
|
||||
|
||||
if ($visibleCols)
|
||||
$params['visibleCols'] = "$['".implode("', '", $visibleCols)."']";
|
||||
$tabData['visibleCols'] = $visibleCols;
|
||||
|
||||
if ($hiddenCols)
|
||||
$params['hiddenCols'] = "$['".implode("', '", $hiddenCols)."']";
|
||||
$tabData['hiddenCols'] = $hiddenCols;
|
||||
|
||||
$this->map = null;
|
||||
$this->lvTabs[] = array(
|
||||
'file' => 'zone',
|
||||
'data' => $zones->getListviewData(),
|
||||
'params' => $params
|
||||
);
|
||||
$this->lvTabs[] = ['zone', $tabData];
|
||||
|
||||
// create flight map
|
||||
if ($mapFile)
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
<?php
|
||||
foreach ($this->announcements as $id => $data):
|
||||
$data = json_encode($data, JSON_NUMERIC_CHECK);
|
||||
// json_encode does not recognize variables
|
||||
$data = preg_replace('/"\$((.+?)([^\\\\]))"/i', '$1', $data);
|
||||
?>
|
||||
<div id="announcement-<?php echo $id; ?>"></div>
|
||||
<div id="announcement-<?=$id; ?>"></div>
|
||||
<script type="text/javascript">
|
||||
new Announcement(<?php echo $data; ?>);
|
||||
new Announcement(<?=Util::toJSON($data); ?>);
|
||||
</script>
|
||||
<?php
|
||||
endforeach;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
if (!empty($this->pageText)):
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
<h3><?php echo Lang::item('content'); ?></h3>
|
||||
<h3><?=Lang::item('content'); ?></h3>
|
||||
|
||||
<div id="book-generic"></div>
|
||||
<script>//<![CDATA[
|
||||
new Book({ parent: 'book-generic', pages: <?php echo json_encode($this->pageText); ?>})
|
||||
new Book({ parent: 'book-generic', pages: <?=Util::toJSON($this->pageText); ?>})
|
||||
//]]></script>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
@@ -3,6 +3,8 @@ $relTabs = !empty($relTabs);
|
||||
$tabVar = $relTabs || !empty($this->user) ? 'tabsRelated' : 'myTabs';
|
||||
$isTabbed = !empty($this->forceTabs) || $relTabs || count($this->lvTabs) > 1;
|
||||
|
||||
// lvTab: [file, data, extraInclude]
|
||||
|
||||
if ($isTabbed):
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
@@ -10,17 +12,17 @@ if ($isTabbed):
|
||||
<?php endif; ?>
|
||||
<div id="lv-generic" class="listview"><?php
|
||||
foreach ($this->lvTabs as $lv):
|
||||
if ($lv['file']):
|
||||
if ($lv[0]):
|
||||
continue;
|
||||
endif;
|
||||
|
||||
echo '<div class="text tabbed-contents" id="tab-'.$lv['params']['id'].'" style="display:none;">'.$lv['data'].'</div>';
|
||||
echo '<div class="text tabbed-contents" id="tab-'.$lv[1]['id'].'" style="display:none;">'.$lv[1]['data'].'</div>';
|
||||
endforeach;
|
||||
?></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
<?php
|
||||
if (!empty($this->gemScores)): // inherited from items.tpl.php
|
||||
echo " var fi_gemScores = ".json_encode($this->gemScores, JSON_NUMERIC_CHECK).";\n";
|
||||
echo " var fi_gemScores = ".Util::toJSON($this->gemScores).";\n";
|
||||
endif;
|
||||
|
||||
if ($isTabbed):
|
||||
@@ -28,16 +30,26 @@ if ($isTabbed):
|
||||
endif;
|
||||
|
||||
foreach ($this->lvTabs as $lv):
|
||||
if (!empty($lv['data']) || (count($this->lvTabs) == 1 && !$relTabs)):
|
||||
if (!empty($lv[1]['data']) || (count($this->lvTabs) == 1 && !$relTabs)):
|
||||
if ($isTabbed):
|
||||
$lv['params']['tabs'] = '$'.$tabVar;
|
||||
$lv[1]['tabs'] = '$'.$tabVar;
|
||||
endif;
|
||||
|
||||
if ($lv['file']):
|
||||
$this->lvBrick($lv['file'], ['data' => $lv['data'], 'params' => $lv['params']]);
|
||||
if ($lv[0]):
|
||||
// extra functions on top of lv
|
||||
if (isset($lv[2])):
|
||||
$this->lvBrick($lv[2]);
|
||||
endif;
|
||||
|
||||
if (isset($this->lvTemplates[$lv[0]])):
|
||||
echo "new Listview(".Util::toJSON(array_merge($this->lvTemplates[$lv[0]], $lv[1])).");\n";
|
||||
else:
|
||||
// does not appear as announcement, those have already been handled at this point
|
||||
trigger_error('requested undefined listview: '.$lv[0], E_USER_ERROR);
|
||||
endif;
|
||||
elseif ($isTabbed):
|
||||
$n = $lv['params']['name'][0] == '$' ? substr($lv['params']['name'], 1) : "'".$lv['params']['name']."'";
|
||||
echo $tabVar.".add(".$n.", { id: '".$lv['params']['id']."' });\n";
|
||||
$n = $lv[1]['name'][0] == '$' ? substr($lv[1]['name'], 1) : "'".$lv[1]['name']."'";
|
||||
echo $tabVar.".add(".$n.", { id: '".$lv[1]['id']."' });\n";
|
||||
endif;
|
||||
endif;
|
||||
endforeach;
|
||||
@@ -51,10 +63,10 @@ if (!empty($this->user)):
|
||||
endif;
|
||||
elseif ($relTabs):
|
||||
?>
|
||||
new Listview({template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: <?php echo $tabVar; ?>, parent: 'lv-generic', data: lv_comments});
|
||||
new Listview({template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: <?php echo $tabVar; ?>, parent: 'lv-generic', data: lv_screenshots});
|
||||
new Listview({template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: <?=$tabVar; ?>, parent: 'lv-generic', data: lv_comments});
|
||||
new Listview({template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: <?=$tabVar; ?>, parent: 'lv-generic', data: lv_screenshots});
|
||||
if (lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))
|
||||
new Listview({template: 'video', id: 'videos', name: LANG.tab_videos, tabs: <?php echo $tabVar; ?>, parent: 'lv-generic', data: lv_videos});
|
||||
new Listview({template: 'video', id: 'videos', name: LANG.tab_videos, tabs: <?=$tabVar; ?>, parent: 'lv-generic', data: lv_videos});
|
||||
<?php
|
||||
endif;
|
||||
|
||||
|
||||
@@ -53,14 +53,14 @@ elseif (!empty($this->map['data'])):
|
||||
if (!empty($this->map['data']['zone'])):
|
||||
echo " ".(!empty($this->gPageInfo) ? "$.extend(g_pageInfo, {id: ".$this->map['data']['zone']."})" : "var g_pageInfo = {id: ".$this->map['data']['zone']."}").";\n";
|
||||
elseif (!empty($this->map['mapperData'])):
|
||||
echo " var g_mapperData = ".json_encode($this->map['mapperData'], JSON_NUMERIC_CHECK).";\n";
|
||||
echo " var g_mapperData = ".Util::toJSON($this->map['mapperData']).";\n";
|
||||
endif;
|
||||
|
||||
// dont forget to set "parent: 'mapper-generic'"
|
||||
echo " var myMapper = new Mapper(".json_encode($this->map['data'], JSON_NUMERIC_CHECK).");\n";
|
||||
echo " var myMapper = new Mapper(".Util::toJSON($this->map['data']).");\n";
|
||||
|
||||
if (isset($this->map['som'])):
|
||||
echo " new ShowOnMap(".json_encode($this->map['som'], JSON_NUMERIC_CHECK).");\n";
|
||||
echo " new ShowOnMap(".Util::toJSON($this->map['som']).");\n";
|
||||
endif;
|
||||
|
||||
if ($this->type != TYPE_ZONE):
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
<?php
|
||||
if (!empty($this->hasComContent)):
|
||||
echo " var lv_comments = ".json_encode($this->community['co'], JSON_NUMERIC_CHECK).";\n";
|
||||
echo " var lv_screenshots = ".json_encode($this->community['sc'], JSON_NUMERIC_CHECK).";\n";
|
||||
echo " var lv_videos = ".json_encode($this->community['vi'], JSON_NUMERIC_CHECK).";\n";
|
||||
echo " var lv_comments = ".Util::toJSON($this->community['co']).";\n";
|
||||
echo " var lv_screenshots = ".Util::toJSON($this->community['sc']).";\n";
|
||||
echo " var lv_videos = ".Util::toJSON($this->community['vi']).";\n";
|
||||
endif;
|
||||
|
||||
if (!empty($this->gPageInfo)):
|
||||
echo " var g_pageInfo = ".json_encode($this->gPageInfo, JSON_NUMERIC_CHECK).";\n";
|
||||
echo " var g_pageInfo = ".Util::toJSON($this->gPageInfo).";\n";
|
||||
|
||||
// only used by item.php
|
||||
if (User::$id > 0 && isset($this->redButtons[BUTTON_EQUIP]) && $this->redButtons[BUTTON_EQUIP]):
|
||||
@@ -20,7 +20,7 @@ if (!empty($this->pageTemplate)):
|
||||
echo " Locale.set(".User::$localeId.");\n";
|
||||
endif;
|
||||
|
||||
echo " PageTemplate.set(".json_encode($this->pageTemplate, JSON_NUMERIC_CHECK).");\n";
|
||||
echo " PageTemplate.set(".Util::toJSON($this->pageTemplate).");\n";
|
||||
echo " PageTemplate.init();\n";
|
||||
endif;
|
||||
|
||||
|
||||
@@ -21,15 +21,8 @@ endif;
|
||||
|
||||
// view in 3D
|
||||
if (isset($this->redButtons[BUTTON_VIEW3D])):
|
||||
if ($b = $this->redButtons[BUTTON_VIEW3D]):
|
||||
{
|
||||
// json_encode puts property names in brackets wich is not cool with inline javascript
|
||||
$data = [];
|
||||
foreach ($b as $k => $v)
|
||||
$data[] = $k.': '.json_encode($v, JSON_NUMERIC_CHECK);
|
||||
|
||||
echo '<a href="javascript:;" id="view3D-button" class="button-red" onclick="this.blur(); ModelViewer.show({'.implode(', ', $data).'})"><em><b><i>'.Lang::main('view3D').'</i></b><span>'.Lang::main('view3D').'</span></em></a>';
|
||||
}
|
||||
if ($b = $this->redButtons[BUTTON_VIEW3D]): // json_encode puts property names in brackets wich is not cool with inline javascript
|
||||
echo '<a href="javascript:;" id="view3D-button" class="button-red" onclick="this.blur(); ModelViewer.show({'.strtr(Util::toJSON($b), ['"' => '']).'})"><em><b><i>'.Lang::main('view3D').'</i></b><span>'.Lang::main('view3D').'</span></em></a>';
|
||||
else:
|
||||
echo '<a href="javascript:;" id="view3D-button" class="button-red button-red-disabled"><em><b><i>'.Lang::main('view3D').'</i></b><span>'.Lang::main('view3D').'</span></em></a>';
|
||||
endif;
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'achievement',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'achievements'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_achievements," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'holidaycal',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'calendar'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_calendar," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
us_addCharactersTab([
|
||||
{
|
||||
id:763,
|
||||
"name":"Lilywhite",
|
||||
"achievementpoints":"0",
|
||||
"guild":"whatever",
|
||||
"guildrank":"0",
|
||||
"realm":"draenor",
|
||||
"realmname":"Draenor",
|
||||
"battlegroup":"cyclone",
|
||||
"battlegroupname":"Cyclone",
|
||||
"region":"us",
|
||||
"level":"10",
|
||||
"race":"7",
|
||||
"gender":"0",
|
||||
"classs":"1",
|
||||
"faction":"0",
|
||||
"gearscore":"0",
|
||||
"talenttree1":"0",
|
||||
"talenttree2":"0",
|
||||
"talenttree3":"0",
|
||||
"talentspec":0,
|
||||
"published":1,
|
||||
"pinned":0
|
||||
}
|
||||
]);
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'classs',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'classes'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_classes," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'commentpreview',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'comments'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_comments," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
if (!empty($params['extraCols']) && strpos($params['extraCols'], '_')):
|
||||
?>
|
||||
var _ = [
|
||||
{
|
||||
id: 'reputation',
|
||||
after: 'location',
|
||||
name: LANG.rep,
|
||||
tooltip: LANG.tooltip_repgain,
|
||||
width: '8%',
|
||||
value: 'reputation'
|
||||
}
|
||||
];
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
|
||||
new Listview({
|
||||
template:'npc',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'npcs'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_npcs," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'currency',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'currencies'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_currencies," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -70,21 +70,3 @@ Listview.templates.emote = {
|
||||
return '?emote=' + emote.id;
|
||||
}
|
||||
}
|
||||
|
||||
new Listview({
|
||||
template:'emote',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'emote'," : null;
|
||||
echo !isset($params['name']) ? "name:'".Util::ucFirst(Lang::game('emotes'))."'," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
|
||||
@@ -138,21 +138,3 @@ Listview.templates.enchantment = {
|
||||
return '?enchantment=' + enchantment.id;
|
||||
}
|
||||
}
|
||||
|
||||
new Listview({
|
||||
template:'enchantment',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'enchantment'," : null;
|
||||
echo !isset($params['name']) ? "name:'".Util::ucFirst(Lang::game('enchantments'))."'," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'holiday',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'holidays'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_holidays," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'faction',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'factions'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_factions," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,18 +0,0 @@
|
||||
new Listview({
|
||||
template:'genericmodel',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'same-model-as'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_samemodelas," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
/* genericlinktype: 'item|object', */
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,6 +1,3 @@
|
||||
<?php
|
||||
if (!empty($params['extraCols']) && strpos($params['extraCols'], '_')):
|
||||
?>
|
||||
var _ = [
|
||||
{
|
||||
id: 'standing',
|
||||
@@ -20,28 +17,7 @@ var _ = [
|
||||
}
|
||||
];
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
|
||||
new Listview({
|
||||
template:'item',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'items'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_items," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
|
||||
<?php
|
||||
// 4.3 loot-example
|
||||
|
||||
// template: 'item',
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'itemset',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'itemsets'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_itemsets," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'model',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'gallery'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_gallery," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
10
template/listviews/npcRepCol.tpl.php
Normal file
10
template/listviews/npcRepCol.tpl.php
Normal file
@@ -0,0 +1,10 @@
|
||||
var _ = [
|
||||
{
|
||||
id: 'reputation',
|
||||
after: 'location',
|
||||
name: LANG.rep,
|
||||
tooltip: LANG.tooltip_repgain,
|
||||
width: '8%',
|
||||
value: 'reputation'
|
||||
}
|
||||
];
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'object',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'objects'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_objects," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,36 +0,0 @@
|
||||
var _ = function(family)
|
||||
{
|
||||
family.foodCount = 0;
|
||||
for (var food in g_pet_foods)
|
||||
{
|
||||
if( family.diet & food)
|
||||
family.foodCount++;
|
||||
}
|
||||
|
||||
family.spellCount = 0;
|
||||
|
||||
for (var i = 0, len = family.spells.length; i < len; ++i)
|
||||
{
|
||||
if (family.spells[i])
|
||||
family.spellCount++;
|
||||
}
|
||||
};
|
||||
|
||||
new Listview({
|
||||
template:'pet',
|
||||
computeDataFunc: _,
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'hunter-pets'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_pets," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
17
template/listviews/petFoodCol.tpl.php
Normal file
17
template/listviews/petFoodCol.tpl.php
Normal file
@@ -0,0 +1,17 @@
|
||||
var _ = function(family)
|
||||
{
|
||||
family.foodCount = 0;
|
||||
for (var food in g_pet_foods)
|
||||
{
|
||||
if( family.diet & food)
|
||||
family.foodCount++;
|
||||
}
|
||||
|
||||
family.spellCount = 0;
|
||||
|
||||
for (var i = 0, len = family.spells.length; i < len; ++i)
|
||||
{
|
||||
if (family.spells[i])
|
||||
family.spellCount++;
|
||||
}
|
||||
};
|
||||
@@ -1,21 +1,3 @@
|
||||
new Listview({
|
||||
template:'profile',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'profiles'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_profiles," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
|
||||
<?php
|
||||
Util::addNote(U_GROUP_NONE, 'Profile-listview NYI');
|
||||
/* data:
|
||||
@@ -56,3 +38,4 @@ new Listview({
|
||||
region:'{$curr.region|escape:"javascript"}'
|
||||
}
|
||||
*/
|
||||
?>
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
if (!empty($params['extraCols']) && strpos($params['extraCols'], '_')):
|
||||
?>
|
||||
var _ = [
|
||||
{
|
||||
id: 'reputation',
|
||||
after: 'rewards',
|
||||
name: LANG.rep,
|
||||
tooltip: LANG.tooltip_repgain,
|
||||
width: '8%',
|
||||
value: 'reputation'
|
||||
}
|
||||
];
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
|
||||
new Listview({
|
||||
template:'quest',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'quests'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_quests," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
10
template/listviews/questRepCol.tpl.php
Normal file
10
template/listviews/questRepCol.tpl.php
Normal file
@@ -0,0 +1,10 @@
|
||||
var _ = [
|
||||
{
|
||||
id: 'reputation',
|
||||
after: 'rewards',
|
||||
name: LANG.rep,
|
||||
tooltip: LANG.tooltip_repgain,
|
||||
width: '8%',
|
||||
value: 'reputation'
|
||||
}
|
||||
];
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'race',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'races'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_races," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'replypreview',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'comment-replies'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_commentreplies," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'reputationhistory',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'reputation'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_reputation," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'screenshot',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'screenshots'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_screenshots," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'skill',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'skills'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_skills," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'spell',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'spells'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_spells," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'title',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'titles'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_titles," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,16 +0,0 @@
|
||||
new Listview({
|
||||
template:'video',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'videos'," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
new Listview({
|
||||
template:'zone',
|
||||
<?php
|
||||
echo !isset($params['id']) ? "id:'zones'," : null;
|
||||
echo !isset($params['name']) ? "name:LANG.tab_zones," : null;
|
||||
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
|
||||
|
||||
foreach ($params as $k => $v):
|
||||
if ($v[0] == '$'):
|
||||
echo $k.':'.substr($v, 1).',';
|
||||
elseif ($v):
|
||||
echo $k.":'".$v."',";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
|
||||
});
|
||||
@@ -10,7 +10,7 @@ $this->brick('announcement');
|
||||
$this->brick('pageTemplate');
|
||||
?>
|
||||
<div class="text">
|
||||
<h1><?php echo $this->name; ?></h1>
|
||||
<h1><?=$this->name; ?></h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
@@ -40,7 +40,7 @@ endforeach;
|
||||
<thead><tr><th style="width:135px;"><div>Menu</div></th><th style="width:400px;">Pages</th><th>Screenshots: <span id="screenshotTotal"></span></th></tr></thead>
|
||||
<tbody><tr>
|
||||
<td id="menu-container" style="vertical-align: top;">
|
||||
<div id="show-all-pages"><?php echo $this->ssNFound ? ' – <a href="?admin=screenshots&all">Show All</a> ('.$this->ssNFound.')' : null; ?></div>
|
||||
<div id="show-all-pages"><?=($this->ssNFound ? ' – <a href="?admin=screenshots&all">Show All</a> ('.$this->ssNFound.')' : null); ?></div>
|
||||
<h4>Mass Select</h4>
|
||||
– <a href="#" onClick="ssm_MassSelect(1);">Select All</a><br>
|
||||
– <a href="#" onClick="ssm_MassSelect(0);">Deselect All</a><br>
|
||||
@@ -122,10 +122,10 @@ if ($this->getAll):
|
||||
echo " var ss_getAll = true;\n";
|
||||
endif;
|
||||
if ($this->ssPages):
|
||||
echo " var ssm_screenshotPages = ".json_encode($this->ssPages, JSON_NUMERIC_CHECK).";\n";
|
||||
echo " var ssm_screenshotPages = ".Util::toJSON($this->ssPages).";\n";
|
||||
echo " ssm_UpdatePages();\n";
|
||||
elseif ($this->ssData):
|
||||
echo " var ssm_screenshotData = ".json_encode($this->ssData, JSON_NUMERIC_CHECK).";\n";
|
||||
echo " var ssm_screenshotData = ".Util::toJSON($this->ssData).";\n";
|
||||
echo " ssm_UpdateList();\n";
|
||||
endif;
|
||||
?>
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
<div id="compare-generic"></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
<?php
|
||||
foreach ($this->cmpItems as $item):
|
||||
echo ' g_items.add('.$item[0].', {name_'.User::$localeString.':\''.Util::jsEscape($item[1]).'\', quality:'.$item[2].', icon:\''.$item[3].'\', jsonequip:'.json_encode($item[4], JSON_NUMERIC_CHECK)."});\n";
|
||||
foreach ($this->cmpItems as $iId => $iData):
|
||||
echo ' g_items.add('.$iId.', '.Util::toJSON($iData).");\n";
|
||||
endforeach;
|
||||
?>
|
||||
new Summary({template:'compare',id:'compare',parent:'compare-generic',groups:<?php echo json_encode($this->summary, JSON_NUMERIC_CHECK); ?>});
|
||||
new Summary(<?=Util::toJSON($this->summary); ?>);
|
||||
//]]></script>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ endif;
|
||||
echo $this->writeGlobalVars();
|
||||
|
||||
if ($this->news):
|
||||
echo " Markup.printHtml(".json_encode($this->news['text']).", 'news-generic', { allow: Markup.CLASS_ADMIN });\n";
|
||||
echo " Markup.printHtml(".Util::toJSON($this->news['text']).", 'news-generic', { allow: Markup.CLASS_ADMIN });\n";
|
||||
endif;
|
||||
?>
|
||||
//]]></script>
|
||||
|
||||
@@ -28,24 +28,26 @@ echo $this->description;
|
||||
?>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
<?php
|
||||
foreach ($this->pieces as $p):
|
||||
echo " g_items.add(".$p['id'].", {name_".User::$localeString.":'".Util::jsEscape($p['name'])."', quality:".$p['quality'].", icon:'".$p['icon']."', jsonequip:".json_encode($p['json'])."});\n";
|
||||
foreach ($this->pieces as $iId => $piece):
|
||||
echo " g_items.add(".$iId.", ".Util::toJSON($piece).");\n";
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
|
||||
<table class="iconlist">
|
||||
<?php
|
||||
foreach ($this->pieces as $i => $p):
|
||||
echo ' <tr><th align="right" id="iconlist-icon'.($i + 1).'"></th><td><span class="q'.$p['quality'].'"><a href="?item='.$p['id'].'">'.$p['name']."</a></span></td></tr>\n";
|
||||
$idx = 0;
|
||||
foreach ($this->pieces as $iId => $piece):
|
||||
echo ' <tr><th align="right" id="iconlist-icon'.(++$idx).'"></th><td><span class="q'.$piece['quality'].'"><a href="?item='.$iId.'">'.$piece['name_'.User::$localeString]."</a></span></td></tr>\n";
|
||||
endforeach;
|
||||
?>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
<?php
|
||||
foreach ($this->pieces as $i => $p):
|
||||
echo " \$WH.ge('iconlist-icon".($i + 1)."').appendChild(g_items.createIcon(".$p['id'].", 0, 0));\n";
|
||||
$idx = 0;
|
||||
foreach ($this->pieces as $iId => $__):
|
||||
echo " \$WH.ge('iconlist-icon".(++$idx)."').appendChild(g_items.createIcon(".$iId.", 0, 0));\n";
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
@@ -54,12 +56,12 @@ endforeach;
|
||||
if ($this->unavailable):
|
||||
?>
|
||||
<div class="pad"></div>
|
||||
<b style="color: red"><?php echo Lang::itemset('_unavailable'); ?></b>
|
||||
<b style="color: red"><?=Lang::itemset('_unavailable'); ?></b>
|
||||
<?php endif; ?>
|
||||
|
||||
<h3><?php echo Lang::itemset('_setBonuses').$this->bonusExt; ?></h3>
|
||||
<h3><?=Lang::itemset('_setBonuses').$this->bonusExt; ?></h3>
|
||||
|
||||
<?php echo " ".Lang::itemset('_conveyBonus')."\n"; ?>
|
||||
<?=" ".Lang::itemset('_conveyBonus')."\n"; ?>
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($this->spells as $i => $s):
|
||||
@@ -68,14 +70,14 @@ endforeach;
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<h2 class="clear"><?php echo Lang::itemset('summary'); ?></h2>
|
||||
<h2 class="clear"><?=Lang::itemset('summary'); ?></h2>
|
||||
|
||||
<div id="summary-generic"></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
new Summary({ id: 'itemset', template: 'itemset', parent: 'summary-generic', groups: <?php echo json_encode($this->compare['items'], JSON_NUMERIC_CHECK).', level: '.$this->compare['level']; ?>});
|
||||
new Summary(<?=Util::toJSON($this->summary); ?>);
|
||||
//]]></script>
|
||||
|
||||
<h2 class="clear"><?php echo Lang::main('related'); ?></h2>
|
||||
<h2 class="clear"><?=Lang::main('related'); ?></h2>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -13,27 +13,27 @@ $this->brick('infobox');
|
||||
|
||||
?>
|
||||
<div class="text">
|
||||
<h1><?php echo $this->name; ?></h1>
|
||||
<h1><?=$this->name; ?></h1>
|
||||
|
||||
<span><?php echo Lang::screenshot('cropHint'); ?></span>
|
||||
<span><?=Lang::screenshot('cropHint'); ?></span>
|
||||
<div class="pad"></div>
|
||||
<div id="ss-container"></div><script type="text/javascript">//<![CDATA[
|
||||
var myCropper = new Cropper(<?php echo json_encode($this->cropper, JSON_NUMERIC_CHECK); ?>);
|
||||
var myCropper = new Cropper(<?=Util::toJSON($this->cropper); ?>);
|
||||
//]]></script>
|
||||
|
||||
<div class="pad"></div>
|
||||
<button style="margin:4px 0 0 5px" onclick="myCropper.selectAll()"><?php echo Lang::screenshot('selectAll'); ?></button>
|
||||
<button style="margin:4px 0 0 5px" onclick="myCropper.selectAll()"><?=Lang::screenshot('selectAll'); ?></button>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="pad3"></div>
|
||||
|
||||
<form action="?screenshot=complete&<?php echo $this->destType.'.'.$this->destTypeId.'.'.$this->imgHash; ?>" method="post" onsubmit="this.elements['coords'].value = myCropper.getCoords()">
|
||||
<?php echo Lang::screenshot('caption').Lang::main('colon'); ?><input type="text" name="screenshotalt" style="width: 55%" maxlength="200" /> <small> <?php echo Lang::screenshot('charLimit'); ?></small><br />
|
||||
<form action="?screenshot=complete&<?=$this->destType.'.'.$this->destTypeId.'.'.$this->imgHash; ?>" method="post" onsubmit="this.elements['coords'].value = myCropper.getCoords()">
|
||||
<?=Lang::screenshot('caption').Lang::main('colon'); ?><input type="text" name="screenshotalt" style="width: 55%" maxlength="200" /> <small> <?=Lang::screenshot('charLimit'); ?></small><br />
|
||||
<div class="pad"></div>
|
||||
|
||||
<?php $this->localizedBrick('ssReminder', User::$localeId); ?>
|
||||
|
||||
<input type="submit" value="<?php echo Lang::main('submit'); ?>" />
|
||||
<input type="submit" value="<?=Lang::main('submit'); ?>" />
|
||||
<input type="hidden" name="coords" />
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user