diff --git a/app/Http/Controllers/StartpageController.php b/app/Http/Controllers/StartpageController.php index 01efe30fcfda9b1bcc86619642e6f0b3d96f6806..3641ba12effb7c8758ac371aaac7528001a598b0 100644 --- a/app/Http/Controllers/StartpageController.php +++ b/app/Http/Controllers/StartpageController.php @@ -27,10 +27,14 @@ class StartpageController extends Controller public function loadStartPage(Request $request) { $focusPages = []; + $theme = "none"; foreach ($request->all() as $key => $value) { if ($value === 'on' && $key != 'param_sprueche' && $key != 'param_tab') { $focusPages[] = str_replace('param_', '', $key); } + if ($key === 'param_theme') { + $theme = str_replace('param_', '', $key); + } } $agent = new Agent(); @@ -48,6 +52,7 @@ class StartpageController extends Controller ->with('focusPages', $focusPages) ->with('browser', $browser) ->with('navbarFocus', 'suche') + ->with('theme', $theme) ->with('css', 'index.css'); } diff --git a/app/MetaGer.php b/app/MetaGer.php index 57c1bac7bd6cce38cc17f176c94ddd1ed0a84561..88183fbccc75c6126fd4dbdbb06bb1497b33231d 100644 --- a/app/MetaGer.php +++ b/app/MetaGer.php @@ -750,6 +750,8 @@ class MetaGer } else { $this->sprueche = false; } + # Theme + $this->theme = preg_replace("/[^[:alnum:][:space:]]/u", '', $request->input('theme', 'none')); # Ergebnisse pro Seite: $this->resultCount = $request->input('resultCount', '20'); # Manchmal müssen wir Parameter anpassen um den Sucheinstellungen gerecht zu werden: diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 91046290d7d32502554b41f3a3bacfb3e3f9e5a2..84e30eb79f343817f18cad81a7d8b0f67fbb1def 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -191,6 +191,7 @@ @foreach ($focusPages as $fp) <input type="hidden" name={{ $fp }} value="on"> @endforeach + <input type="hidden" name="theme" value={{ $theme }}> @elseif( !App::isLocale('de') ) <input type="hidden" name="lang" value="{{ App::getLocale() }}"> @else diff --git a/resources/views/layouts/resultPage.blade.php b/resources/views/layouts/resultPage.blade.php index b687306cdc0c2c09cf4f265e13fe437bed903295..b8a198999bb5533f8407a50957cd8a70a4bf96fe 100644 --- a/resources/views/layouts/resultPage.blade.php +++ b/resources/views/layouts/resultPage.blade.php @@ -16,7 +16,9 @@ <meta content="{{ $eingabe }}" name="q" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="search" type="application/opensearchdescription+xml" title="{!! trans('resultPage.opensearch') !!}" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), action('StartpageController@loadPlugin', ['params' => base64_encode(serialize(Request::all()))])) }}"> - + @if( isset($metager->theme) && $metager->theme != "none" ) + <link type="text/css" rel="stylesheet" href="/css/themes/{{ $metager->theme }}.css" /> + @endif <link type="text/css" rel="stylesheet" href="/css/lightslider.css" />