Core/Cleanup

* move DBType Filter base to its own file under components
 * modernize class and its children
This commit is contained in:
Sarjuuk
2025-08-01 00:32:32 +02:00
parent 08f0ae711e
commit 16eabb90b6
55 changed files with 1387 additions and 1566 deletions

View File

@@ -25,10 +25,11 @@ class ObjectsPage extends GenericPage
public function __construct($pageCall, $pageParam)
{
$this->getCategoryFromUrl($pageParam);
$this->filterObj = new GameObjectListFilter(false, ['parentCats' => $this->category]);
parent::__construct($pageCall, $pageParam);
$this->filterObj = new GameObjectListFilter($this->_get['filter'] ?? '', ['parentCats' => $this->category]);
$this->name = Util::ucFirst(Lang::game('objects'));
$this->subCat = $pageParam ? '='.$pageParam : '';
}
@@ -45,13 +46,7 @@ class ObjectsPage extends GenericPage
if ($this->category)
$conditions[] = ['typeCat', (int)$this->category[0]];
// recreate form selection
$this->filter = $this->filterObj->getForm();
$this->filter['query'] = $this->_get['filter'];
$this->filter['initData'] = ['init' => 'objects'];
if ($x = $this->filterObj->getSetCriteria())
$this->filter['initData']['sc'] = $x;
$this->filterObj->evalCriteria();
if ($_ = $this->filterObj->getConditions())
$conditions[] = $_;