mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
ItemFilter/Fixup 16eabb90b6
* fix lost item grouping * fix type selector in filter form * fix item upgrade search
This commit is contained in:
@@ -292,7 +292,7 @@ abstract class Filter
|
|||||||
{
|
{
|
||||||
// quirk: in the POST step criteria can be [[''], null, null] if not selected.
|
// quirk: in the POST step criteria can be [[''], null, null] if not selected.
|
||||||
$buff = [];
|
$buff = [];
|
||||||
foreach ($val as $v)
|
foreach ((array)$val as $v) // can be string|int in POST step if only one value present
|
||||||
if ($v !== '' && $this->checkInput($type, $valid, $v))
|
if ($v !== '' && $this->checkInput($type, $valid, $v))
|
||||||
$buff[] = $v;
|
$buff[] = $v;
|
||||||
|
|
||||||
|
|||||||
@@ -188,11 +188,11 @@ class ItemsPage extends GenericPage
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($singleSlot && empty($this->filter['gb'])) // enforce group by slot
|
if ($singleSlot && empty($fiForm['gb'])) // enforce group by slot
|
||||||
$this->filter['gb'] = 1;
|
$fiForm['gb'] = 1;
|
||||||
else if (!$singleSlot) // multiples can only be grouped by slot
|
else if (!$singleSlot) // multiples can only be grouped by slot
|
||||||
{
|
{
|
||||||
$this->filter['gb'] = 1;
|
$fiForm['gb'] = 1;
|
||||||
$maxResults = 25;
|
$maxResults = 25;
|
||||||
$this->sharedLV['customFilter'] = '$fi_filterUpgradeListview';
|
$this->sharedLV['customFilter'] = '$fi_filterUpgradeListview';
|
||||||
}
|
}
|
||||||
@@ -221,7 +221,7 @@ class ItemsPage extends GenericPage
|
|||||||
);
|
);
|
||||||
$groups = [];
|
$groups = [];
|
||||||
$nameSource = [];
|
$nameSource = [];
|
||||||
$grouping = $this->filter['gb'] ?? 0;
|
$grouping = $fiForm['gb'] ?? 0;
|
||||||
$extraOpts = [];
|
$extraOpts = [];
|
||||||
$maxResults = Cfg::get('SQL_LIMIT_DEFAULT');
|
$maxResults = Cfg::get('SQL_LIMIT_DEFAULT');
|
||||||
|
|
||||||
@@ -237,10 +237,10 @@ class ItemsPage extends GenericPage
|
|||||||
else
|
else
|
||||||
$groups = array_merge($availableSlots[ITEM_CLASS_ARMOR], $availableSlots[ITEM_CLASS_WEAPON]);
|
$groups = array_merge($availableSlots[ITEM_CLASS_ARMOR], $availableSlots[ITEM_CLASS_WEAPON]);
|
||||||
|
|
||||||
if (isset($this->filter['sl'])) // skip lookups for unselected slots
|
if ($fiForm['sl']) // skip lookups for unselected slots
|
||||||
$groups = array_intersect($groups, $this->filter['sl']);
|
$groups = array_intersect($groups, $fiForm['sl']);
|
||||||
|
|
||||||
if (!empty($this->filterObj->upgrades)) // skip lookups for slots we dont have items to upgrade for
|
if (!empty($this->filterObj->upgrades)) // skip lookups for slots we dont have items to upgrade for
|
||||||
$groups = array_intersect($groups, $this->filterObj->upgrades);
|
$groups = array_intersect($groups, $this->filterObj->upgrades);
|
||||||
|
|
||||||
if ($groups)
|
if ($groups)
|
||||||
@@ -286,6 +286,10 @@ class ItemsPage extends GenericPage
|
|||||||
$groups[0] = null;
|
$groups[0] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// write back 'gb' to filter
|
||||||
|
if ($grouping)
|
||||||
|
$this->filterObj->values['gb'] = $grouping;
|
||||||
|
|
||||||
|
|
||||||
/*****************************/
|
/*****************************/
|
||||||
/* create lv-tabs for groups */
|
/* create lv-tabs for groups */
|
||||||
@@ -444,8 +448,8 @@ class ItemsPage extends GenericPage
|
|||||||
$tPart = Lang::item('cat', $this->category[0], 1, $this->category[1], 1, $this->category[2]);
|
$tPart = Lang::item('cat', $this->category[0], 1, $this->category[1], 1, $this->category[2]);
|
||||||
else if (isset($this->category[1]) && is_array(Lang::item('cat', $this->category[0])))
|
else if (isset($this->category[1]) && is_array(Lang::item('cat', $this->category[0])))
|
||||||
$tPart = Lang::item('cat', $this->category[0], 1, $this->category[1]);
|
$tPart = Lang::item('cat', $this->category[0], 1, $this->category[1]);
|
||||||
else if ($this->category[0] == 0 && isset($this->filter['ty']) && !is_array($this->filter['ty']))
|
else if ($this->category[0] == 0 && count($this->filterObj->values['ty']) == 1)
|
||||||
$tPart = Lang::item('cat', 0, 1, $this->filter['ty']);
|
$tPart = Lang::item('cat', 0, 1, $this->filterObj->values['ty'][0]);
|
||||||
else
|
else
|
||||||
$tPart = Lang::item('cat', $this->category[0]);
|
$tPart = Lang::item('cat', $this->category[0]);
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ if ($this->typeList):
|
|||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<select name="ty[]" size="<?=min(count($this->typeList), 7); ?>" multiple="multiple" class="rightselect">
|
<select name="ty[]" size="<?=min(count($this->typeList), 7); ?>" multiple="multiple" class="rightselect">
|
||||||
<?php
|
<?php
|
||||||
foreach ($fthis->typeList as $k => $str):
|
foreach ($this->typeList as $k => $str):
|
||||||
$selected = false;
|
$selected = false;
|
||||||
if (isset($f['ty']) && in_array($k, (array)$f['ty'])):
|
if (isset($f['ty']) && in_array($k, (array)$f['ty'])):
|
||||||
$selected = true;
|
$selected = true;
|
||||||
@@ -178,7 +178,7 @@ endforeach;
|
|||||||
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="upg"<?=(!empty($f['upg']) ? ' value="'.$f['upg'].'"' : null); ?>/>
|
<input type="hidden" name="upg"<?=($f['upg'] ? ' value="'.implode(':', $f['upg']).'"' : ''); ?>/>
|
||||||
|
|
||||||
<div class="pad"></div>
|
<div class="pad"></div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user