- BaseType: skip empty arrays in condition

- BaseFilter: defined selectAll / selectNone magic numbers
- Item:
   * fixed formating error for required arena rating
   * filters for purchasablewith -item; -currency; -honor; -arena; reqarenarating
- Zone:
   * removed extra escape for globals
   * token changes to ZoneList... still not really usable
- Events: prevent selecting arbitrary related events on empty list
- Factions:
   * added filter-links to relTabs
   * added relTab for factionspecific GameObjects
- Spell:
   * parse information for aura:forceReaction
   * added relTab Zones to display info from spell_area
- JS:
   * added display of subzones to listview-template: zone
   * reworked condition to display multiple conditions
   * added race and gender conditions

typos.. they are never entirely gone
This commit is contained in:
Sarjuuk
2014-04-20 11:59:47 +02:00
parent d34838ea2c
commit 48cec63e1d
22 changed files with 552 additions and 198 deletions

View File

@@ -239,7 +239,7 @@ class AjaxHandler
*/ */
private function handleComment() private function handleComment()
{ {
switch ($this->param[0]) switch ($this->params[0])
{ {
case 'rating': case 'rating':
return '{"success":true,"error":"","up":7,"down":9}'; return '{"success":true,"error":"","up":7,"down":9}';
@@ -252,7 +252,7 @@ class AjaxHandler
private function handleLocale() // not sure if this should be here.. private function handleLocale() // not sure if this should be here..
{ {
User::setLocale($this->param[0]); User::setLocale($this->params[0]);
User::writeCookie(); User::writeCookie();
header('Location: '.(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '.')); header('Location: '.(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '.'));
} }

View File

@@ -106,6 +106,9 @@ define('FILTER_CR_STRING', 4);
define('FILTER_CR_ENUM', 5); define('FILTER_CR_ENUM', 5);
define('FILTER_CR_STAFFFLAG', 6); define('FILTER_CR_STAFFFLAG', 6);
define('FILTER_ENUM_ANY', -2323);
define('FILTER_ENUM_NONE', -2324);
// conditional information in template // conditional information in template
define('GLOBALINFO_SELF', 0x1); // id, name, icon define('GLOBALINFO_SELF', 0x1); // id, name, icon
define('GLOBALINFO_RELATED', 0x2); // spells used by pet, classes/races required by spell, ect define('GLOBALINFO_RELATED', 0x2); // spells used by pet, classes/races required by spell, ect

View File

@@ -256,8 +256,8 @@ class AchievementListFilter extends Filter
141 => 156, // Feast of Winter Veil 141 => 156, // Feast of Winter Veil
409 => -3456, // Day of the Dead 409 => -3456, // Day of the Dead
398 => -3457, // Pirates' Day 398 => -3457, // Pirates' Day
-2323 => true, FILTER_ENUM_ANY => true,
-2324 => false, FILTER_ENUM_NONE => false,
283 => -1, // valid events without achievements 283 => -1, // valid events without achievements
285 => -1, 353 => -1, 420 => -1, 285 => -1, 353 => -1, 420 => -1,
400 => -1, 284 => -1, 374 => -1, 400 => -1, 284 => -1, 374 => -1,

View File

@@ -152,7 +152,7 @@ abstract class BaseType
else else
return null; return null;
if (is_array($c[1])) if (is_array($c[1]) && !empty($c[1]))
{ {
array_walk($c[1], function(&$item, $key) { array_walk($c[1], function(&$item, $key) {
$item = Util::checkNumeric($item) ? $item : DB::Aowow()->escape($item); $item = Util::checkNumeric($item) ? $item : DB::Aowow()->escape($item);
@@ -897,9 +897,9 @@ abstract class Filter
{ {
if (is_bool($value)) if (is_bool($value))
return [$field, 0, ($value ? '>' : '<=')]; return [$field, 0, ($value ? '>' : '<=')];
else if ($value == -2323) // any else if ($value == FILTER_ENUM_ANY) // any
return [$field, 0, '>']; return [$field, 0, '>'];
else if ($value == -2324) // none else if ($value == FILTER_ENUM_NONE) // none
return [$field, 0, '<=']; return [$field, 0, '<='];
else if ($value !== null) else if ($value !== null)
return [$field, $value]; return [$field, $value];

View File

@@ -175,9 +175,9 @@ class ItemList extends BaseType
$tok = @$filter[TYPE_ITEM]; $tok = @$filter[TYPE_ITEM];
$cur = @$filter[TYPE_CURRENCY]; $cur = @$filter[TYPE_CURRENCY];
$reqRating = -1; foreach ($result as $itemId => &$data)
foreach ($result as $itemId => $data)
{ {
$reqRating = 0;
foreach ($data as $npcId => $costs) foreach ($data as $npcId => $costs)
{ {
if ($tok || $cur) // bought with specific token or currency if ($tok || $cur) // bought with specific token or currency
@@ -197,12 +197,15 @@ class ItemList extends BaseType
} }
// reqRating ins't really a cost .. so pass it by ref instead of return // reqRating ins't really a cost .. so pass it by ref instead of return
// use lowest total value // use highest total value
// note: how to distinguish between brackets .. or team/pers-rating? // note: how to distinguish between brackets .. or team/pers-rating?
if (isset($data[$npcId]) && ($reqRating > $costs['reqRtg'] || $reqRating < 0 )) if (isset($data[$npcId]) && ($reqRating < $costs['reqRtg']))
$reqRating = $costs['reqRtg']; $reqRating = $costs['reqRtg'];
} }
if ($reqRating)
$data['reqRating'] = $reqRating;
if (empty($data)) if (empty($data))
unset($result[$itemId]); unset($result[$itemId]);
} }
@@ -298,6 +301,9 @@ class ItemList extends BaseType
if ($tokens) if ($tokens)
$data[$this->id]['cost'][] = $tokens; $data[$this->id]['cost'][] = $tokens;
if ($_ = @$this->getExtendedCost($miscData)[$this->id]['reqRating'])
$data[$this->id]['reqarenartng'] = $_;
} }
if ($x = $this->curTpl['buyPrice']) if ($x = $this->curTpl['buyPrice'])
@@ -737,7 +743,7 @@ class ItemList extends BaseType
// required arena team rating / personal rating / todo (low): sort out what kind of rating // required arena team rating / personal rating / todo (low): sort out what kind of rating
if (@$this->getExtendedCost([], $reqRating)[$this->id] && $reqRating) if (@$this->getExtendedCost([], $reqRating)[$this->id] && $reqRating)
$x .= sprintf(Lang::$item['reqRating'], $reqRating); $x .= sprintf(Lang::$item['reqRating'], $reqRating).'<br />';
// item level // item level
if (in_array($_class, [ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON])) if (in_array($_class, [ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON]))
@@ -1405,6 +1411,9 @@ class ItemList extends BaseType
class ItemListFilter extends Filter class ItemListFilter extends Filter
{ {
private $ubFilter = []; // usable-by - limit weapon/armor selection per CharClass - itemClass => available itemsubclasses private $ubFilter = []; // usable-by - limit weapon/armor selection per CharClass - itemClass => available itemsubclasses
private $extCostQuery = 'SELECT item FROM npc_vendor nv JOIN ?_itemExtendedCost iec ON iec.id = nv.extendedCost WHERE %s UNION
SELECT item FROM game_event_npc_vendor genv JOIN ?_itemExtendedCost iec ON iec.id = genv.extendedCost WHERE %1$s';
public $extraOpts = []; // score for statWeights public $extraOpts = []; // score for statWeights
public $wtCnd = []; public $wtCnd = [];
protected $enums = array( protected $enums = array(
@@ -1433,6 +1442,19 @@ class ItemListFilter extends Filter
), ),
153 => array( // race-specific 153 => array( // race-specific
null, 1, 2, 3, 4, 5, 6, 7, 8, null, 10, 11, true, false null, 1, 2, 3, 4, 5, 6, 7, 8, null, 10, 11, true, false
),
158 => array( // currency
32572, 32569, 29736, 44128, 20560, 20559, 29434, 37829, 23247, 44990, 24368, 52027, 52030, 43016, 41596, 34052, 45624, 49426, 40752, 47241, 40753, 29024,
24245, 26045, 26044, 38425, 29735, 24579, 24581, 32897, 22484, 52026, 52029, 4291, 28558, 43228, 34664, 47242, 52025, 52028, 37836, 20558, 34597, 43589
),
118 => array( // tokens
34853, 34854, 34855, 34856, 34857, 34858, 34848, 34851, 34852, 40625, 40626, 40627, 45632, 45633, 45634, 34169, 34186, 29754, 29753, 29755, 31089, 31091, 31090,
40610, 40611, 40612, 30236, 30237, 30238, 45635, 45636, 45637, 34245, 34332, 34339, 34345, 40631, 40632, 40633, 45638, 45639, 45640, 34244, 34208, 34180, 34229,
34350, 40628, 40629, 40630, 45641, 45642, 45643, 29757, 29758, 29756, 31092, 31094, 31093, 40613, 40614, 40615, 30239, 30240, 30241, 45644, 45645, 45646, 34342,
34211, 34243, 29760, 29761, 29759, 31097, 31095, 31096, 40616, 40617, 40618, 30242, 30243, 30244, 45647, 45648, 45649, 34216, 29766, 29767, 29765, 31098, 31100,
31099, 40619, 40620, 40621, 30245, 30246, 30247, 45650, 45651, 45652, 34167, 40634, 40635, 40636, 45653, 45654, 45655, 40637, 40638, 40639, 45656, 45657, 45658,
34170, 34192, 29763, 29764, 29762, 31101, 31103, 31102, 30248, 30249, 30250, 47557, 47558, 47559, 34233, 34234, 34202, 34195, 34209, 40622, 40623, 40624, 34193,
45659, 45660, 45661, 34212, 34351, 34215
) )
); );
// cr => [type, field, misc, extraCol] // cr => [type, field, misc, extraCol]
@@ -1696,12 +1718,13 @@ class ItemListFilter extends Filter
return ['randomEnchant', $randIds]; return ['randomEnchant', $randIds];
else else
return [0]; // no results aren't really input errors return [0]; // no results aren't really input errors
case 125: // reqarenartng [op] [int] JOIN npc_vendor, game_event_npc_vendor, itemextendedcost.dbc case 125: // reqarenartng [op] [int] todo (low): find out, why "IN (W, X, Y) AND IN (X, Y, Z)" doesn't result in "(X, Y)"
if (!$this->isSaneNumeric($cr[2])) if (!$this->isSaneNumeric($cr[2]) || !$this->int2Op($cr[1]))
break; break;
$this->formData['extraCols'][] = $cr[0]; $this->formData['extraCols'][] = $cr[0];
/* todo */ return [1]; $query = sprintf($this->extCostQuery, 'iec.reqPersonalrating '.$cr[1].' '.$cr[2]);
return ['id', DB::Aowow()->selectCol($query)];
case 160: // relatedevent [enum] like 169 .. crawl though npc_vendor and loot_templates of event-related spawns case 160: // relatedevent [enum] like 169 .. crawl though npc_vendor and loot_templates of event-related spawns
/* todo */ return [1]; /* todo */ return [1];
case 152: // classspecific [enum] case 152: // classspecific [enum]
@@ -1783,14 +1806,36 @@ class ItemListFilter extends Filter
/* todo */ return [1]; /* todo */ return [1];
case 76: // otskinning [yn] case 76: // otskinning [yn]
/* todo */ return [1]; /* todo */ return [1];
case 158: // purchasablewithcurrency [currency-any] case 158: // purchasablewithcurrency [enum]
/* todo */ return [1]; case 118: // purchasablewithitem [enum]
case 118: // purchasablewithitem [itemcurrency-any] if (in_array($cr[1], $this->enums[$cr[0]]))
/* todo */ return [1]; $_ = (array)$cr[1];
else if ($cr[1] == FILTER_ENUM_ANY)
$_ = $this->enums[$cr[0]];
else
break;
$query = sprintf($this->extCostQuery, 'iec.reqItemId1 IN (?a) OR iec.reqItemId2 IN (?a) OR iec.reqItemId3 IN (?a) OR iec.reqItemId4 IN (?a) OR iec.reqItemId5 IN (?a)');
if ($foo = DB::Aowow()->selectCol($query, $_, $_, $_, $_, $_, $_, $_, $_, $_, $_))
return ['id', $foo];
break;
case 144: // purchasablewithhonor [yn] case 144: // purchasablewithhonor [yn]
/* todo */ return [1]; if ($this->int2Bool($cr[1]))
{
$query = sprintf($this->extCostQuery, 'iec.reqHonorPoints > 0');
if ($foo = DB::Aowow()->selectCol($query))
return ['id', $foo, $cr[1] ? null : '!'];
}
break;
case 145: // purchasablewitharena [yn] case 145: // purchasablewitharena [yn]
/* todo */ return [1]; if ($this->int2Bool($cr[1]))
{
$query = sprintf($this->extCostQuery, 'iec.reqArenaPoints > 0');
if ($foo = DB::Aowow()->selectCol($query))
return ['id', $foo, $cr[1] ? null : '!'];
}
break;
case 18: // rewardedbyfactionquest [side] case 18: // rewardedbyfactionquest [side]
/* todo */ return [1]; /* todo */ return [1];
case 126: // rewardedbyquestin [zone-any] case 126: // rewardedbyquestin [zone-any]

View File

@@ -500,9 +500,9 @@ class QuestListFilter extends Filter
$_ = intVal($cr[1]); $_ = intVal($cr[1]);
if ($_ > 0) if ($_ > 0)
return ['OR', ['reqFactionId1', $_], ['reqFactionId2', $_]]; return ['OR', ['reqFactionId1', $_], ['reqFactionId2', $_]];
else if ($cr[1] == -2323) // any else if ($cr[1] == FILTER_ENUM_ANY) // any
return ['OR', ['reqFactionId1', 0, '>'], ['reqFactionId2', 0, '>']]; return ['OR', ['reqFactionId1', 0, '>'], ['reqFactionId2', 0, '>']];
else if ($cr[1] == -2324) // none else if ($cr[1] == FILTER_ENUM_NONE) // none
return ['AND', ['reqFactionId1', 0], ['reqFactionId2', 0]]; return ['AND', ['reqFactionId1', 0], ['reqFactionId2', 0]];
break; break;

View File

@@ -134,7 +134,7 @@ visibleCols: ['heroiclevel', 'players']
public function addGlobalsToJScript($addMask = 0) public function addGlobalsToJScript($addMask = 0)
{ {
foreach ($this->iterate() as $__) foreach ($this->iterate() as $__)
Util::$pageTemplate->extendGlobalData(self::$type, [$this->id => ['name' => Util::jsEscape($this->getField('name', true))]]); Util::$pageTemplate->extendGlobalData(self::$type, [$this->id => ['name' => $this->getField('name', true)]]);
} }
public function renderTooltip() { } public function renderTooltip() { }

View File

@@ -659,7 +659,7 @@ $lang = array(
'_unavailable' => "This item is not available to players.", '_unavailable' => "This item is not available to players.",
'_rndEnchants' => "Random Enchantments", '_rndEnchants' => "Random Enchantments",
'_chance' => "(%s%% chance)", '_chance' => "(%s%% chance)",
'reqRating' => "Requires personal and team arena rating of %d<br />in 3v3 or 5v5 brackets", 'reqRating' => "Requires personal and team arena rating of %d in 3v3 or 5v5 brackets",
'slot' => "Slot", 'slot' => "Slot",
'_quality' => "Quality", '_quality' => "Quality",
'usableBy' => "Usable by", 'usableBy' => "Usable by",

View File

@@ -627,7 +627,7 @@ $lang = array(
'_unavailable' => "Este objeto no está disponible para los jugadores.", '_unavailable' => "Este objeto no está disponible para los jugadores.",
'_rndEnchants' => "Enchantements aléatoires", '_rndEnchants' => "Enchantements aléatoires",
'_chance' => "(%s%% de chance)", '_chance' => "(%s%% de chance)",
'reqRating' => "Nécessite une cote d'arène personnelle et en équipe de %d<br />en arène de 3c3 ou 5c5.", 'reqRating' => "Nécessite une cote d'arène personnelle et en équipe de %d en arène de 3c3 ou 5c5.",
'slot' => "Emplacement", 'slot' => "Emplacement",
'_quality' => "Qualité", '_quality' => "Qualité",
'usableBy' => "Utilisable par", 'usableBy' => "Utilisable par",

View File

@@ -115,7 +115,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$holidays[$_] = 0; // applied as back ref. $holidays[$_] = 0; // applied as back ref.
$row['condition'] = array( $row['condition'][] = array(
'type' => TYPE_WORLDEVENT, 'type' => TYPE_WORLDEVENT,
'typeId' => &$holidays[$_], 'typeId' => &$holidays[$_],
'status' => 1 'status' => 1
@@ -194,7 +194,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
else else
{ {
$n = in_array($_id, [42, 61, 81, 241, 121, 122, 123, 125, 126, 161, 201, 101, 102, 221, 301, 341]) ? '?items&filter=cr=158;crs='.$currency->getField('itemId').';crv=0' : null; $n = in_array($_id, [42, 61, 81, 241, 121, 122, 123, 125, 126, 161, 201, 101, 102, 221, 301, 341]) ? '?items&filter=cr=158;crs='.$_itemId.';crv=0' : null;
$w = 'iec.reqItemId1 = '.$_itemId.' OR iec.reqItemId2 = '.$_itemId.' OR iec.reqItemId3 = '.$_itemId.' OR iec.reqItemId4 = '.$_itemId.' OR iec.reqItemId5 = '.$_itemId; $w = 'iec.reqItemId1 = '.$_itemId.' OR iec.reqItemId2 = '.$_itemId.' OR iec.reqItemId3 = '.$_itemId.' OR iec.reqItemId4 = '.$_itemId.' OR iec.reqItemId5 = '.$_itemId;
} }

View File

@@ -223,16 +223,18 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
// tab: see also (event conditions) // tab: see also (event conditions)
if($rel = DB::Aowow()->selectCol('SELECT IF(eventEntry = prerequisite_event, NULL, IF(eventEntry = ?d, -prerequisite_event, eventEntry)) FROM game_event_prerequisite WHERE prerequisite_event = ?d OR eventEntry = ?d', $_eId, $_eId, $_eId)) if ($rel = DB::Aowow()->selectCol('SELECT IF(eventEntry = prerequisite_event, NULL, IF(eventEntry = ?d, -prerequisite_event, eventEntry)) FROM game_event_prerequisite WHERE prerequisite_event = ?d OR eventEntry = ?d', $_eId, $_eId, $_eId))
{ {
$list = []; $list = [];
array_walk($rel, function(&$v, $k) use (&$list) { array_walk($rel, function(&$v, $k) use (&$list) {
if ($v > 0) if ($v > 0)
$list[] = $v; $list[] = $v;
else if ($v == null) else if ($v === null)
Util::$pageTemplate->internalNotice(U_GROUP_EMPLOYEE, 'game_event_prerequisite: this event has itself as prerequisite'); Util::$pageTemplate->internalNotice(U_GROUP_EMPLOYEE, 'game_event_prerequisite: this event has itself as prerequisite');
}); });
if ($list)
{
$relEvents = new WorldEventList(array(['id', $list])); $relEvents = new WorldEventList(array(['id', $list]));
$relEvents->addGlobalsToJscript(); $relEvents->addGlobalsToJscript();
$relData = $relEvents->getListviewData(true); $relData = $relEvents->getListviewData(true);
@@ -240,7 +242,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$relData[$id]['condition'] = array( $relData[$id]['condition'] = array(
'type' => TYPE_WORLDEVENT, 'type' => TYPE_WORLDEVENT,
'typeId' => -$eId, 'typeId' => -$_eId,
'status' => 2 'status' => 2
); );
} }
@@ -254,7 +256,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
Util::$pageTemplate->extendGlobalIds(TYPE_WORLDEVENT, -$r); Util::$pageTemplate->extendGlobalIds(TYPE_WORLDEVENT, -$r);
$d = $event->getListviewData(true); $d = $event->getListviewData(true);
$d[-$eId]['condition'] = array( $d[-$_eId]['condition'][] = array(
'type' => TYPE_WORLDEVENT, 'type' => TYPE_WORLDEVENT,
'typeId' => $r, 'typeId' => $r,
'status' => 2 'status' => 2
@@ -275,6 +277,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
) )
); );
} }
}
$smarty->saveCache($cacheKeyPage, $pageData); $smarty->saveCache($cacheKeyPage, $pageData);

View File

@@ -148,17 +148,21 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$items->addGlobalsToJScript(GLOBALINFO_SELF); $items->addGlobalsToJScript(GLOBALINFO_SELF);
$pageData['relTabs'][] = array( $tab = array(
'file' => 'item', 'file' => 'item',
'data' => $items->getListviewData(), 'data' => $items->getListviewData(),
'showRep' => true, 'showRep' => true,
'params' => array( 'params' => array(
'tabs' => '$tabsRelated', 'tabs' => '$tabsRelated',
'extraCols' => '$_', 'extraCols' => '$_',
'sort' => "$['standing', 'name']", 'sort' => "$['standing', 'name']"
'note' => sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$_id.';crv=0')
) )
); );
if ($items->getMatches() > CFG_SQL_LIMIT_DEFAULT)
$tab['params']['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$_id.';crv=0');
$pageData['relTabs'][] = $tab;
} }
// tab: creatures with onKill reputation // tab: creatures with onKill reputation
@@ -178,7 +182,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$killCreatures->addGlobalsToJscript(); $killCreatures->addGlobalsToJscript();
$pageData['relTabs'][] = array( $tab = array(
'file' => 'creature', 'file' => 'creature',
'data' => $killCreatures->getListviewData(), 'data' => $killCreatures->getListviewData(),
'showRep' => true, 'showRep' => true,
@@ -186,6 +190,11 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'tabs' => '$tabsRelated', 'tabs' => '$tabsRelated',
) )
); );
if ($killCreatures->getMatches() > CFG_SQL_LIMIT_DEFAULT)
$tab['params']['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=42;crs='.$_id.';crv=0');
$pageData['relTabs'][] = $tab;
} }
} }
} }
@@ -198,13 +207,34 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$members->addGlobalsToJscript(); $members->addGlobalsToJscript();
$pageData['relTabs'][] = array( $tab = array(
'file' => 'creature', 'file' => 'creature',
'data' => $members->getListviewData(), 'data' => $members->getListviewData(),
'showRep' => true, 'showRep' => true,
'params' => array( 'params' => array(
'id' => 'member', 'id' => 'member',
'name' => '$LANG.tab_members', 'name' => '$LANG.tab_members',
'tabs' => '$tabsRelated'
)
);
if ($members->getMatches() > CFG_SQL_LIMIT_DEFAULT)
$tab['params']['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=3;crs='.$_id.';crv=0');
$pageData['relTabs'][] = $tab;
}
}
// tab: objects
if ($_ = $faction->getField('templateIds'))
{
$objects = new GameObjectList(array(['faction', $_]));
if (!$objects->error)
{
$pageData['relTabs'][] = array(
'file' => 'object',
'data' => $objects->getListviewData(),
'params' => array(
'tabs' => '$tabsRelated', 'tabs' => '$tabsRelated',
) )
); );
@@ -225,16 +255,20 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$quests->addGlobalsToJScript(GLOBALINFO_ANY); $quests->addGlobalsToJScript(GLOBALINFO_ANY);
$pageData['relTabs'][] = array( $tab = array(
'file' => 'quest', 'file' => 'quest',
'data' => $quests->getListviewData($_id), 'data' => $quests->getListviewData($_id),
'showRep' => true, 'showRep' => true,
'params' => array( 'params' => array(
'tabs' => '$tabsRelated', 'tabs' => '$tabsRelated',
'extraCols' => '$_', 'extraCols' => '$_'
'note' => sprintf(Util::$filterResultString, '?quests?filter=cr=1;crs='.$_id.';crv=0')
) )
); );
if ($quests->getMatches() > CFG_SQL_LIMIT_DEFAULT)
$tab['params']['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=1;crs='.$_id.';crv=0');
$pageData['relTabs'][] = $tab;
} }
// tab: achievements // tab: achievements

View File

@@ -286,6 +286,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$tokens = []; $tokens = [];
$currency = []; $currency = [];
if (!is_array($data))
continue;
foreach ($data as $c => $qty) foreach ($data as $c => $qty)
{ {
if (is_string($c)) if (is_string($c))
@@ -324,7 +328,27 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$quickInfo[] = Lang::$item['cost'].$each.Lang::$colon.'[ul][li]'.implode('[/li][li]', $costList).'[/li][/ul]'; $quickInfo[] = Lang::$item['cost'].$each.Lang::$colon.'[ul][li]'.implode('[/li][li]', $costList).'[/li][/ul]';
if ($_reqRating) if ($_reqRating)
$quickInfo[] = sprintf(Lang::$item['reqRating'], $_reqRating); {
$res = [];
$i = 0;
$len = 0;
$parts = explode(' ', sprintf(Lang::$item['reqRating'], $_reqRating));
foreach ($parts as $p)
{
$res[$i][] = $p;
$len += mb_strlen($p);
if ($len < 30)
continue;
$len = 0;
$i++;
}
foreach ($res as &$r)
$r = implode(' ', $r);
$quickInfo[] = implode('[br]', $res);
}
} }
if ($_ = $item->getField('repairPrice')) if ($_ = $item->getField('repairPrice'))
@@ -557,7 +581,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$reqQuest[$lv['id']] = 0; $reqQuest[$lv['id']] = 0;
$itemLoot[$l]['condition'] = ['type' => TYPE_QUEST, 'typeId' => &$reqQuest[$lv['id']], 'status' => 1]; $itemLoot[$l]['condition'][] = ['type' => TYPE_QUEST, 'typeId' => &$reqQuest[$lv['id']], 'status' => 1];
} }
$pageData['relTabs'][] = array( $pageData['relTabs'][] = array(
@@ -900,7 +924,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$extraCols[] = 'Listview.extraCols.condition'; $extraCols[] = 'Listview.extraCols.condition';
Util::$pageTemplate->extendGlobalIds(TYPE_WORLDEVENT, $e); Util::$pageTemplate->extendGlobalIds(TYPE_WORLDEVENT, $e);
$row['condition'] = array( $row['condition'][] = array(
'type' => TYPE_WORLDEVENT, 'type' => TYPE_WORLDEVENT,
'typeId' => -$e, 'typeId' => -$e,
'status' => 1 'status' => 1

View File

@@ -172,7 +172,7 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
$path[] = $filter['sl']; $path[] = $filter['sl'];
$infoMask = ITEMINFO_JSON; $infoMask = ITEMINFO_JSON;
if (array_intersect([63, 64], $xCols)) // 63:buyPrice; 64:sellPrice if (array_intersect([63, 64, 125], $xCols)) // 63:buyPrice; 64:sellPrice; 125:reqarenartng
$infoMask |= ITEMINFO_VENDOR; $infoMask |= ITEMINFO_VENDOR;

View File

@@ -520,7 +520,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if (!isset($extra[0])) if (!isset($extra[0]))
$extra[0] = 'Listview.extraCols.condition'; $extra[0] = 'Listview.extraCols.condition';
$data[$sId]['condition'] = ['type' => TYPE_SKILL, 'typeId' => $_, 'status' => 1, 'reqSkillLvl' => $train['reqSkillValue']]; $data[$sId]['condition'][] = ['type' => TYPE_SKILL, 'typeId' => $_, 'status' => 1, 'reqSkillLvl' => $train['reqSkillValue']];
} }
if ($_ = $train['reqLevel']) if ($_ = $train['reqLevel'])
@@ -631,7 +631,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$reqQuest[$lv['id']] = 0; $reqQuest[$lv['id']] = 0;
$itemLoot[$l]['condition'] = ['type' => TYPE_QUEST, 'typeId' => &$reqQuest[$lv['id']], 'status' => 1]; $itemLoot[$l]['condition'][] = ['type' => TYPE_QUEST, 'typeId' => &$reqQuest[$lv['id']], 'status' => 1];
} }
$pageData['relTabs'][] = array( $pageData['relTabs'][] = array(

View File

@@ -423,7 +423,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$reqQuest[$lv['id']] = 0; $reqQuest[$lv['id']] = 0;
$itemLoot[$l]['condition'] = ['type' => TYPE_QUEST, 'typeId' => &$reqQuest[$lv['id']], 'status' => 1]; $itemLoot[$l]['condition'][] = ['type' => TYPE_QUEST, 'typeId' => &$reqQuest[$lv['id']], 'status' => 1];
} }
$extraCols[] = 'Listview.extraCols.percent'; $extraCols[] = 'Listview.extraCols.percent';

View File

@@ -421,7 +421,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'rangeName' => $spell->getField('rangeText', true), 'rangeName' => $spell->getField('rangeText', true),
'range' => $spell->getField('rangeMaxHostile'), 'range' => $spell->getField('rangeMaxHostile'),
'gcd' => Util::formatTime($spell->getField('startRecoveryTime')), 'gcd' => Util::formatTime($spell->getField('startRecoveryTime')),
'gcdCat' => "[NYI]", 'gcdCat' => null, // todo (low): nyi; find out how this works [n/a; normal; ..]
'school' => User::isInGroup(U_GROUP_STAFF) ? sprintf(Util::$dfnString, Util::asHex($spell->getField('schoolMask')), Lang::getMagicSchools($spell->getField('schoolMask'))) : Lang::getMagicSchools($spell->getField('schoolMask')), 'school' => User::isInGroup(U_GROUP_STAFF) ? sprintf(Util::$dfnString, Util::asHex($spell->getField('schoolMask')), Lang::getMagicSchools($spell->getField('schoolMask'))) : Lang::getMagicSchools($spell->getField('schoolMask')),
'dispel' => Lang::$game['dt'][$spell->getField('dispelType')], 'dispel' => Lang::$game['dt'][$spell->getField('dispelType')],
'mechanic' => Lang::$game['me'][$spell->getField('mechanic')], 'mechanic' => Lang::$game['me'][$spell->getField('mechanic')],
@@ -666,7 +666,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($spell->getField('effect'.$i.'RadiusMax') > 0) if ($spell->getField('effect'.$i.'RadiusMax') > 0)
$foo['radius'] = $spell->getField('effect'.$i.'RadiusMax'); $foo['radius'] = $spell->getField('effect'.$i.'RadiusMax');
if (($effBP + $effDS) && !($itemIdx && $spell->relItems && !$spell->relItems->error) && (!in_array($i, $spellIdx) || in_array($effAura, [225, 227]))) if (!($itemIdx && $spell->relItems && !$spell->relItems->error) && (!in_array($i, $spellIdx) || in_array($effAura, [225, 227])))
$foo['value'] = ($effDS != 1 ? ($effBP + 1).Lang::$game['valueDelim'] : null).($effBP + $effDS); $foo['value'] = ($effDS != 1 ? ($effBP + 1).Lang::$game['valueDelim'] : null).($effBP + $effDS);
if ($effRPPL != 0) if ($effRPPL != 0)
@@ -1041,6 +1041,11 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
break; break;
} }
case 139: // Force Reaction
{
$bar = ' (<a href="?faction='.$effMV.'">'.FactionList::getName($effMV).'</a>)';
$foo['value'] = sprintf(Util::$dfnString, $foo['value'], Lang::$game['rep'][$foo['value']]);
}
} }
$foo['name'] .= strstr($bar, 'href') || strstr($bar, '#') ? $bar : ($bar ? ' ('.$bar.')' : null); $foo['name'] .= strstr($bar, 'href') || strstr($bar, '#') ? $bar : ($bar ? ' ('.$bar.')' : null);
@@ -1058,7 +1063,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
// cases where we dont want 'Value' to be displayed // cases where we dont want 'Value' to be displayed
if (in_array($effAura, [11, 12, 36, 77]) || in_array($effId, [])) if (in_array($effAura, [11, 12, 36, 77]) || in_array($effId, []) || empty($foo['value']))
unset($foo['value']); unset($foo['value']);
} }
@@ -1373,7 +1378,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$lv[$bar] = $foo[$bar]; $lv[$bar] = $foo[$bar];
$lv[$bar]['percent'] = $extraItem['additionalCreateChance']; $lv[$bar]['percent'] = $extraItem['additionalCreateChance'];
$lv[$bar]['condition'] = ['type' => TYPE_SPELL, 'typeId' => $extraItem['requiredSpecialization'], 'status' => 2]; $lv[$bar]['condition'][] = ['type' => TYPE_SPELL, 'typeId' => $extraItem['requiredSpecialization'], 'status' => 2];
$smarty->extendGlobalIds(TYPE_SPELL, $extraItem['requiredSpecialization']); $smarty->extendGlobalIds(TYPE_SPELL, $extraItem['requiredSpecialization']);
$extraCols[] = 'Listview.extraCols.condition'; $extraCols[] = 'Listview.extraCols.condition';
@@ -1568,6 +1573,130 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$ubCreature->addGlobalsToJScript(GLOBALINFO_SELF); $ubCreature->addGlobalsToJScript(GLOBALINFO_SELF);
} }
// tab: zone
if ($areas = DB::Aowow()->select('SELECT * FROM spell_area WHERE spell = ?d', $_id))
{
$zones = new ZoneList(array(['id', array_column($areas, 'area')]));
if (!$zones->error)
{
$lvZones = $zones->getListviewData();
$zones->addGlobalsToJscript();
$lv = [];
$parents = [];
foreach ($areas as $a)
{
if (empty($lvZones[$a['area']]))
continue;
$_ = ['condition' => []];
$extra = false;
if ($a['aura_spell'])
{
Util::$pageTemplate->extendGlobalIds(TYPE_SPELL, $a['aura_spell']);
$_['condition'][] = array(
'type' => TYPE_SPELL,
'typeId' => abs($a['aura_spell']),
'status' => $a['aura_spell'] > 0 ? 1 : 0
);
}
if ($a['quest_start']) // status for quests needs work
{
Util::$pageTemplate->extendGlobalIds(TYPE_QUEST, $a['quest_start']);
$_['condition'][] = array(
'type' => TYPE_QUEST,
'typeId' => $a['quest_start'],
'status' => $a['quest_start_status'] & 0x8 ? 1 : 2
);
}
if ($a['quest_end'] && $a['quest_end'] != $a['quest_start'])
{
Util::$pageTemplate->extendGlobalIds(TYPE_QUEST, $a['quest_end']);
$_['condition'][] = array(
'type' => TYPE_QUEST,
'typeId' => $a['quest_end'],
'status' => $a['quest_start_status'] & 0x8 ? 1 : 0
);
}
if ($a['racemask'])
{
$foo = [];
for ($i = 0; $i < 10; $i++)
if ($a['racemask'] & $i)
$foo[] = $i + 1;
Util::$pageTemplate->extendGlobalIds(TYPE_RACE, $foo);
$_['condition'][] = array(
'type' => TYPE_RACE,
'typeId' => $a['racemask'],
'status' => 1
);
}
if ($a['gender'] != 2) // 2: both
$_['condition'][] = ['gender' => $a['gender'] + 1];
if ($_['condition'])
$extra = true;
$row = array_merge($_, $lvZones[$a['area']]);
// merge subzones, into one row, if: conditions match && parentZone is shared
if ($p = $zones->getEntry($a['area'])['parentArea'])
{
$parents[] = $p;
$row['parentArea'] = $p;
$row['subzones'] = [$a['area']];
}
else
$row['parentArea'] = 0;
$set = false;
foreach ($lv as &$v)
{
if ($v['condition'] != $row['condition'] || ($v['parentArea'] != $row['parentArea'] && $v['id'] != $row['parentArea']))
continue;
if (!$row['parentArea'] && $v['id'] != $row['parentArea'])
continue;
$set = true;
$v['subzones'][] = $row['id'];
break;
}
// add self as potential subzone; IF we are a parentZone without added children, we get filtered in JScript
if (!$set)
{
$row['subzones'] = [$row['id']];
$lv[] = $row;
}
}
// overwrite lvData with parent-lvData (condition and subzones are kept)
if ($parents)
{
$parents = (new ZoneList(array(['id', $parents])))->getListviewData();
foreach ($lv as &$_)
if (isset($parents[$_['parentArea']]))
$_ = array_merge($_, $parents[$_['parentArea']]);
}
$pageData['relTabs'][] = array(
'file' => 'zone',
'data' => $lv,
'params' => [
'tabs' => '$tabsRelated',
'extraCols' => $extra ? '$[Listview.extraCols.condition]' : null,
'hiddenCols' => $extra ? "$['instancetype']" : null
]
);
}
}
// tab: teaches // tab: teaches
if ($ids = Util::getTaughtSpells($spell)) if ($ids = Util::getTaughtSpells($spell))
{ {

View File

@@ -7,7 +7,7 @@ if (!defined('AOWOW_REVISION'))
$cats = Util::extractURLParams($pageParam); $cats = Util::extractURLParams($pageParam);
$path = [0, 6]; $path = [0, 6];
$title = [Util::ucFirst(Lang::$game['zones'])]; $title = [Util::ucFirst(Lang::$game['zones'])];
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_ZONE, -1, $cats[0] ? implode('.', $cats) : -1, User::$localeId]); $cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_ZONE, -1, $cats ? implode('.', $cats) : -1, User::$localeId]);
$validCats = array( $validCats = array(
0 => true, 0 => true,
1 => true, 1 => true,
@@ -31,7 +31,7 @@ if (!$smarty->loadCache($cacheKey, $pageData))
$mapFile = 0; $mapFile = 0;
$spawnMap = -1; $spawnMap = -1;
if (isset($cats[0])) if ($cats)
{ {
$conditions[] = ['z.category', $cats[0]]; $conditions[] = ['z.category', $cats[0]];
@@ -57,10 +57,24 @@ if (!$smarty->loadCache($cacheKey, $pageData))
$zones = new ZoneList($conditions); $zones = new ZoneList($conditions);
// menuId 6: Zone g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'som' => '', 'page' => array(
'map' => [], 'title' => implode(' - ', $title),
'listviews' => array( 'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0,
'map' => null,
'reqCSS' => array(
['path' => STATIC_URL.'/css/Mapper.css'],
['path' => STATIC_URL.'/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6']
),
'reqJS' => array(
STATIC_URL.'/js/Mapper.js',
STATIC_URL.'/js/ShowOnMap.js'
)
),
'lv' => array(
array( array(
'file' => 'zone', 'file' => 'zone',
'data' => $zones->getListviewData(), 'data' => $zones->getListviewData(),
@@ -113,37 +127,24 @@ if (!$smarty->loadCache($cacheKey, $pageData))
$somData['flightmaster'][] = $data; $somData['flightmaster'][] = $data;
} }
$pageData['map'] = array( $pageData['page']['map'] = array(
'data' => array(
'zone' => $mapFile, 'zone' => $mapFile,
'zoom' => 1, 'zoom' => 1,
'overlay' => 'true', 'overlay' => 'true',
'zoomable' => 'false' 'zoomable' => 'false'
),
'som' => json_encode($somData, JSON_NUMERIC_CHECK)
); );
$pageData['som'] = json_encode($somData, JSON_NUMERIC_CHECK);
} }
$smarty->saveCache($cacheKey, $pageData); $smarty->saveCache($cacheKey, $pageData);
} }
// menuId 6: Zone g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => implode(' - ', $title),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0,
'reqCSS' => array(
['path' => 'template/css/Mapper.css'],
['path' => 'template/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6']
),
'reqJS' => array(
'template/js/Mapper.js',
'template/js/ShowOnMap.js'
)
));
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
$smarty->display('list-page-generic.tpl'); $smarty->display('list-page-generic.tpl');

View File

@@ -6235,61 +6235,93 @@ Listview.extraCols = {
id: 'condition', id: 'condition',
name: LANG.requires, name: LANG.requires,
width: '30%',
compute: function(row, td) { compute: function(row, td) {
if (!row.condition || !row.condition.type || !row.condition.typeId) { if (!row.condition || !$WH.is_array(row.condition)) {
return '';
}
var cnd = Listview.extraCols.condition.getState(row.condition);
if (!cnd) {
return; return;
} }
td.className = 'small'; td.className = 'small';
td.style.lineHeight = '18px'; td.style.lineHeight = '18px';
for (i in row.condition) {
if (cnd = Listview.extraCols.condition.getState(row.condition[i])) {
if (td.innerHTML)
$WH.ae(td, $WH.ce('br'));
var span = $WH.ce('span'); var span = $WH.ce('span');
span.className = cnd.color; span.className = cnd.color;
$WH.ae(span, cnd.state); $WH.ae(span, cnd.state);
$WH.ae(td, span); $WH.ae(td, span);
$WH.ae(td, $WH.ce('br'));
var a = $WH.ce('a'); for (j in cnd.links) {
a.href = cnd.url; if (j > 0) {
$WH.ae(td, $WH.ct(LANG.comma));
}
var
l = cnd.links[j],
a = $WH.ce('a');
a.href = l.url;
a.style.whiteSpace = 'nowrap'; a.style.whiteSpace = 'nowrap';
if (g_pageInfo.typeId == row.condition.typeId) { // ponts to self // points to self
if (g_pageInfo.type == row.condition[i].type && g_pageInfo.typeId == row.condition[i].typeId) {
a.className = 'q1'; a.className = 'q1';
$WH.st(a, 'This'); $WH.st(a, 'This');
} }
else { else {
$WH.st(a, cnd.name); $WH.ae(a, l.name);
if (cnd.icon) { if (l.icon) {
a.className = 'icontiny tinyspecial'; a.className = 'icontiny tinyspecial';
a.style.backgroundImage = 'url(' + g_staticUrl + '/images/wow/icons/tiny/' + cnd.icon + '.gif)'; a.style.backgroundImage = 'url(' + g_staticUrl + '/images/wow/icons/tiny/' + l.icon + '.gif)';
} }
if (cnd.quality) { if (l.color) {
a.className += ' q' + cnd.quality; a.className += ' ' + l.color;
} }
} }
$WH.ae(td, a); $WH.ae(td, a);
}
}
else if ('gender' in row.condition[i]) {
var
gender = g_file_genders[row.condition[i].gender - 1],
sp = $WH.ce('span');
sp.className = 'icon-' + gender;
sp.style.position = 'absolute';
sp.style.right = '0px';
sp.style.top = '3px';
sp.innerHTML = '&nbsp;';
g_addTooltip(sp, LANG[gender]);
td.style.position = 'relative';
$WH.ae(td, sp);
}
}
}, },
getVisibleText: function(row) { getVisibleText: function(row) {
var buff = ''; var buff = '';
if (!row.condition || !row.condition.type || !row.condition.typeId) { if (!row.condition || !$WH.is_array(row.condition)) {
return buff; return buff;
} }
var cnd = Listview.extraCols.condition.getState(row.condition); for (i in row.condition) {
var cnd = Listview.extraCols.condition.getState(row.condition[i]);
if (!cnd) { if (!cnd) {
return buff; continue;
} }
buff += cnd.name + ' ' + cnd.state; for (j in cnd) {
buff += cnd[j].name + ' ' + cnd.state;
}
}
return buff; return buff;
}, },
@@ -6307,8 +6339,10 @@ Listview.extraCols = {
return Listview.extraCols.condition.getQuestState(cond); return Listview.extraCols.condition.getQuestState(cond);
case 'event': case 'event':
return Listview.extraCols.condition.getEventState(cond); return Listview.extraCols.condition.getEventState(cond);
case 'race':
return Listview.extraCols.condition.getRaceState(cond);
default: default:
return {}; return null;
} }
}, },
getSkillState: function(cond) { getSkillState: function(cond) {
@@ -6320,14 +6354,16 @@ Listview.extraCols = {
cnd = {}, cnd = {},
item = g_skills[cond.typeId]; item = g_skills[cond.typeId];
cnd.icon = item.icon.toLowerCase(); cnd.state = $WH.ct((cond.status ? LANG.pr_note_known : LANG.pr_note_missing) + LANG.colon);
cnd.state = cond.status ? $WH.ct(LANG.pr_note_known) : $WH.ct(LANG.pr_note_missing);
cnd.color = cond.status ? 'q2' : 'q10'; cnd.color = cond.status ? 'q2' : 'q10';
cnd.name = item['name_' + g_locale.name]; cnd.links = [{
cnd.url = '?skill=' + cond.typeId; icon: item.icon.toLowerCase(),
name: $WH.ct(item['name_' + g_locale.name]),
url : '?skill=' + cond.typeId
}];
if (cond.reqSkillLvl) if (cond.reqSkillLvl)
cnd.name += ' (' + cond.reqSkillLvl + ')'; cnd.l.name += ' (' + cond.reqSkillLvl + ')';
return cnd; return cnd;
}, },
@@ -6340,11 +6376,13 @@ Listview.extraCols = {
cnd = {}, cnd = {},
item = g_spells[cond.typeId]; item = g_spells[cond.typeId];
cnd.icon = item.icon.toLowerCase(); cnd.state = $WH.ct((cond.status ? LANG.pr_note_known : LANG.pr_note_missing) + LANG.colon);
cnd.state = cond.status ? $WH.ct(LANG.pr_note_known) : $WH.ct(LANG.pr_note_missing);
cnd.color = cond.status ? 'q2' : 'q10'; cnd.color = cond.status ? 'q2' : 'q10';
cnd.name = item['name_' + g_locale.name]; cnd.links = [{
cnd.url = '?spell=' + cond.typeId; icon: item.icon.toLowerCase(),
name: $WH.ct(item['name_' + g_locale.name]),
url : '?spell=' + cond.typeId
}];
return cnd; return cnd;
}, },
@@ -6357,12 +6395,14 @@ Listview.extraCols = {
cnd = {}, cnd = {},
item = g_items[cond.typeId]; item = g_items[cond.typeId];
cnd.icon = item.icon.toLowerCase(); cnd.state = $WH.ct((cond.status ? LANG.pr_note_earned : LANG.pr_note_missing) + LANG.colon);
cnd.state = cond.status ? $WH.ct(LANG.pr_note_earned) : $WH.ct(LANG.pr_note_missing);
cnd.color = cond.status ? 'q2' : 'q10'; cnd.color = cond.status ? 'q2' : 'q10';
cnd.name = item['name_' + g_locale.name]; cnd.links = [{
cnd.url = '?item=' + cond.typeId; icon : item.icon.toLowerCase(),
cnd.quality = item.quality; name : $WH.ct(item['name_' + g_locale.name]),
url : '?item=' + cond.typeId,
color: 'q' + item.quality
}];
return cnd; return cnd;
}, },
@@ -6375,11 +6415,13 @@ Listview.extraCols = {
cnd = {}, cnd = {},
item = g_achievements[cond.typeId]; item = g_achievements[cond.typeId];
cnd.icon = item.icon.toLowerCase(); cnd.state = $WH.ct((cond.status ? LANG.pr_note_earned : LANG.pr_note_incomplete) + LANG.colon);
cnd.state = cond.status ? $WH.ct(LANG.pr_note_earned) : $WH.ct(LANG.pr_note_incomplete);
cnd.color = cond.status ? 'q2' : 'q10'; cnd.color = cond.status ? 'q2' : 'q10';
cnd.name = item['name_' + g_locale.name]; cnd.links = [{
cnd.url = '?achievement=' + cond.typeId; icon: item.icon.toLowerCase(),
name: $WH.ct(item['name_' + g_locale.name]),
url : '?achievement=' + cond.typeId
}];
return cnd; return cnd;
}, },
@@ -6392,11 +6434,35 @@ Listview.extraCols = {
cnd = {}, cnd = {},
item = g_quests[cond.typeId]; item = g_quests[cond.typeId];
cnd.icon = ''; cnd.state = $WH.ct((cond.status == 1 ? LANG.progress : (cond.status == 2 ? LANG.pr_note_complete : LANG.pr_note_incomplete)) + LANG.colon);
cnd.state = cond.status == 1 ? $WH.ct(LANG.progress) : cond.status == 2 ? $WH.ct(LANG.pr_note_complete) : $WH.ct(LANG.pr_note_incomplete);
cnd.color = cond.status == 1 ? 'q1' : cond.status == 2 ? 'q2' : 'q10'; cnd.color = cond.status == 1 ? 'q1' : cond.status == 2 ? 'q2' : 'q10';
cnd.name = item['name_' + g_locale.name]; cnd.links = [{
cnd.url = '?quest=' + cond.typeId; name: $WH.ct(item['name_' + g_locale.name]),
url : '?quest=' + cond.typeId
}];
return cnd;
},
getRaceState: function(cond) {
if (!cond.typeId) {
return;
}
var
cnd = {},
name = $WH.ce('div'),
races = Listview.funcBox.assocBinFlags(cond.typeId, g_chr_races);
cnd.state = $WH.ct((cond.status ? 'Player is' : 'Player is not') + LANG.colon);
cnd.color = 'q1';
cnd.links = [];
for (var i = 0, len = races.length; i < len; ++i) {
cnd.links.push({
name: $WH.ct(g_chr_races[races[i]]),
url : '?class=' + races[i]
});
}
return cnd; return cnd;
}, },
@@ -6409,24 +6475,28 @@ Listview.extraCols = {
cnd = {}, cnd = {},
item = g_holidays[cond.typeId]; item = g_holidays[cond.typeId];
cnd.icon = item.icon.toLowerCase(); cnd.state = $WH.ct((cond.status == 1 ? 'active' : (cond.status == 2 ? LANG.pr_note_complete : 'inactive')) + LANG.colon);
cnd.state = cond.status == 1 ? $WH.ct('active') : cond.status == 2 ? $WH.ct(LANG.pr_note_complete) : $WH.ct('inactive');
cnd.color = cond.status == 1 ? 'q1' : cond.status == 2 ? 'q2' : 'q10'; cnd.color = cond.status == 1 ? 'q1' : cond.status == 2 ? 'q2' : 'q10';
cnd.name = item['name_' + g_locale.name]; cnd.links = [{
cnd.url = '?event=' + cond.typeId; icon: item.icon.toLowerCase(),
name: item['name_' + g_locale.name],
url :'?event=' + cond.typeId
}];
return cnd; return cnd;
}, },
sortFunc: function(a, b, col) { sortFunc: function(a, b, col) {
if (a.condition && b.condition) { var text1 = this.getVisibleText(a);
return $WH.strcmp(a.condition.status, b.condition.status); var text2 = this.getVisibleText(b);
}
else if (a.condition) if (text1 != '' && text2 == '') {
return -1; return -1;
else if (b.condition) }
if (text2 != '' && text1 == '') {
return 1; return 1;
else }
return 0;
return $WH.strcmp(text1, text2);
} }
}, },
}; };
@@ -11340,7 +11410,10 @@ Listview.templates = {
align: 'left', align: 'left',
value: 'name', value: 'name',
compute: function(zone, td) { compute: function(zone, td) {
var a = $WH.ce('a'); var
wrapper = $WH.ce('div'),
a = $WH.ce('a');
a.style.fontFamily = 'Verdana, sans-serif'; a.style.fontFamily = 'Verdana, sans-serif';
a.href = this.getItemLink(zone); a.href = this.getItemLink(zone);
$WH.ae(a, $WH.ct(zone.name)); $WH.ae(a, $WH.ct(zone.name));
@@ -11348,10 +11421,52 @@ Listview.templates = {
var sp = $WH.ce('span'); var sp = $WH.ce('span');
sp.className = g_GetExpansionClassName(zone.expansion); sp.className = g_GetExpansionClassName(zone.expansion);
$WH.ae(sp, a); $WH.ae(sp, a);
$WH.ae(td, sp); $WH.ae(wrapper, sp);
} }
else { else {
$WH.ae(td, a); $WH.ae(wrapper, a);
}
$WH.ae(td, wrapper);
if (zone.subzones) {
if (zone.subzones.length == 1 && zone.subzones[0] == zone.id)
return;
var nRows = parseInt(zone.subzones.length / 3);
if (nRows != (zone.subzones.length / 3))
nRows++;
wrapper.style.position = 'relative';
wrapper.style.minHeight = ((nRows * 12) + 19) + 'px';
var d = $WH.ce('div');
d.className = 'small';
d.style.fontStyle = 'italic';
d.style.position = 'absolute';
d.style.right = '2px';
d.style.bottom = '2px';
d.style.textAlign = 'right';
for (i in zone.subzones) {
if (!g_gatheredzones[zone.subzones[i]]) {
continue;
}
if (i > 0) {
$WH.ae(d, $WH.ct(LANG.comma));
}
var a = $WH.ce('a');
a.className = zone.subzones[i] == zone.id ? 'q1' : 'q0';
a.style.whiteSpace = 'nowrap';
a.href = '?zone=' + zone.subzones[i];
$WH.st(a, g_gatheredzones[zone.subzones[i]]['name_' + g_locale.name]);
$WH.ae(d, a);
}
$WH.ae(wrapper, d);
} }
}, },
getVisibleText: function(zone) { getVisibleText: function(zone) {
@@ -13314,7 +13429,7 @@ Listview.templates = {
if (title.gender && title.gender != 3) { if (title.gender && title.gender != 3) {
var gender = g_file_genders[title.gender - 1]; var gender = g_file_genders[title.gender - 1];
var sp = $WH.ce('span'); var sp = $WH.ce('span');
sp.className = gender + '-icon'; sp.className = 'icon-' + gender;
g_addTooltip(sp, LANG[gender]); g_addTooltip(sp, LANG[gender]);
$WH.ae(td, sp); $WH.ae(td, sp);

View File

@@ -2,7 +2,7 @@ var _ = g_quests;
{strip} {strip}
{foreach from=$data key=id item=item} {foreach from=$data key=id item=item}
_[{$id}]={ldelim} _[{$id}]={ldelim}
name_{$user.language}:'{$item.name|escape:"javascript"}', name_{$user.language}:'{$item.name|escape:"javascript"}'
{rdelim}; {rdelim};
{/foreach} {/foreach}
{/strip} {/strip}

View File

@@ -9,17 +9,17 @@
<!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="{$smarty.const.STATIC_URL}/css/global_ie6.css?{$AOWOW_REVISION}" /><![endif]--> <!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="{$smarty.const.STATIC_URL}/css/global_ie6.css?{$AOWOW_REVISION}" /><![endif]-->
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{$smarty.const.STATIC_URL}/css/global_ie67.css?{$AOWOW_REVISION}" /><![endif]--> <!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{$smarty.const.STATIC_URL}/css/global_ie67.css?{$AOWOW_REVISION}" /><![endif]-->
{foreach from=$reqCSS item=css} {foreach from=$reqCSS item=css}
{if isset($css.string)} {if !empty($css.string)}
<style type="text/css">{$css.string}</style> <style type="text/css">{$css.string}</style>
{else} {elseif !empty($css.path)}
{if isset($css.ieCond)}<!--[if {$css.ieCond}]>{/if}<link rel="stylesheet" type="text/css" href="{$css.path}?{$AOWOW_REVISION}" />{if isset($css.ieCond)}<![endif]-->{/if} {if !empty($css.ieCond)}<!--[if {$css.ieCond}]>{/if}<link rel="stylesheet" type="text/css" href="{$css.path}?{$AOWOW_REVISION}" />{if !empty($css.ieCond)}<![endif]-->{/if}
{/if} {/if}
{/foreach} {/foreach}
<script type="text/javascript"> <script type="text/javascript">
var g_serverTime = new Date('{$smarty.now|date_format:"%Y/%m/%d %H:%M:%S"}'); var g_serverTime = new Date('{$smarty.now|date_format:"%Y/%m/%d %H:%M:%S"}');
var g_staticUrl = "{$smarty.const.STATIC_URL}"; var g_staticUrl = "{$smarty.const.STATIC_URL}";
var g_host = "{$smarty.const.HOST_URL}"; var g_host = "{$smarty.const.HOST_URL}";
{if isset($dataKey)} {if !empty($dataKey)}
var g_dataKey = '{$dataKey}'; var g_dataKey = '{$dataKey}';
{/if} {/if}
</script> </script>
@@ -29,9 +29,9 @@
<script src="{$smarty.const.STATIC_URL}/js/locale_{$user.language}.js?{$AOWOW_REVISION}" type="text/javascript"></script> <script src="{$smarty.const.STATIC_URL}/js/locale_{$user.language}.js?{$AOWOW_REVISION}" type="text/javascript"></script>
<script src="{$smarty.const.STATIC_URL}/js/global.js?{$AOWOW_REVISION}" type="text/javascript"></script> <script src="{$smarty.const.STATIC_URL}/js/global.js?{$AOWOW_REVISION}" type="text/javascript"></script>
<script src="{$smarty.const.STATIC_URL}/js/Markup.js?{$AOWOW_REVISION}" type="text/javascript"></script> <script src="{$smarty.const.STATIC_URL}/js/Markup.js?{$AOWOW_REVISION}" type="text/javascript"></script>
{foreach from=$reqJS item=file} {foreach from=$reqJS item=file}{if !empty($file)}
<script src="{$file}{if $file[0] == '?'}&{else}?{/if}{$AOWOW_REVISION}" type="text/javascript"></script> <script src="{$file}{if $file[0] == '?'}&{else}?{/if}{$AOWOW_REVISION}" type="text/javascript"></script>
{/foreach} {/if}{/foreach}
<script type="text/javascript"> <script type="text/javascript">
var g_locale = {ldelim} id:{$user.locale}, name:'{$user.language}' {rdelim}; var g_locale = {ldelim} id:{$user.locale}, name:'{$user.language}' {rdelim};
var g_user = {ldelim} {strip} var g_user = {ldelim} {strip}

View File

@@ -98,7 +98,7 @@ if !empty($transfer)}
</tr> </tr>
<tr> <tr>
<th style="border-bottom: 0; border-left: 0">{$lang._gcdCategory}</th> <th style="border-bottom: 0; border-left: 0">{$lang._gcdCategory}</th>
<td style="border-bottom: 0">{$gcdCat}</td> <td style="border-bottom: 0">{if $gcdCat}{$gcdCat}{else}<span class="q0">{$lang.n_a}</span>{/if}</td>
</tr> </tr>
</table> </table>
</td> </td>