From bddbacf45aad343824201eb6401a79ddb2656bb1 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Thu, 12 Apr 2018 09:24:34 +0200 Subject: [PATCH] Update search --- Changelog | 2 + app/Http/Controllers/SearchController.php | 10 +- public/assets/Gamma/scripts/utils.js | 2 +- public/assets/js/functions.js | 2 +- public/assets/js/utils.js | 2 +- .../views/themes/Charisma/headermenu.tpl | 2 +- resources/views/themes/Charisma/search.tpl | 2 +- resources/views/themes/Gentele/headermenu.tpl | 2 +- resources/views/themes/Gentele/search.tpl | 791 ++++++++--------- resources/views/themes/Omicron/search.tpl | 799 +++++++++--------- routes/web.php | 4 +- 11 files changed, 838 insertions(+), 780 deletions(-) diff --git a/Changelog b/Changelog index 2b55c0dd2..41972b124 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2018-04-12 DariusIII + * Chg: Update search 2018-04-11 DariusIII * Chg: Add SearchController * Chg: Add MusicController diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 6790c9cc7..323f46fde 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -14,7 +14,7 @@ class SearchController extends BasePageController * @param \Illuminate\Http\Request $request * @throws \Exception */ - public function search($id, Request $request) + public function search(Request $request) { $this->setPrefs(); $releases = new Releases(['Groups' => null, 'Settings' => $this->settings]); @@ -41,15 +41,15 @@ class SearchController extends BasePageController ] ); - if ($searchType === 'basic' && ! $request->has('searchadvr') && (! empty($id) || $request->has('subject'))) { + if ($searchType === 'basic' && ! $request->has('searchadvr') && ($request->has('id') || $request->has('subject'))) { $searchString = ''; switch (true) { case $request->has('subject'): $searchString = (string) $request->input('subject'); $this->smarty->assign('subject', $searchString); break; - case ! empty($id): - $searchString = (string) $id; + case $request->has('id'): + $searchString = (string) $request->input('id'); $this->smarty->assign('search', $searchString); break; } @@ -119,7 +119,7 @@ class SearchController extends BasePageController $this->smarty->assign($searchVarKey, $searchVars[$searchVarKey]); } - if ($searchType !== 'basic' && empty($id) && $request->has('searchadvr') && ! $request->has('subject')) { + if ($searchType !== 'basic' && ! $request->has('id') && $request->has('searchadvr') && ! $request->has('subject')) { $orderByString = ''; foreach ($searchVars as $searchVarKey => $searchVar) { $orderByString .= "&$searchVarKey=".htmlentities($searchVar, ENT_QUOTES | ENT_HTML5); diff --git a/public/assets/Gamma/scripts/utils.js b/public/assets/Gamma/scripts/utils.js index a1b9bbd3a..e4f53586a 100755 --- a/public/assets/Gamma/scripts/utils.js +++ b/public/assets/Gamma/scripts/utils.js @@ -563,7 +563,7 @@ jQuery(function($){ // search.tpl $('#search_search_button').click(function(){ if ($('#search').val()) - document.location=WWW_TOP + "/search/" + $('#search').val() + ($("#search_cat").val()!=-1 ? "?t="+$("#search_cat").val() : ""); + document.location=WWW_TOP + "/search?id=" + $('#search').val() + ($("#search_cat").val()!=-1 ? "?t="+$("#search_cat").val() : ""); return false; }); diff --git a/public/assets/js/functions.js b/public/assets/js/functions.js index 07c326fcf..4e936782a 100755 --- a/public/assets/js/functions.js +++ b/public/assets/js/functions.js @@ -751,7 +751,7 @@ jQuery(function($){ // search.tpl $('#search_search_button').click(function(){ if ($('#search').val()) - document.location=WWW_TOP + "/search/" + $('#search').val() + ($("#search_cat").val()!=-1 ? "?t="+$("#search_cat").val() : ""); + document.location=WWW_TOP + "/search?id=" + $('#search').val() + ($("#search_cat").val()!=-1 ? "?t="+$("#search_cat").val() : ""); return false; }); diff --git a/public/assets/js/utils.js b/public/assets/js/utils.js index 3c70f388b..88404d415 100644 --- a/public/assets/js/utils.js +++ b/public/assets/js/utils.js @@ -301,7 +301,7 @@ jQuery(function ($) { // search.tpl $('#search_search_button').click(function () { if ($('#search').val()) - document.location = WWW_TOP + "/search/" + $('#search').val() + ($("#search_cat").val() != -1 ? "?t=" + $("#search_cat").val() : ""); + document.location = WWW_TOP + "/search?id=" + $('#search').val() + ($("#search_cat").val() != -1 ? "?t=" + $("#search_cat").val() : ""); return false; }); diff --git a/resources/views/themes/Charisma/headermenu.tpl b/resources/views/themes/Charisma/headermenu.tpl index 35bdc437a..ba75a4a15 100755 --- a/resources/views/themes/Charisma/headermenu.tpl +++ b/resources/views/themes/Charisma/headermenu.tpl @@ -194,7 +194,7 @@ {/foreach}