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 $mode = CACHE_TYPE_PAGE;
|
||||||
protected $js = [[JS_FILE, 'swfobject.js'], [JS_FILE, 'Summary.js']];
|
protected $js = [[JS_FILE, 'swfobject.js'], [JS_FILE, 'Summary.js']];
|
||||||
|
|
||||||
|
protected $summary = [];
|
||||||
|
|
||||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
||||||
|
|
||||||
private $powerTpl = '$WowheadPower.registerItemSet(%d, %d, %s);';
|
private $powerTpl = '$WowheadPower.registerItemSet(%d, %d, %s);';
|
||||||
@@ -167,8 +169,9 @@ class ItemsetPage extends GenericPage
|
|||||||
BUTTON_WOWHEAD => $this->typeId > 0, // bool only
|
BUTTON_WOWHEAD => $this->typeId > 0, // bool only
|
||||||
BUTTON_LINKS => ['type' => $this->type, 'typeId' => $this->typeId],
|
BUTTON_LINKS => ['type' => $this->type, 'typeId' => $this->typeId],
|
||||||
BUTTON_VIEW3D => ['type' => Type::ITEMSET, 'typeId' => $this->typeId, 'equipList' => $eqList],
|
BUTTON_VIEW3D => ['type' => Type::ITEMSET, 'typeId' => $this->typeId, 'equipList' => $eqList],
|
||||||
BUTTON_COMPARE => ['eqList' => implode(':', $compare), 'qty' => $_cnt]
|
BUTTON_COMPARE => $compare ? ['eqList' => implode(':', $compare), 'qty' => $_cnt] : false
|
||||||
);
|
);
|
||||||
|
if ($compare)
|
||||||
$this->summary = array(
|
$this->summary = array(
|
||||||
'id' => 'itemset',
|
'id' => 'itemset',
|
||||||
'template' => 'itemset',
|
'template' => 'itemset',
|
||||||
|
|||||||
@@ -68,6 +68,9 @@ foreach ($this->spells as $i => $s):
|
|||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
|
<?php
|
||||||
|
if ($this->summary):
|
||||||
|
?>
|
||||||
|
|
||||||
<h2 class="clear"><?=Lang::itemset('summary'); ?></h2>
|
<h2 class="clear"><?=Lang::itemset('summary'); ?></h2>
|
||||||
|
|
||||||
@@ -75,6 +78,9 @@ endforeach;
|
|||||||
<script type="text/javascript">//<![CDATA[
|
<script type="text/javascript">//<![CDATA[
|
||||||
new Summary(<?=Util::toJSON($this->summary); ?>);
|
new Summary(<?=Util::toJSON($this->summary); ?>);
|
||||||
//]]></script>
|
//]]></script>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
|
||||||
<h2 class="clear"><?=Lang::main('related'); ?></h2>
|
<h2 class="clear"><?=Lang::main('related'); ?></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user