Files
aowow/includes/class.pet.php
Sarjuuk 732226b44a BaseType:
- dropped property "names" and changed getField to return localized Fields if specified. Dropped stupid getNameFieldName() in the process as it was now obsolete.
 - made property "matches" private. Access through getMatches() that will execute the query _only_ when needed (which is basically always anyway (so much for optimization))

SpellList: parsing
 - ""fixed"" behavior of the amount-switch $l when used on russian text. It has 3 options instead of 2, no idea what the last one is for though
 - fixed extra leading whitespace occuring when parsing formulas

Lang:
 - removed offset from getMagicShools(), apparently it is unneeded :o

Util:
 - changed the output of formatTime() in the long version to be more correct in layout
 - initialized values in parseTime() to prevent empty strings returned by formatTime()
 - added asBin() and asHex() - helper to improve display of bitmasks (Spells are coming!)
 - update Spell-Effects/Auras and added misc strings to display different MiscValue-content

Filter:
 - removed escapes from $_POST-handler. If the input is erronous it should be corrected/ignored/noted by the $_GET-handler

Smarty:
 - added optinal parameter to saveCache(), loadCache() to better handle filter variables

Search:
 - changed $maxResults to 10 for OpenSearches in an effort to lower execution time and appied limits to all queries
 - changed result calculation for OpenSearch. It should now stick to it's limit of 10 results for the list
 - simplified WorldEvent search

global.js:
 - backported function to parse title-tag of dfn-elements into mouseover-tooltips
 - shortened document.getElementByTagName(x) calls to gE(document, x)
2013-04-26 17:02:35 +02:00

64 lines
2.0 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
class PetList extends BaseType
{
use ListviewHelper;
protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_pet WHERE [cond] ORDER BY Id ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_pet WHERE [cond]';
public function getListviewData()
{
$data = [];
while ($this->iterate())
{
$data[$this->id] = array(
'armor' => $this->curTpl['armor'],
'damage' => $this->curTpl['damage'],
'health' => $this->curTpl['health'],
'diet' => $this->curTpl['foodMask'],
'icon' => $this->curTpl['iconString'],
'id' => $this->id,
'maxlevel' => $this->curTpl['maxLevel'],
'minlevel' => $this->curTpl['minLevel'],
'name' => $this->getField('name', true),
'type' => $this->curTpl['type'],
'exotic' => $this->curTpl['exotic'],
'spells' => []
);
if ($this->curTpl['expansion'] > 0)
$data[$this->id]['expansion'] = $this->curTpl['expansion'];
for ($i = 1; $i <= 4; $i++)
if ($this->curTpl['spellId'.$i] > 0)
$data[$this->id]['spells'][] = $this->curTpl['spellId'.$i];
$data[$this->id]['spells'] = json_encode($data[$this->id]['spells'], JSON_NUMERIC_CHECK);
}
return $data;
}
public function addGlobalsToJscript(&$refs)
{
$gathered = [];
while ($this->iterate())
for ($i = 1; $i <= 4; $i++)
if ($this->curTpl['spellId'.$i] > 0)
$gathered[] = (int)$this->curTpl['spellId'.$i];
if ($gathered)
(new SpellList(array(['s.id', $gathered])))->addGlobalsToJscript($refs);
}
public function addRewardsToJScript(&$ref) { }
public function renderTooltip() { }
}
?>