[['ic']], 'ic' => ['j' => ['?_icons ic ON ic.`id` = c.`iconId`', true], 's' => ', ic.`name` AS "iconString"'] ); public function __construct(array $conditions = [], array $miscData = []) { parent::__construct($conditions, $miscData); foreach ($this->iterate() as &$_curTpl) $_curTpl['iconString'] = $_curTpl['iconString'] ?: DEFAULT_ICON; } public function getListviewData() : array { $data = []; foreach ($this->iterate() as $__) { $data[$this->id] = array( 'id' => $this->id, 'category' => $this->curTpl['category'], 'name' => $this->getField('name', true), 'icon' => $this->curTpl['iconString'] ); } return $data; } public function getJSGlobals(int $addMask = 0) : array { $data = []; foreach ($this->iterate() as $__) { // todo (low): un-hardcode icon strings $icon = match ($this->id) { CURRENCY_HONOR_POINTS => ['pvp-currency-alliance', 'pvp-currency-horde' ], CURRENCY_ARENA_POINTS => ['pvp-arenapoints-icon', 'pvp-arenapoints-icon' ], default => [$this->curTpl['iconString'], $this->curTpl['iconString']] }; $data[Type::CURRENCY][$this->id] = ['name' => $this->getField('name', true), 'icon' => $icon]; } return $data; } public function renderTooltip() : ?string { if (!$this->curTpl) return null; $x = '
'; $x .= ''.$this->getField('name', true).'
'; // cata+ (or go fill it by hand) if ($_ = $this->getField('description', true)) $x .= '
'.$_.'
'; if ($_ = $this->getField('cap')) $x .= '
'.Lang::currency('cap').Lang::main('colon').''.Lang::nf($_).'
'; $x .= '
'; return $x; } } ?>