From 2ef32d24454b875e2265c6e45e10abd6f080b7e0 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Wed, 25 Apr 2018 14:40:52 +0200 Subject: [PATCH] Fix XXX list view --- Changelog | 1 + app/Http/Controllers/AdultController.php | 18 ++++++++++++++---- resources/views/themes/Charisma/xxx.tpl | 4 ++-- resources/views/themes/Gamma/xxx.tpl | 4 ++-- resources/views/themes/Gentele/xxx.tpl | 4 ++-- resources/views/themes/Omicron/xxx.tpl | 4 ++-- routes/web.php | 4 ++-- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Changelog b/Changelog index a016cf9c4..6c0c661e6 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-04-25 DariusIII + * Fix: Fix XXX list view * Fix: Fix admin predb search * Fix: Update Predb model getAll function PHPDOC block * Fix: Fix adding new user roles diff --git a/app/Http/Controllers/AdultController.php b/app/Http/Controllers/AdultController.php index c53b0545a..30568e061 100644 --- a/app/Http/Controllers/AdultController.php +++ b/app/Http/Controllers/AdultController.php @@ -10,10 +10,11 @@ class AdultController extends BasePageController { /** * @param \Illuminate\Http\Request $request + * @param string $id * * @throws \Exception */ - public function show(Request $request) + public function show(Request $request, $id = '') { $this->setPrefs(); $adult = new XXX(); @@ -21,17 +22,26 @@ class AdultController extends BasePageController $moviecats = Category::getChildren(Category::XXX_ROOT); $mtmp = []; foreach ($moviecats as $mcat) { - $mtmp[$mcat['id']] = $mcat; + $mtmp[] = + [ + 'id' => $mcat->id, + 'title' => $mcat->title, + ]; } $category = Category::XXX_ROOT; - if ($request->has('t') && array_key_exists($request->input('t'), $mtmp)) { - $category = $request->input('t') + 0; + if ($id && \in_array($id, array_pluck($mtmp, 'title'), false)) { + $cat = Category::query() + ->where('title', $id) + ->where('parentid', '=', Category::XXX_ROOT) + ->first(['id']); + $category = $cat !== null ? $cat['id'] : Category::XXX_ROOT; } $catarray = []; $catarray[] = $category; $this->smarty->assign('catlist', $mtmp); $this->smarty->assign('category', $category); + $this->smarty->assign('categorytitle', $id); $ordering = $adult->getXXXOrdering(); $orderby = $request->has('ob') && \in_array($request->input('ob'), $ordering, false) ? $request->input('ob') : ''; diff --git a/resources/views/themes/Charisma/xxx.tpl b/resources/views/themes/Charisma/xxx.tpl index 0d0cb46dd..7fb6c21ef 100755 --- a/resources/views/themes/Charisma/xxx.tpl +++ b/resources/views/themes/Charisma/xxx.tpl @@ -20,7 +20,7 @@
View: Covers | List
+ href="{$smarty.const.WWW_TOP}/browse/xxx/{$categorytitle}">List
Check all:
With Selected:
@@ -363,7 +363,7 @@
View: Covers | List
+ href="{$smarty.const.WWW_TOP}/browse/xxx/{$categorytitle}">List
Check all:
With Selected:
diff --git a/resources/views/themes/Gamma/xxx.tpl b/resources/views/themes/Gamma/xxx.tpl index 7d5ea50db..16bd25bca 100755 --- a/resources/views/themes/Gamma/xxx.tpl +++ b/resources/views/themes/Gamma/xxx.tpl @@ -24,7 +24,7 @@ {/if}
View: Covers | List
+ href="{$smarty.const.WWW_TOP}/browse/xxx/{$categorytitle}">List
@@ -291,7 +291,7 @@ {if isset($sabintegrated) && $sabintegrated !=""}{/if}
View: Covers | List
+ href="{$smarty.const.WWW_TOP}/browse/xxx/{$categorytitle}">List
diff --git a/resources/views/themes/Gentele/xxx.tpl b/resources/views/themes/Gentele/xxx.tpl index 1d8682178..2ae3570fc 100755 --- a/resources/views/themes/Gentele/xxx.tpl +++ b/resources/views/themes/Gentele/xxx.tpl @@ -20,7 +20,7 @@
View: Covers | List
+ href="{$smarty.const.WWW_TOP}/browse/xxx/{$categorytitle}">List
With Selected: