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() { } } ?>