Files
aowow/includes/class.itemset.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

87 lines
2.8 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
class ItemsetList extends BaseType
{
private $classes = []; // used to build g_classes
public $pieceToSet = []; // used to build g_items and search
protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_itemset WHERE [filter] [cond] ORDER BY maxlevel DESC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_itemset WHERE [filter] [cond]';
public function __construct($data, $applyFilter = false)
{
parent::__construct($data, $applyFilter);
// post processing
while ($this->iterate())
{
$this->templates[$this->id]['classes'] = [];
$this->templates[$this->id]['pieces'] = [];
for ($i = 1; $i < 12; $i++)
{
if ($this->curTpl['classMask'] & (1 << $i))
{
$this->classes[] = $i + 1;
$this->templates[$this->id]['classes'][] = $i + 1;
}
}
for ($i = 1; $i < 10; $i++)
{
if ($piece = $this->curTpl['item'.$i])
{
$this->templates[$this->id]['pieces'][] = $piece;
$this->pieceToSet[$piece] = $this->id;
}
}
}
$this->reset();
$this->classes = array_unique($this->classes);
}
public function getListviewData()
{
$data = [];
while ($this->iterate())
{
$data[$this->id] = array(
'id' => $this->id,
'idbak' => $this->curTpl['refSetId'],
'name' => $this->getField('name', true),
'quality' => 7 - $this->curTpl['quality'],
'minlevel' => $this->curTpl['minLevel'],
'maxlevel' => $this->curTpl['maxLevel'],
'note' => $this->curTpl['contentGroup'],
'type' => $this->curTpl['type'],
'heroic' => $this->curTpl['heroic'] == 1, // we want to be bool
'reqclass' => $this->curTpl['classMask'],
'classes' => $this->curTpl['classes'],
'pieces' => $this->curTpl['pieces'],
'heroic' => $this->curTpl['heroic']
);
}
return $data;
}
public function addGlobalsToJscript(&$refs)
{
if ($this->classes)
(new CharClassList(array(['id', $this->classes])))->addGlobalsToJscript($refs);
if ($this->pieceToSet)
(new ItemList(array(['i.entry', array_keys($this->pieceToSet)], 0)))->addGlobalsToJscript($refs);
}
public function addRewardsToJScript(&$ref) { }
public function renderTooltip() { }
}
?>