- make offset optional, when converting list to mask

Items:
- fixed display of inventory type for robes and ranged weapons

Spells:
- parsing: $charLevel and $interactive are now properties of spell.
- parsing: fixed durations, passing the time-unit seperately to allow for evaluation of the actual value
- parsing: fixed gender-specific formating [ >male/female< to <male/female>]
- parsing: usage of is_numeric() instead of (float) as 0 is a fucking valid numeric (caused some formulas to not be evaluated *grrr*)
- parsing: lastValue-references now skip to the next previous \d instead of being stopped by random \w (like time units)
- implemented forgotten display of runes for spellCost
- fixed castTimes for most hunter shots (they are -1000 for some reason)
- fixed display of required stances (sometimes they are not actually required but show, when you are _allowed_ to use a spell in certain forms)
- improved formating of tooltips-js (no visual change)

ListViews:
- pass '_truncated' separately. there are nough cases in which 'note' gets send without truncated results

misc changes here and there
This commit is contained in:
Sarjuuk
2013-04-20 16:16:29 +02:00
parent f8b8ee218c
commit 1142220674
29 changed files with 174 additions and 150 deletions

View File

@@ -206,17 +206,18 @@ abstract class Filter
} }
} }
protected function list2Mask($list) protected function list2Mask($list, $noOffset = false)
{ {
$mask = 0x0; $mask = 0x0;
$o = $noOffset ? 0 : 1; // schoolMask requires this..?
if (is_array($list)) if (is_array($list))
{ {
foreach ($list as $itm) foreach ($list as $itm)
$mask += (1 << intVal($itm)); $mask += (1 << (intVal($itm) - $o));
} }
else else
$mask = (1 << intVal($list)); $mask = (1 << (intVal($list) - $o));
return $mask; return $mask;
} }
@@ -233,6 +234,9 @@ abstract class Filter
header('Location: http://'.$_SERVER['SERVER_NAME'].str_replace('index.php', '', $_SERVER['PHP_SELF']).'?'.$_SERVER['QUERY_STRING'].'='.$get); header('Location: http://'.$_SERVER['SERVER_NAME'].str_replace('index.php', '', $_SERVER['PHP_SELF']).'?'.$_SERVER['QUERY_STRING'].'='.$get);
} }
// TODO: wrong wrong wrong!!
// 1) filter-Ids are different for each type; 2) (NOT) IN - subqueries will eat the mysql-server alive!
protected function createSQLForCommunity($cr) protected function createSQLForCommunity($cr)
{ {
switch ($cr[0]) switch ($cr[0])

View File

@@ -558,7 +558,7 @@ class ItemList extends BaseType
if ($itemSpellsAndTrigger) if ($itemSpellsAndTrigger)
{ {
$itemSpells = new SpellList(array(['id', array_keys($itemSpellsAndTrigger)])); $itemSpells = new SpellList(array(['s.id', array_keys($itemSpellsAndTrigger)]));
while ($itemSpells->iterate()) while ($itemSpells->iterate())
if ($parsed = $itemSpells->parseText('description', $this->curTpl['RequiredLevel'])) if ($parsed = $itemSpells->parseText('description', $this->curTpl['RequiredLevel']))
$green[] = Lang::$item['trigger'][$itemSpellsAndTrigger[$itemSpells->id]].$parsed; $green[] = Lang::$item['trigger'][$itemSpellsAndTrigger[$itemSpells->id]].$parsed;
@@ -622,7 +622,7 @@ class ItemList extends BaseType
// todo: get from static prop? // todo: get from static prop?
if ($setSpellsAndIdx) if ($setSpellsAndIdx)
{ {
$boni = new SpellList(array(['id', array_keys($setSpellsAndIdx)])); $boni = new SpellList(array(['s.id', array_keys($setSpellsAndIdx)]));
while ($boni->iterate()) while ($boni->iterate())
{ {
$itemset['spells'][] = array( $itemset['spells'][] = array(
@@ -656,7 +656,7 @@ class ItemList extends BaseType
// recipe handling (some stray Techniques have subclass == 0), place at bottom of tooltipp // recipe handling (some stray Techniques have subclass == 0), place at bottom of tooltipp
if ($this->curTpl['class'] == ITEM_CLASS_RECIPE && ($this->curTpl['subclass'] || $this->curTpl['BagFamily'] == 16)) if ($this->curTpl['class'] == ITEM_CLASS_RECIPE && ($this->curTpl['subclass'] || $this->curTpl['BagFamily'] == 16))
{ {
$craftSpell = new SpellList(array(['id', (int)$this->curTpl['spellid_2']])); $craftSpell = new SpellList(array(['s.id', (int)$this->curTpl['spellid_2']]));
$craftItem = new ItemList(array(['i.entry', (int)$craftSpell->curTpl["effect1CreateItemId"]])); $craftItem = new ItemList(array(['i.entry', (int)$craftSpell->curTpl["effect1CreateItemId"]]));
$reagentItems = []; $reagentItems = [];
@@ -830,7 +830,7 @@ class ItemList extends BaseType
if ($equipSpells) if ($equipSpells)
{ {
$eqpSplList = new SpellList(array(['id', $equipSpells])); $eqpSplList = new SpellList(array(['s.id', $equipSpells]));
$stats = $eqpSplList->getStatGain(); $stats = $eqpSplList->getStatGain();
foreach ($stats as $stat) foreach ($stats as $stat)
@@ -1008,7 +1008,7 @@ class ItemList extends BaseType
// 'subsubclass' => $this->curTpl['subsubclass'], // 'subsubclass' => $this->curTpl['subsubclass'],
'heroic' => (string)($this->curTpl['Flags'] & 0x8), 'heroic' => (string)($this->curTpl['Flags'] & 0x8),
'side' => Util::sideByRaceMask($this->curTpl['AllowableRace']), // check for FlagsExtra? 0:both; 1: Horde; 2:Alliance 'side' => Util::sideByRaceMask($this->curTpl['AllowableRace']), // check for FlagsExtra? 0:both; 1: Horde; 2:Alliance
'slot' => $this->curTpl['InventoryType'], 'slot' => $this->curTpl['InventoryType'] == 26 ? 15 : $this->curTpl['InventoryType'] == 20 ? 5 : $this->curTpl['InventoryType'],
'slotbak' => $this->curTpl['InventoryType'], 'slotbak' => $this->curTpl['InventoryType'],
'level' => $this->curTpl['ItemLevel'], 'level' => $this->curTpl['ItemLevel'],
'reqlevel' => $this->curTpl['RequiredLevel'], 'reqlevel' => $this->curTpl['RequiredLevel'],

View File

@@ -7,7 +7,7 @@ class PetList extends BaseType
{ {
use ListviewHelper; use ListviewHelper;
protected $setupQuery = 'SELECT *, type as category, id AS ARRAY_KEY FROM ?_pet WHERE [cond] ORDER BY Id ASC'; protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_pet WHERE [cond] ORDER BY Id ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_pet WHERE [cond]'; protected $matchQuery = 'SELECT COUNT(1) FROM ?_pet WHERE [cond]';
public function getListviewData() public function getListviewData()
@@ -53,7 +53,7 @@ class PetList extends BaseType
$gathered[] = (int)$this->curTpl['spellId'.$i]; $gathered[] = (int)$this->curTpl['spellId'.$i];
if ($gathered) if ($gathered)
(new SpellList(array(['id', $gathered])))->addGlobalsToJscript($refs); (new SpellList(array(['s.id', $gathered])))->addGlobalsToJscript($refs);
} }
public function addRewardsToJScript(&$ref) { } public function addRewardsToJScript(&$ref) { }

View File

@@ -161,7 +161,7 @@ class QuestList extends BaseType
(new ItemList(array(['i.entry', $items])))->addGlobalsToJscript($refs); (new ItemList(array(['i.entry', $items])))->addGlobalsToJscript($refs);
if ($spells) if ($spells)
(new SpellList(array(['id', $spells])))->addGlobalsToJscript($refs); (new SpellList(array(['s.id', $spells])))->addGlobalsToJscript($refs);
if ($titles) if ($titles)
(new TitleList(array(['id', $titles])))->addGlobalsToJscript($refs); (new TitleList(array(['id', $titles])))->addGlobalsToJscript($refs);

View File

@@ -10,9 +10,11 @@ class SpellList extends BaseType
private $spellVars = []; private $spellVars = [];
private $refSpells = []; private $refSpells = [];
private $interactive = false;
private $charLevel = MAX_LEVEL;
protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_spell WHERE [filter] [cond] GROUP BY Id ORDER BY Id ASC'; protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_spell s WHERE [filter] [cond] GROUP BY Id ORDER BY Id ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_spell WHERE [filter] [cond]'; protected $matchQuery = 'SELECT COUNT(1) FROM ?_spell s WHERE [filter] [cond]';
public function __construct($conditions, $applyFilter = false) public function __construct($conditions, $applyFilter = false)
{ {
@@ -226,11 +228,11 @@ class SpellList extends BaseType
} }
// description-, buff-parsing component // description-, buff-parsing component
private function resolveEvaluation($formula, $level) private function resolveEvaluation($formula)
{ {
// todo: define unresolvable texts like AP, MHW, ect // todo: define unresolvable texts like AP, MHW, ect
$pl = $PL = $level; $pl = $PL = $this->charLevel;
$PlayerName = Lang::$main['name']; $PlayerName = Lang::$main['name'];
$cond = $COND = function($a, $b, $c) { return $a ? $b : $c; }; $cond = $COND = function($a, $b, $c) { return $a ? $b : $c; };
$eq = $EQ = function($a, $b) { return $a == $b; }; $eq = $EQ = function($a, $b) { return $a == $b; };
@@ -251,7 +253,7 @@ class SpellList extends BaseType
} }
// description-, buff-parsing component // description-, buff-parsing component
private function resolveVariableString($variable, $level, $interactive) private function resolveVariableString($variable)
{ {
$signs = ['+', '-', '/', '*', '%', '^']; $signs = ['+', '-', '/', '*', '%', '^'];
@@ -270,7 +272,7 @@ class SpellList extends BaseType
// cache at least some lookups.. should be moved to single spellList :/ // cache at least some lookups.. should be moved to single spellList :/
if ($lookup && !isset($this->refSpells[$lookup])) if ($lookup && !isset($this->refSpells[$lookup]))
$this->refSpells[$lookup] = new SpellList(array(['id', $lookup])); $this->refSpells[$lookup] = new SpellList(array(['s.id', $lookup]));
switch ($var) switch ($var)
{ {
@@ -296,45 +298,6 @@ class SpellList extends BaseType
eval("\$base = $base $op $oparg;"); eval("\$base = $base $op $oparg;");
return $base; return $base;
/* where the heck is this var...?
case 'c': // BasePoints (raw)
if ($lookup > 0 && $exprData[0])
$spell = DB::Aowow()->selectRow('SELECT effect'.$exprData[0].'BasePoints, effect'.$exprData[0].'AuraId, effect'.$exprData[0].'MiscValue FROM ?_spell WHERE id=? LIMIT 1', $lookup);
else
$spell = $this->curTpl;
$base = $spell['effect'.$exprData[0].'BasePoints'] + 1;
if (in_array($op, $signs) && is_numeric($oparg) && is_numeric($base))
eval("\$base = $base $op $oparg;");
// Aura giving combat ratings (click-interactive)
$rType = 0;
if ($spell['effect'.$exprData[0].'AuraId'] == 189)
{
$mv = $spell['effect'.$exprData[0].'MiscValue'];
for ($j = 0; $j < count(Util::$combatRatingToItemMod); $j++)
{
if (!Util::$combatRatingToItemMod[$j])
continue;
if (($mv & (1 << $j)) == 0)
continue;
$rType = Util::$combatRatingToItemMod[$j];
break;
}
}
// Aura end
if ($rType && $interactive)
$str .= '<!--rtg'.$rType.'-->'.$base."&nbsp;<small>(".Util::setRatingLevel($level, $rType, $base).")</small>";
else
$str .= $base;
$lastvalue = $base;
break;
*/
case 'd': // SpellDuration case 'd': // SpellDuration
case 'D': // todo: min/max? case 'D': // todo: min/max?
if ($lookup) if ($lookup)
@@ -348,7 +311,7 @@ class SpellList extends BaseType
if ($op && is_numeric($oparg) && is_numeric($base)) if ($op && is_numeric($oparg) && is_numeric($base))
eval("\$base = $base $op $oparg;"); eval("\$base = $base $op $oparg;");
return Util::formatTime(abs($base), true); return explode(' ', Util::formatTime(abs($base), true));
case 'e': // EffectValueMultiplier case 'e': // EffectValueMultiplier
case 'E': case 'E':
if ($lookup) if ($lookup)
@@ -373,7 +336,7 @@ class SpellList extends BaseType
return $base; return $base;
case 'g': // boolean choice with casters gender as condition $gX:Y; case 'g': // boolean choice with casters gender as condition $gX:Y;
case 'G': case 'G':
return '&gt;'.$switch[0].'/'.$switch[1].'&lt;'; return '&lt;'.$switch[0].'/'.$switch[1].'&gt;';
case 'h': // ProcChance case 'h': // ProcChance
case 'H': case 'H':
if ($lookup) if ($lookup)
@@ -443,8 +406,8 @@ class SpellList extends BaseType
} }
// Aura end // Aura end
if ($rType && $interactive) if ($rType && $this->interactive)
return '<!--rtg'.$rType.'-->'.abs($base)."&nbsp;<small>(".Util::setRatingLevel($level, $rType, abs($base)).")</small>"; return '<!--rtg'.$rType.'-->'.abs($base)."&nbsp;<small>(".Util::setRatingLevel($this->charLevel, $rType, abs($base)).")</small>";
else else
return $base; return $base;
case 'n': // ProcCharges case 'n': // ProcCharges
@@ -553,8 +516,8 @@ class SpellList extends BaseType
} }
// Aura end // Aura end
if ($rType && $equal && $interactive) if ($rType && $equal && $this->interactive)
return '<!--rtg'.$rType.'-->'.$min."&nbsp;<small>(".Util::setRatingLevel($level, $rType, $min).")</small>"; return '<!--rtg'.$rType.'-->'.$min."&nbsp;<small>(".Util::setRatingLevel($this->charLevel, $rType, $min).")</small>";
else else
return $min . (!$equal ? Lang::$game['valueDelim'] . $max : null); return $min . (!$equal ? Lang::$game['valueDelim'] . $max : null);
case 't': // Periode case 't': // Periode
@@ -607,7 +570,7 @@ class SpellList extends BaseType
} }
// description-, buff-parsing component // description-, buff-parsing component
private function resolveFormulaString($formula, $precision = 0, $level, $interactive) private function resolveFormulaString($formula, $precision = 0)
{ {
// step 1: formula unpacking redux // step 1: formula unpacking redux
while (($formStartPos = strpos($formula, '${')) !== false) while (($formStartPos = strpos($formula, '${')) !== false)
@@ -643,7 +606,7 @@ class SpellList extends BaseType
++$formCurPos; // for some odd reason the precision decimal survives if wo dont increment further.. ++$formCurPos; // for some odd reason the precision decimal survives if wo dont increment further..
} }
$formOutStr = $this->resolveFormulaString($formOutStr, $formPrecision, $level, $interactive); $formOutStr = $this->resolveFormulaString($formOutStr, $formPrecision)
$formula = substr_replace($formula, $formOutStr, $formStartPos, ($formCurPos - $formStartPos)); $formula = substr_replace($formula, $formOutStr, $formStartPos, ($formCurPos - $formStartPos));
} }
@@ -651,6 +614,7 @@ class SpellList extends BaseType
// step 2: resolve variables // step 2: resolve variables
$pos = 0; // continue strpos-search from this offset $pos = 0; // continue strpos-search from this offset
$str = ''; $str = '';
$suffix = '';
while (($npos = strpos($formula, '$', $pos)) !== false) while (($npos = strpos($formula, '$', $pos)) !== false)
{ {
if ($npos != $pos) if ($npos != $pos)
@@ -667,15 +631,24 @@ class SpellList extends BaseType
continue; continue;
} }
$pos += strlen($result[0]); $pos += strlen($result[0]);
$str .= $this->resolveVariableString($result, $level, $interactive);
$var = $this->resolveVariableString($result);
if (is_array($var))
{
$str .= $var[0];
$suffix = $var[1];
}
else
$str .= $var;
} }
$str .= substr($formula, $pos); $str .= substr($formula, $pos);
$str = str_replace('#', '$', $str); // reset marks $str = str_replace('#', '$', $str); // reset marks
// step 3: try to evaluate result // step 3: try to evaluate result
$evaled = $this->resolveEvaluation($str, $level); $evaled = $this->resolveEvaluation($str);
return (float)$evaled ? number_format($evaled, $precision) : $evaled; $return = is_numeric($evaled) ? number_format($evaled, $precision) : $evaled;
return $return.' '.$suffix;
} }
// should probably used only once to create ?_spell. come to think of it, it yields the same results every time.. it absolutely has to! // should probably used only once to create ?_spell. come to think of it, it yields the same results every time.. it absolutely has to!
@@ -755,6 +728,8 @@ class SpellList extends BaseType
$gt(a, b) - a > b $gt(a, b) - a > b
*/ */
$this->interactive = $interactive;
$this->charLevel = $level;
// step 0: get text // step 0: get text
$data = Util::localizedString($this->curTpl, $type); $data = Util::localizedString($this->curTpl, $type);
@@ -898,15 +873,15 @@ class SpellList extends BaseType
$formCurPos++; $formCurPos++;
} }
// check for precision-modifiers .. yes, the precrements fullfill a role! $formCurPos++;
if ($formCurPos + 2 < strlen($data) && $data[++$formCurPos] == '.')
if ($prec = $data[++$formCurPos])
{
$formPrecision = (int)$prec;
++$formCurPos; // for some odd reason the precision decimal survives if wo dont increment further..
}
$formOutStr = $this->resolveFormulaString($formOutStr, $formPrecision, $level, $interactive); // check for precision-modifiers
if ($formCurPos + 1 < strlen($data) && $data[$formCurPos] == '.' && is_numeric($data[$formCurPos + 1]))
{
$formPrecision = $data[$formCurPos + 1];
$formCurPos += 2;
}
$formOutStr = $this->resolveFormulaString($formOutStr, $formPrecision);
$data = substr_replace($data, $formOutStr, $formStartPos, ($formCurPos - $formStartPos)); $data = substr_replace($data, $formOutStr, $formStartPos, ($formCurPos - $formStartPos));
} }
@@ -933,16 +908,19 @@ class SpellList extends BaseType
$pos += strlen($result[0]); $pos += strlen($result[0]);
$resolved = $this->resolveVariableString($result, $level, $interactive); $var = $this->resolveVariableString($result);
$resolved = is_array($var) ? $var[0] : $var;
$str .= is_numeric($resolved) ? abs($resolved) : $resolved; $str .= is_numeric($resolved) ? abs($resolved) : $resolved;
if (is_array($var))
$str .= ' '.$var[1];
} }
$str .= substr($data, $pos); $str .= substr($data, $pos);
$str = str_replace('#', '$', $str); // reset marks $str = str_replace('#', '$', $str); // reset marks
// step 5: variable-depentant variable-text // step 5: variable-depentant variable-text
// special case $lONE:ELSE; // special case $lONE:ELSE;
while (preg_match('/([\d\.]+) \$l([\w\s]*):([\w\s]*);/i', $str, $m)) while (preg_match('/([\d\.]+)([^\d]*)\$l([\w\s]*):([\w\s]*);/i', $str, $m))
$str = str_replace($m[1].' $l'.$m[2].':'.$m[3].';', $m[1].' '.($m[1] == 1 ? $m[2] : $m[3]), $str); $str = str_replace($m[1].$m[2].'$l'.$m[3].':'.$m[4].';', $m[1].$m[2].($m[1] == 1 ? $m[3] : $m[4]), $str);
// step 6: HTMLize // step 6: HTMLize
// colors // colors
@@ -1035,7 +1013,7 @@ class SpellList extends BaseType
// get description // get description
$desc = $this->parseText('description'); $desc = $this->parseText('description');
$reqWrapper = $this->curTpl['rangeMaxHostile'] && ($this->curTpl['powerCost'] > 0 || $this->curTpl['powerCostPercent'] > 0); $reqWrapper = $this->curTpl['rangeMaxHostile'] && ($this->curTpl['powerCost'] > 0 || $this->curTpl['powerCostPercent'] > 0 || ($this->curTpl['powerCostRunes'] & 0x333));
$reqWrapper2 = $reagents ||$tools || $desc; $reqWrapper2 = $reagents ||$tools || $desc;
$x = ''; $x = '';
@@ -1052,7 +1030,8 @@ class SpellList extends BaseType
// rank // rank
if (!empty($rankText)) if (!empty($rankText))
$x .= '<br /></td><th><b class="q0">'.$rankText.'</b></th></tr></table>'; $x .= '<br /></td><th><b class="q0">'.$rankText.'</b></th></tr></table>';
else
$x .= '<br>';
if ($reqWrapper) if ($reqWrapper)
$x .= '<table width="100%"><tr><td>'; $x .= '<table width="100%"><tr><td>';
@@ -1064,7 +1043,19 @@ class SpellList extends BaseType
if ($this->curTpl['powerCostPercent'] > 0) if ($this->curTpl['powerCostPercent'] > 0)
$x .= $this->curTpl['powerCostPercent']."% ".sprintf(Lang::$spell['pctCostOf'], strtolower(Lang::$spell['powerTypes'][$pt])); $x .= $this->curTpl['powerCostPercent']."% ".sprintf(Lang::$spell['pctCostOf'], strtolower(Lang::$spell['powerTypes'][$pt]));
else if ($this->curTpl['powerCost'] > 0 || $this->curTpl['powerPerSecond'] > 0 || $this->curTpl['powerCostPerLevel'] > 0) else if ($this->curTpl['powerCost'] > 0 || $this->curTpl['powerPerSecond'] > 0 || $this->curTpl['powerCostPerLevel'] > 0)
$x .= ($pt == 1 ? $this->curTpl['powerCost'] / 10 : $this->curTpl['powerCost']).' '.ucFirst(Lang::$spell['powerTypes'][$pt]); $x .= ($pt == 1 || $pt == 6 ? $this->curTpl['powerCost'] / 10 : $this->curTpl['powerCost']).' '.ucFirst(Lang::$spell['powerTypes'][$pt]);
else if ($rCost = ($this->curTpl['powerCostRunes'] & 0x333))
{ // Blood 2|1 - Unholy 2|1 - Frost 2|1
$runes = [];
if ($_ = (($rCost & 0x300) >> 8))
$runes[] = $_." ".Lang::$spell['powerRunes'][2];
if ($_ = (($rCost & 0x030) >> 4))
$runes[] = $_." ".Lang::$spell['powerRunes'][1];
if ($_ = ($rCost & 0x003))
$runes[] = $_." ".Lang::$spell['powerRunes'][0];
$x .= implode(', ', $runes);
}
// append periodic cost // append periodic cost
if ($this->curTpl['powerPerSecond'] > 0) if ($this->curTpl['powerPerSecond'] > 0)
@@ -1102,7 +1093,7 @@ class SpellList extends BaseType
// cast times // cast times
if ($this->curTpl['interruptFlagsChannel']) if ($this->curTpl['interruptFlagsChannel'])
$x .= Lang::$spell['channeled']; $x .= Lang::$spell['channeled'];
else if ($this->curTpl['castTime']) else if ($this->curTpl['castTime'] > 0)
$x .= sprintf(Lang::$spell['castIn'], $this->curTpl['castTime'] / 1000); $x .= sprintf(Lang::$spell['castIn'], $this->curTpl['castTime'] / 1000);
else if ($this->curTpl['attributes0'] & 0x10) // SPELL_ATTR0_ABILITY instant ability.. yeah, wording thing only else if ($this->curTpl['attributes0'] & 0x10) // SPELL_ATTR0_ABILITY instant ability.. yeah, wording thing only
$x .= Lang::$spell['instantPhys']; $x .= Lang::$spell['instantPhys'];
@@ -1119,7 +1110,8 @@ class SpellList extends BaseType
$x .= '</tr>'; $x .= '</tr>';
if ($this->curTpl['stanceMask']) // SPELL_ATTR2_NOT_NEED_SHAPESHIFT
if ($this->curTpl['stanceMask'] && ($this->curTpl['attributes2'] & 0x80000) == 0)
$x.= '<tr><td colspan="2">'.Lang::$game['requires'].' '.Lang::getStances($this->curTpl['stanceMask']).'</td></tr>'; $x.= '<tr><td colspan="2">'.Lang::$game['requires'].' '.Lang::getStances($this->curTpl['stanceMask']).'</td></tr>';
$x .= '</table>'; $x .= '</table>';

View File

@@ -33,7 +33,7 @@ define('CACHETYPE_SEARCH', 3);
define('SEARCH_TYPE_REGULAR', 0x10000000); define('SEARCH_TYPE_REGULAR', 0x10000000);
define('SEARCH_TYPE_OPEN', 0x20000000); define('SEARCH_TYPE_OPEN', 0x20000000);
define('SEARCH_TYPE_JSON', 0x40000000); define('SEARCH_TYPE_JSON', 0x40000000);
define('SEARCH_MASK_OPEN', 0x007DC0FF); // open search define('SEARCH_MASK_OPEN', 0x007DC1FF); // open search
define('SEARCH_MASK_ALL', 0x07FFFFFF); // normal search define('SEARCH_MASK_ALL', 0x07FFFFFF); // normal search
// Databases // Databases
@@ -112,27 +112,27 @@ define('SIDE_HORDE', 2);
define('SIDE_BOTH', 3); define('SIDE_BOTH', 3);
// ClassMask // ClassMask
define('CLASS_WARRIOR', 0x1); define('CLASS_WARRIOR', 0x001);
define('CLASS_PALADIN', 0x2); define('CLASS_PALADIN', 0x002);
define('CLASS_HUNTER', 0x4); define('CLASS_HUNTER', 0x004);
define('CLASS_ROGUE', 0x8); define('CLASS_ROGUE', 0x008);
define('CLASS_PRIEST', 0x10); define('CLASS_PRIEST', 0x010);
define('CLASS_DEATHKNIGHT', 0x20); define('CLASS_DEATHKNIGHT', 0x020);
define('CLASS_SHAMAN', 0x40); define('CLASS_SHAMAN', 0x040);
define('CLASS_MAGE', 0x80); define('CLASS_MAGE', 0x080);
define('CLASS_WARLOCK', 0x100); define('CLASS_WARLOCK', 0x100);
define('CLASS_DRUID', 0x400); define('CLASS_DRUID', 0x400);
define('CLASS_MASK_ALL', 0x5FF); define('CLASS_MASK_ALL', 0x5FF);
// RaceMask // RaceMask
define('RACE_HUMAN', 0x1); define('RACE_HUMAN', 0x001);
define('RACE_ORC', 0x2); define('RACE_ORC', 0x002);
define('RACE_DWARF', 0x4); define('RACE_DWARF', 0x004);
define('RACE_NIGHTELF', 0x8); define('RACE_NIGHTELF', 0x008);
define('RACE_UNDEAD', 0x10); define('RACE_UNDEAD', 0x010);
define('RACE_TAUREN', 0x20); define('RACE_TAUREN', 0x020);
define('RACE_GNOME', 0x40); define('RACE_GNOME', 0x040);
define('RACE_TROLL', 0x80); define('RACE_TROLL', 0x080);
define('RACE_BLOODELF', 0x200); define('RACE_BLOODELF', 0x200);
define('RACE_DRAENEI', 0x400); define('RACE_DRAENEI', 0x400);
define('RACE_MASK_ALLIANCE', 0x44D); define('RACE_MASK_ALLIANCE', 0x44D);

View File

@@ -1311,7 +1311,9 @@ class Util
if (!is_array($data)) if (!is_array($data))
return mysql_real_escape_string(trim($data)); return mysql_real_escape_string(trim($data));
array_walk($data, function(&$item, $key) { $item = Util::sqlEscape($item); }); array_walk($data, function(&$item, $key) {
$item = Util::sqlEscape($item);
});
return $data; return $data;
} }
@@ -1368,8 +1370,7 @@ class Util
$arr = explode('.', $str); $arr = explode('.', $str);
foreach ($arr as $i => $a) foreach ($arr as $i => $a)
if (!is_numeric($a)) $arr[$i] = is_numeric($a) ? (int)$a : null;
$arr[$i] = null;
return $arr; return $arr;
} }
@@ -1443,11 +1444,11 @@ class Util
switch ($enchant['type'.$h]) switch ($enchant['type'.$h])
{ {
case 2: case 2:
@$jsonStats[2] += $enchant['amount'.$h]; @$jsonStats[ITEM_MOD_WEAPON_DMG] += $enchant['amount'.$h];
break; break;
case 3: case 3:
case 7: case 7:
$spl = new SpellList(array(['id', (int)$enchant['object'.$h]])); $spl = new SpellList(array(['s.id', (int)$enchant['object'.$h]]));
$gains = $spl->getStatGain(); $gains = $spl->getStatGain();
foreach ($gains as $gain) foreach ($gains as $gain)
@@ -1458,25 +1459,25 @@ class Util
switch ($enchant['object'.$h]) switch ($enchant['object'.$h])
{ {
case 0: // Physical case 0: // Physical
@$jsonStats[50] += $enchant['amount'.$h]; @$jsonStats[ITEM_MOD_ARMOR] += $enchant['amount'.$h];
break; break;
case 1: // Holy case 1: // Holy
@$jsonStats[53] += $enchant['amount'.$h]; @$jsonStats[ITEM_MOD_HOLY_RESISTANCE] += $enchant['amount'.$h];
break; break;
case 2: // Fire case 2: // Fire
@$jsonStats[51] += $enchant['amount'.$h]; @$jsonStats[ITEM_MOD_FIRE_RESISTANCE] += $enchant['amount'.$h];
break; break;
case 3: // Nature case 3: // Nature
@$jsonStats[55] += $enchant['amount'.$h]; @$jsonStats[ITEM_MOD_NATURE_RESISTANCE] += $enchant['amount'.$h];
break; break;
case 4: // Frost case 4: // Frost
@$jsonStats[52] += $enchant['amount'.$h]; @$jsonStats[ITEM_MOD_FROST_RESISTANCE] += $enchant['amount'.$h];
break; break;
case 5: // Shadow case 5: // Shadow
@$jsonStats[54] += $enchant['amount'.$h]; @$jsonStats[ITEM_MOD_SHADOW_RESISTANCE] += $enchant['amount'.$h];
break; break;
case 6: // Arcane case 6: // Arcane
@$jsonStats[56] += $enchant['amount'.$h]; @$jsonStats[ITEM_MOD_ARCANE_RESISTANCE] += $enchant['amount'.$h];
break; break;
} }
break; break;

View File

@@ -255,7 +255,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL: case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL: case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2: case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
$crtSpl = new SpellList(array(['id', $obj])); $crtSpl = new SpellList(array(['s.id', $obj]));
$crtSpl->addGlobalsToJscript($pageData); $crtSpl->addGlobalsToJscript($pageData);
$text = $crtName ? $crtName : $crtSpl->names[$crtSpl->id]; $text = $crtName ? $crtName : $crtSpl->names[$crtSpl->id];
$tmp['link'] = array( $tmp['link'] = array(

View File

@@ -46,7 +46,7 @@ if (!$smarty->loadCache($cacheKey, $pageData))
$acvList = new AchievementList($condition ? [['category', $condition]] : [], true); $acvList = new AchievementList($condition ? [['category', $condition]] : [], true);
if (!$acvList->matches) if (!$acvList->matches)
{ {
$curCats = $catList = [$condition]; $curCats = $catList = [$condition ? $condition : 0];
while ($curCats) while ($curCats)
{ {
$curCats = DB::Aowow()->SelectCol('SELECT Id FROM ?_achievementCategory WHERE parentCategory IN (?a)', $curCats); $curCats = DB::Aowow()->SelectCol('SELECT Id FROM ?_achievementCategory WHERE parentCategory IN (?a)', $curCats);
@@ -89,7 +89,10 @@ if (!$smarty->loadCache($cacheKey, $pageData))
// create note if search limit was exceeded // create note if search limit was exceeded
if ($acvList->matches > $AoWoWconf['sqlLimit']) if ($acvList->matches > $AoWoWconf['sqlLimit'])
{
$pageData['params']['note'] = '$'.sprintf(Util::$filterResultString, 'LANG.lvnote_achievementsfound', $acvList->matches, $AoWoWconf['sqlLimit']); $pageData['params']['note'] = '$'.sprintf(Util::$filterResultString, 'LANG.lvnote_achievementsfound', $acvList->matches, $AoWoWconf['sqlLimit']);
$pageData['params']['_truncated'] = 1;
}
if ($acvList->filterGetError()) if ($acvList->filterGetError())
$pageData['params']['_errors'] = '$1'; $pageData['params']['_errors'] = '$1';

View File

@@ -31,7 +31,10 @@ if (!$smarty->loadCache($cacheKey, $pageData))
// create note if search limit was exceeded // create note if search limit was exceeded
if ($itemsets->matches > $AoWoWconf['sqlLimit']) if ($itemsets->matches > $AoWoWconf['sqlLimit'])
{
$pageData['params']['note'] = '$'.sprintf(Util::$filterResultString, 'LANG.lvnote_itemsetsfound', $itemsets->matches, $AoWoWconf['sqlLimit']); $pageData['params']['note'] = '$'.sprintf(Util::$filterResultString, 'LANG.lvnote_itemsetsfound', $itemsets->matches, $AoWoWconf['sqlLimit']);
$pageData['params']['_truncated'] = 1;
}
if ($itemsets->filterGetError()) if ($itemsets->filterGetError())
$pageData['params']['_errors'] = '$1'; $pageData['params']['_errors'] = '$1';

View File

@@ -21,35 +21,37 @@ if (isset($_GET['power']))
if (!$smarty->loadCache($cacheKeyTooltip, $x)) if (!$smarty->loadCache($cacheKeyTooltip, $x))
{ {
$spell = new SpellList(array(['id', $id])); $spell = new SpellList(array(['s.id', $id]));
if ($spell->error) if ($spell->error)
die('$WowheadPower.registerSpell('.$id.', '.User::$localeId.', {});'); die('$WowheadPower.registerSpell('.$id.', '.User::$localeId.', {});');
$x = '$WowheadPower.registerSpell('.$id.', '.User::$localeId.", {\n"; $x = '$WowheadPower.registerSpell('.$id.', '.User::$localeId.", {\n";
$pt = [];
if ($n = $spell->names[$id]) if ($n = $spell->names[$id])
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($n)."',\n"; $pt[] = "\tname_".User::$localeString.": '".Util::jsEscape($n)."'";
if ($i = $spell->getField('iconString')) if ($i = $spell->getField('iconString'))
$x .= "\ticon: '".Util::jsEscape($i)."',\n"; $pt[] = "\ticon: '".Util::jsEscape($i)."'";
if ($t = $spell->renderTooltip($id)) if ($t = $spell->renderTooltip($id))
$x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($t)."'"; $pt[] = "\ttooltip_".User::$localeString.": '".Util::jsEscape($t)."'";
if ($b = $spell->renderBuff($id)) if ($b = $spell->renderBuff($id))
$x .= ",\n\tbuff_".User::$localeString.": '".Util::jsEscape($b)."'\n"; $pt[] = "\tbuff_".User::$localeString.": '".Util::jsEscape($b)."'";
$x .= '});'; $x .= implode(",\n", $pt)."\n});";
$smarty->saveCache($cacheKeyTooltip, $x); $smarty->saveCache($cacheKeyTooltip, $x);
} }
die($x); die($x);
} }
if (!$smarty->loadCache($cacheKeyPage, $pageData)) if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$spell = new SpellList(array(['id', $id])); $spell = new SpellList(array(['s.id', $id]));
// v there be dragons v // v there be dragons v
// Spelldata // Spelldata
if ($spellObj = new SpellList(array(['id', $id]))) if ($spellObj = new SpellList(array(['s.id', $id])))
{ {
$row = $spellObj->template; // equivalent to 5 layers of panzertape $row = $spellObj->template; // equivalent to 5 layers of panzertape

View File

@@ -243,7 +243,10 @@ if ($searchMask & 0x10)
); );
if ($money->matches > $maxResults) if ($money->matches > $maxResults)
{
$found['currency']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_currenciesfound', $money->matches, $maxResults); $found['currency']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_currenciesfound', $money->matches, $maxResults);
$found['currency']['params']['_truncated'] = 1;
}
} }
} }
@@ -268,7 +271,10 @@ if ($searchMask & 0x20)
); );
if ($sets->matches > $maxResults) if ($sets->matches > $maxResults)
{
$found['itemset']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_itemsetsfound', $sets->matches, $maxResults); $found['itemset']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_itemsetsfound', $sets->matches, $maxResults);
$found['itemset']['params']['_truncated'] = 1;
}
} }
} }
@@ -305,7 +311,10 @@ if ($searchMask & 0x40)
); );
if ($items->matches > $maxResults) if ($items->matches > $maxResults)
{
$found['item']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_itemsfound', $items->matches, $maxResults); $found['item']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_itemsfound', $items->matches, $maxResults);
$found['item']['params']['_truncated'] = 1;
}
} }
} }
@@ -360,7 +369,10 @@ if ($searchMask & 0x10000)
); );
if ($acvs->matches > $maxResults) if ($acvs->matches > $maxResults)
{
$found['achievement']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_achievementsfound', $acvs->matches, $maxResults); $found['achievement']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_achievementsfound', $acvs->matches, $maxResults);
$found['achievement']['params']['_truncated'] = 1;
}
} }
} }
@@ -387,7 +399,10 @@ if ($searchMask & 0x20000)
); );
if ($stats->matches > $maxResults) if ($stats->matches > $maxResults)
{
$found['statistic']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_statisticsfound', $stats->matches, $maxResults); $found['statistic']['params']['note'] = '$'.sprintf(Util::$narrowResultString, 'LANG.lvnote_statisticsfound', $stats->matches, $maxResults);
$found['statistic']['params']['_truncated'] = 1;
}
} }
} }

View File

@@ -132,7 +132,7 @@ if (!defined('AOWOW_REVISION'))
if ($pop['glyphEffect']) if ($pop['glyphEffect'])
$glyphSpells[] = $pop['glyphEffect']; $glyphSpells[] = $pop['glyphEffect'];
$glyphSpells = new SpellList(array(['id', $glyphSpells])); $glyphSpells = new SpellList(array(['s.id', $glyphSpells]));
foreach ($locales as $lId) foreach ($locales as $lId)
{ {

View File

@@ -113,7 +113,7 @@ if (!defined('AOWOW_REVISION'))
// costy and locale-independant -> cache // costy and locale-independant -> cache
if (!isset($jsonBonus[$set['spell'.$i]])) if (!isset($jsonBonus[$set['spell'.$i]]))
{ {
$bSpell = new SpellList(array(['id', $set['spell'.$i]])); $bSpell = new SpellList(array(['s.id', $set['spell'.$i]]));
$jsonBonus[$set['spell'.$i]] = $bSpell->getStatGain(); $jsonBonus[$set['spell'.$i]] = $bSpell->getStatGain();
} }

View File

@@ -114,7 +114,7 @@ if (!defined('AOWOW_REVISION'))
for ($k = 0; $k <= ($m - 1); $k++) for ($k = 0; $k <= ($m - 1); $k++)
{ {
$tSpell = new SpellList(array(['id', $talents[$j]['rank'.($k + 1)]])); $tSpell = new SpellList(array(['s.id', $talents[$j]['rank'.($k + 1)]]));
$d[] = $tSpell->parseText(); $d[] = $tSpell->parseText();
$s[] = $talents[$j]['rank'.($k + 1)]; $s[] = $talents[$j]['rank'.($k + 1)];

View File

@@ -274,7 +274,7 @@ for ($i = 1; $i < 9; $i++)
if ($set['spellId'.$i] > 0) if ($set['spellId'.$i] > 0)
$spells[] = (int)$set['spellId'.$i]; $spells[] = (int)$set['spellId'.$i];
$bonusSpells = new SpellList(array(['id', $spells])); $bonusSpells = new SpellList(array(['s.id', $spells]));
$mods = $bonusSpells->getStatGain(); $mods = $bonusSpells->getStatGain();

View File

@@ -5,7 +5,6 @@
{if !isset($params.tabs)}tabs:tabsRelated,{/if} {if !isset($params.tabs)}tabs:tabsRelated,{/if}
{if !isset($params.name)}name:LANG.tab_achievements,{/if} {if !isset($params.name)}name:LANG.tab_achievements,{/if}
{if !isset($params.parent)}parent:'listview-generic',{/if} {if !isset($params.parent)}parent:'listview-generic',{/if}
{if isset($params.note)}_truncated: 1,{/if}
{foreach from=$params key=k item=v} {foreach from=$params key=k item=v}
{if $v[0] == '$'} {if $v[0] == '$'}
{$k}:{$v|substr:1}, {$k}:{$v|substr:1},

View File

@@ -5,7 +5,6 @@
{if !isset($params.tabs)}tabs:tabsRelated,{/if} {if !isset($params.tabs)}tabs:tabsRelated,{/if}
{if !isset($params.name)}name:LANG.tab_calendar,{/if} {if !isset($params.name)}name:LANG.tab_calendar,{/if}
{if !isset($params.parent)}parent:'listview-generic',{/if} {if !isset($params.parent)}parent:'listview-generic',{/if}
{if isset($params.note)}_truncated: 1,{/if}
{foreach from=$params key=k item=v} {foreach from=$params key=k item=v}
{if $v[0] == '$'} {if $v[0] == '$'}
{$k}:{$v|substr:1}, {$k}:{$v|substr:1},

View File

@@ -5,7 +5,6 @@
{if !isset($params.tabs)}tabs:'listview-generic',{/if} {if !isset($params.tabs)}tabs:'listview-generic',{/if}
{if !isset($params.name)}name:LANG.tab_classes,{/if} {if !isset($params.name)}name:LANG.tab_classes,{/if}
{if !isset($params.parent)}parent:'listview-generic',{/if} {if !isset($params.parent)}parent:'listview-generic',{/if}
{if isset($params.note)}_truncated: 1,{/if}
{foreach from=$params key=k item=v} {foreach from=$params key=k item=v}
{if $v[0] == '$'} {if $v[0] == '$'}
{$k}:{$v|substr:1}, {$k}:{$v|substr:1},

View File

@@ -5,7 +5,6 @@
{if !isset($params.tabs)}tabs:'listview-generic',{/if} {if !isset($params.tabs)}tabs:'listview-generic',{/if}
{if !isset($params.name)}name:LANG.tab_currencies,{/if} {if !isset($params.name)}name:LANG.tab_currencies,{/if}
{if !isset($params.parent)}parent:'listview-generic',{/if} {if !isset($params.parent)}parent:'listview-generic',{/if}
{if isset($params.note)}_truncated: 1,{/if}
{foreach from=$params key=k item=v} {foreach from=$params key=k item=v}
{if $v[0] == '$'} {if $v[0] == '$'}
{$k}:{$v|substr:1}, {$k}:{$v|substr:1},

View File

@@ -5,7 +5,6 @@
{if !isset($params.tabs)}tabs:tabsRelated,{/if} {if !isset($params.tabs)}tabs:tabsRelated,{/if}
{if !isset($params.name)}name:LANG.tab_holidays,{/if} {if !isset($params.name)}name:LANG.tab_holidays,{/if}
{if !isset($params.parent)}parent:'listview-generic',{/if} {if !isset($params.parent)}parent:'listview-generic',{/if}
{if isset($params.note)}_truncated: 1,{/if}
{foreach from=$params key=k item=v} {foreach from=$params key=k item=v}
{if $v[0] == '$'} {if $v[0] == '$'}
{$k}:{$v|substr:1}, {$k}:{$v|substr:1},

View File

@@ -5,7 +5,6 @@
{if !isset($params.tabs)}tabs:'listview-generic',{/if} {if !isset($params.tabs)}tabs:'listview-generic',{/if}
{if !isset($params.name)}name:LANG.tab_items,{/if} {if !isset($params.name)}name:LANG.tab_items,{/if}
{if !isset($params.parent)}parent:'listview-generic',{/if} {if !isset($params.parent)}parent:'listview-generic',{/if}
{if isset($params.note)}_truncated: 1,{/if}
{foreach from=$params key=k item=v} {foreach from=$params key=k item=v}
{if $v[0] == '$'} {if $v[0] == '$'}
{$k}:{$v|substr:1}, {$k}:{$v|substr:1},

View File

@@ -5,7 +5,6 @@
{if !isset($params.tabs)}tabs:'listview-generic',{/if} {if !isset($params.tabs)}tabs:'listview-generic',{/if}
{if !isset($params.name)}name:LANG.tab_itemsets,{/if} {if !isset($params.name)}name:LANG.tab_itemsets,{/if}
{if !isset($params.parent)}parent:'listview-generic',{/if} {if !isset($params.parent)}parent:'listview-generic',{/if}
{if isset($params.note)}_truncated: 1,{/if}
{foreach from=$params key=k item=v} {foreach from=$params key=k item=v}
{if $v[0] == '$'} {if $v[0] == '$'}
{$k}:{$v|substr:1}, {$k}:{$v|substr:1},

View File

@@ -23,7 +23,6 @@ var _ = function(family)
{if !isset($params.tabs)}tabs:'tabs-generic',{/if} {if !isset($params.tabs)}tabs:'tabs-generic',{/if}
{if !isset($params.name)}name:LANG.tab_pets,{/if} {if !isset($params.name)}name:LANG.tab_pets,{/if}
{if !isset($params.parent)}parent:'listview-generic',{/if} {if !isset($params.parent)}parent:'listview-generic',{/if}
{if isset($params.note)}_truncated: 1,{/if}
{foreach from=$params key=k item=v} {foreach from=$params key=k item=v}
{if $v[0] == '$'} {if $v[0] == '$'}
{$k}:{$v|substr:1}, {$k}:{$v|substr:1},

View File

@@ -5,7 +5,6 @@
{if !isset($params.tabs)}tabs:tabsRelated,{/if} {if !isset($params.tabs)}tabs:tabsRelated,{/if}
{if !isset($params.name)}name:LANG.tab_quests,{/if} {if !isset($params.name)}name:LANG.tab_quests,{/if}
{if !isset($params.parent)}parent:'listview-generic',{/if} {if !isset($params.parent)}parent:'listview-generic',{/if}
{if isset($params.note)}_truncated: 1,{/if}
{foreach from=$params key=k item=v} {foreach from=$params key=k item=v}
{if $v[0] == '$'} {if $v[0] == '$'}
{$k}:{$v|substr:1}, {$k}:{$v|substr:1},

View File

@@ -5,7 +5,6 @@
{if !isset($params.tabs)}tabs:'listview-generic',{/if} {if !isset($params.tabs)}tabs:'listview-generic',{/if}
{if !isset($params.name)}name:LANG.tab_races,{/if} {if !isset($params.name)}name:LANG.tab_races,{/if}
{if !isset($params.parent)}parent:'listview-generic',{/if} {if !isset($params.parent)}parent:'listview-generic',{/if}
{if isset($params.note)}_truncated: 1,{/if}
{foreach from=$params key=k item=v} {foreach from=$params key=k item=v}
{if $v[0] == '$'} {if $v[0] == '$'}
{$k}:{$v|substr:1}, {$k}:{$v|substr:1},

View File

@@ -5,7 +5,6 @@
{if !isset($params.tabs)}tabs:'listview-generic',{/if} {if !isset($params.tabs)}tabs:'listview-generic',{/if}
{if !isset($params.name)}name:LANG.tab_titles,{/if} {if !isset($params.name)}name:LANG.tab_titles,{/if}
{if !isset($params.parent)}parent:'listview-generic',{/if} {if !isset($params.parent)}parent:'listview-generic',{/if}
{if isset($params.note)}_truncated: 1,{/if}
{foreach from=$params key=k item=v} {foreach from=$params key=k item=v}
{if $v[0] == '$'} {if $v[0] == '$'}
{$k}:{$v|substr:1}, {$k}:{$v|substr:1},

View File

@@ -422,7 +422,7 @@ Mapper.prototype = {
setZones: function(div, zones) setZones: function(div, zones)
{ {
// div = $('#'+div); // div = $('#'+div);
div = ge('#'+div); div = ge(div);
if(!div || !zones || zones.length == 0 || !this.objectives) if(!div || !zones || zones.length == 0 || !this.objectives)
return; return;
@@ -971,12 +971,22 @@ Mapper.prototype = {
if(this.sToggle) if(this.sToggle)
this.sToggle.style.display = (this.toggle && this.nCoords ? '' : 'none'); this.sToggle.style.display = (this.toggle && this.nCoords ? '' : 'none');
//if(!noScroll) if(!noScroll)
// g_scrollTo(this.parent, 3); g_scrollTo(this.parent, 3);
// qhat the heck did this do..? // replacement start
// $('.line', this.floorPins[level]).hide(); // $('.line', this.floorPins[level]).hide();
// $('.line.' + Mapper.sizes[this.zoom][2], this.floorPins[level]).show(); // $('.line.' + Mapper.sizes[this.zoom][2], this.floorPins[level]).show();
if (this.floorPins[level]) {
var lines = this.floorPins[level].getElementsByClassName('line');
for (i in lines)
lines[i].display = 'none';
lines = this.floorPins[level].getElementsByClassName('line ' + Mapper.sizes[this.zoom][2]);
for (i in lines)
lines[i].display = 'block';
}
// end of replacement
this.onMapUpdate && this.onMapUpdate(this); this.onMapUpdate && this.onMapUpdate(this);
}, },

View File

@@ -448,6 +448,11 @@ function eO(b) {
delete b[a] delete b[a]
} }
} }
function dO(s) {
function f(){};
f.prototype = s;
return new f;
}
function cO(c, a) { function cO(c, a) {
for (var b in a) { for (var b in a) {
if (a[b] !== null && typeof a[b] == "object" && a[b].length) { if (a[b] !== null && typeof a[b] == "object" && a[b].length) {