mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Itemset/Summary (#351)
* disable compare button for empty item sets * do not display summary for empty item sets
This commit is contained in:
@@ -18,6 +18,8 @@ class ItemsetPage extends GenericPage
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'swfobject.js'], [JS_FILE, 'Summary.js']];
|
||||
|
||||
protected $summary = [];
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
||||
|
||||
private $powerTpl = '$WowheadPower.registerItemSet(%d, %d, %s);';
|
||||
@@ -167,15 +169,16 @@ class ItemsetPage extends GenericPage
|
||||
BUTTON_WOWHEAD => $this->typeId > 0, // bool only
|
||||
BUTTON_LINKS => ['type' => $this->type, 'typeId' => $this->typeId],
|
||||
BUTTON_VIEW3D => ['type' => Type::ITEMSET, 'typeId' => $this->typeId, 'equipList' => $eqList],
|
||||
BUTTON_COMPARE => ['eqList' => implode(':', $compare), 'qty' => $_cnt]
|
||||
);
|
||||
$this->summary = array(
|
||||
'id' => 'itemset',
|
||||
'template' => 'itemset',
|
||||
'parent' => 'summary-generic',
|
||||
'groups' => array_map(function ($v) { return [[$v]]; }, $compare),
|
||||
'level' => $this->subject->getField('reqLevel'),
|
||||
BUTTON_COMPARE => $compare ? ['eqList' => implode(':', $compare), 'qty' => $_cnt] : false
|
||||
);
|
||||
if ($compare)
|
||||
$this->summary = array(
|
||||
'id' => 'itemset',
|
||||
'template' => 'itemset',
|
||||
'parent' => 'summary-generic',
|
||||
'groups' => array_map(function ($v) { return [[$v]]; }, $compare),
|
||||
'level' => $this->subject->getField('reqLevel'),
|
||||
);
|
||||
|
||||
/**************/
|
||||
/* Extra Tabs */
|
||||
|
||||
@@ -68,6 +68,9 @@ foreach ($this->spells as $i => $s):
|
||||
endforeach;
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
if ($this->summary):
|
||||
?>
|
||||
|
||||
<h2 class="clear"><?=Lang::itemset('summary'); ?></h2>
|
||||
|
||||
@@ -75,6 +78,9 @@ endforeach;
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
new Summary(<?=Util::toJSON($this->summary); ?>);
|
||||
//]]></script>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
|
||||
<h2 class="clear"><?=Lang::main('related'); ?></h2>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user