Commit 48bf2317 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch...

Merge branch '588-wenn-man-auf-der-startseite-auf-englisch-schaltet-wird-der-lang-parameter-nicht-mehr-geandert' into 'development'

Resolve "Wenn man auf der Startseite auf englisch Schaltet wird der lang Parameter nicht mehr geändert"

Closes #588

See merge request !1059
parents 26bc1404 557c1294
...@@ -6,6 +6,7 @@ use App; ...@@ -6,6 +6,7 @@ use App;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Jenssegers\Agent\Agent; use Jenssegers\Agent\Agent;
use Response; use Response;
use LaravelLocalization;
class StartpageController extends Controller class StartpageController extends Controller
{ {
...@@ -15,20 +16,14 @@ class StartpageController extends Controller ...@@ -15,20 +16,14 @@ class StartpageController extends Controller
* @param int $id * @param int $id
* @return Response * @return Response
*/ */
/* public function loadStartPage($locale = "de")
{
\App::setLocale($locale);
return view('index', [
'title' => 'MetaGer: Sicher suchen & finden, Privatsphäre schützen',
'homeIcon']);
} */
public function loadStartPage(Request $request) public function loadStartPage(Request $request)
{ {
$focusPages = []; $focusPages = [];
$theme = "default"; $theme = "default";
foreach ($request->all() as $key => $value) { foreach ($request->all() as $key => $value) {
if ($value === 'on' && $key != 'param_sprueche' && $key != 'param_newtab' && $key !== 'param_maps' && $key !== 'param_autocomplete') { if ($value === 'on' && $key != 'param_sprueche' && $key != 'param_newtab' && $key !== 'param_maps' && $key !== 'param_autocomplete' && $key !== 'param_lang') {
$focusPages[] = str_replace('param_', '', $key); $focusPages[] = str_replace('param_', '', $key);
} }
if ($key === 'param_theme') { if ($key === 'param_theme') {
...@@ -36,6 +31,11 @@ class StartpageController extends Controller ...@@ -36,6 +31,11 @@ class StartpageController extends Controller
} }
} }
$lang = LaravelLocalization::getCurrentLocale();
if ($lang === 'de') {
$lang = 'all';
}
return view('index') return view('index')
->with('title', trans('titles.index')) ->with('title', trans('titles.index'))
->with('homeIcon') ->with('homeIcon')
...@@ -46,7 +46,7 @@ class StartpageController extends Controller ...@@ -46,7 +46,7 @@ class StartpageController extends Controller
->with('autocomplete', $request->input('param_autocomplete', 'on')) ->with('autocomplete', $request->input('param_autocomplete', 'on'))
->with('foki', $this->loadFoki()) ->with('foki', $this->loadFoki())
->with('focus', $request->input('focus', 'web')) ->with('focus', $request->input('focus', 'web'))
->with('lang', $request->input('param_lang', 'all')) ->with('lang', $request->input('param_lang', $lang))
->with('resultCount', $request->input('param_resultCount', '20')) ->with('resultCount', $request->input('param_resultCount', '20'))
->with('time', $request->input('param_time', '1500')) ->with('time', $request->input('param_time', '1500'))
->with('sprueche', $request->input('param_sprueche', 'on')) ->with('sprueche', $request->input('param_sprueche', 'on'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment