ListPages/Filter

* vastly improved input validation
 * content and type validation occurs when filter is created
 * contextual filters like itemTypes are now only applied in context
This commit is contained in:
Sarjuuk
2017-04-16 00:14:33 +02:00
parent 178a67e180
commit 959d0ace0b
42 changed files with 2333 additions and 2043 deletions

View File

@@ -20,8 +20,8 @@ class ObjectsPage extends GenericPage
public function __construct($pageCall, $pageParam)
{
$this->filterObj = new GameObjectListFilter();
$this->getCategoryFromUrl($pageParam);;
$this->filterObj = new GameObjectListFilter(false, ['parentCats' => $this->category]);
parent::__construct($pageCall, $pageParam);
@@ -42,9 +42,12 @@ class ObjectsPage extends GenericPage
$conditions[] = ['typeCat', (int)$this->category[0]];
// recreate form selection
$this->filter = $this->filterObj->getForm('form');
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : null;
$this->filter['fi'] = $this->filterObj->getForm();
$this->filter = $this->filterObj->getForm();
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : null;
$this->filter['initData'] = ['init' => 'objects'];
if ($x = $this->filterObj->getSetCriteria())
$this->filter['initData']['sc'] = $x;
if ($_ = $this->filterObj->getConditions())
$conditions[] = $_;