From 2ec5fda3e7d2a0089cecd69d24823821de17d22d Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Thu, 16 Mar 2017 15:13:25 +0100 Subject: [PATCH] Items/Menu * fixed preselection of menu items on Items List Page * fixed display and preselection of 'Type' option list --- pages/genericPage.class.php | 2 +- pages/items.php | 10 ++++++---- template/pages/items.tpl.php | 9 ++++++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pages/genericPage.class.php b/pages/genericPage.class.php index 0d8e53bc..729839c6 100644 --- a/pages/genericPage.class.php +++ b/pages/genericPage.class.php @@ -247,9 +247,9 @@ class GenericPage { $this->addArticle(); + $this->generateContent(); $this->generatePath(); $this->generateTitle(); - $this->generateContent(); $this->applyGlobals(); diff --git a/pages/items.php b/pages/items.php index c5935756..271a7200 100644 --- a/pages/items.php +++ b/pages/items.php @@ -87,7 +87,7 @@ class ItemsPage extends GenericPage parent::__construct($pageCall, $pageParam); $this->name = Util::ucFirst(Lang::game('items')); - $this->subCat = $pageParam ? '='.$pageParam : ''; + $this->subCat = $pageParam !== NULL ? '='.$pageParam : ''; } protected function generateContent() @@ -112,7 +112,6 @@ class ItemsPage extends GenericPage $this->filter['fi'] = $this->filterObj->getForm(); $menu = $this->createExtraMenus(); - foreach ($menu['type'][0] as $k => $str) if ($str && (!$menu['type'][1] || ($menu['type'][1] & (1 << $k)))) $this->filter['type'][$k] = $str; @@ -436,6 +435,8 @@ class ItemsPage extends GenericPage $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]))) $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'])) + $tPart = Lang::item('cat', 0, 1, $this->filter['ty']); else $tPart = Lang::item('cat', $this->category[0]); @@ -451,6 +452,8 @@ class ItemsPage extends GenericPage $form = $this->filterObj->getForm('form'); if (count($this->path) == 4 && $this->category[0] == 4 && isset($form['sl']) && !is_array($form['sl'])) $this->path[] = $form['sl']; + else if ($this->category[0] == 0 && isset($form['ty']) && !is_array($form['ty'])) + $this->path[] = $form['ty']; } // fetch best possible gems for chosen weights @@ -528,8 +531,7 @@ class ItemsPage extends GenericPage switch ($this->category[0]) { case 0: - if (!isset($this->category[1])) - $menu['type'] = [Lang::item('cat', 0, 1), null]; + $menu['type'] = [Lang::item('cat', 0, 1), null]; if (!isset($this->category[1]) || in_array($this->category[1], [6, -3])) { diff --git a/template/pages/items.tpl.php b/template/pages/items.tpl.php index 95d70be8..0548a857 100644 --- a/template/pages/items.tpl.php +++ b/template/pages/items.tpl.php @@ -55,7 +55,14 @@ if (!empty($f['type'])):