Commit a8806d97 authored by Karl Hasselbring's avatar Karl Hasselbring
Browse files

versteckter lang parameter der startseite wird jetzt durch die locale bestimmt

parent bdcd0327
......@@ -6,6 +6,7 @@ use App;
use Illuminate\Http\Request;
use Jenssegers\Agent\Agent;
use Response;
use LaravelLocalization;
class StartpageController extends Controller
{
......@@ -15,18 +16,12 @@ class StartpageController extends Controller
* @param int $id
* @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)
{
$focusPages = [];
$theme = "default";
foreach ($request->all() as $key => $value) {
if ($value === 'on' && $key != 'param_sprueche' && $key != 'param_newtab' && $key !== 'param_maps' && $key !== 'param_autocomplete') {
$focusPages[] = str_replace('param_', '', $key);
......@@ -36,6 +31,11 @@ class StartpageController extends Controller
}
}
$lang = LaravelLocalization::getCurrentLocale();
if ($lang === 'de') {
$lang = 'all';
}
return view('index')
->with('title', trans('titles.index'))
->with('homeIcon')
......@@ -46,7 +46,7 @@ class StartpageController extends Controller
->with('autocomplete', $request->input('param_autocomplete', 'on'))
->with('foki', $this->loadFoki())
->with('focus', $request->input('focus', 'web'))
->with('lang', $request->input('param_lang', 'all'))
->with('lang', $lang)
->with('resultCount', $request->input('param_resultCount', '20'))
->with('time', $request->input('param_time', '1500'))
->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