Commit 8fbd35d4 authored by Dominik Hebeler's avatar Dominik Hebeler

renamed sprueche to zitate

parent d8657b10
......@@ -196,7 +196,7 @@ class SettingsController extends Controller
$fokus = $request->input('fokus', '');
$url = $request->input('url', '');
// Currently only the setting for quotes is supported
$quotes = $request->input('sprueche', '');
$quotes = $request->input('zitate', '');
if (empty($fokus) || empty($quotes)) {
abort(404);
}
......@@ -204,13 +204,13 @@ class SettingsController extends Controller
if($quotes === "off"){
$path = \Request::path();
$cookiePath = "/" . substr($path, 0, strpos($path, "meta/") + 5);
Cookie::queue($fokus . "_setting_sprueche", "off", 0, $cookiePath, null, false, false);
Cookie::queue($fokus . "_setting_zitate", "off", 0, $cookiePath, null, false, false);
}elseif($quotes === "on") {
$path = \Request::path();
$cookiePath = "/" . substr($path, 0, strpos($path, "meta/") + 5);
Cookie::queue($fokus . "_setting_sprueche", "", 0, $cookiePath, null, false, false);
Cookie::queue($fokus . "_setting_zitate", "", 0, $cookiePath, null, false, false);
}else{
dd($quotes);
abort(404);
}
return redirect(LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), route('settings', ["fokus" => $fokus, "url" => $url])));
......
......@@ -951,12 +951,12 @@ class MetaGer
$this->agent = new Agent();
$this->mobile = $this->agent->isMobile();
# Sprüche
if (!App::isLocale("de") || (\Cookie::has($this->getFokus() . '_setting_sprueche') && \Cookie::get($this->getFokus() . '_setting_sprueche') === "off")) {
if (!App::isLocale("de") || (\Cookie::has($this->getFokus() . '_setting_zitate') && \Cookie::get($this->getFokus() . '_setting_zitate') === "off")) {
$this->sprueche = "off";
}else{
$this->sprueche = "on";
}
if($request->filled("sprueche") && $request->input('sprueche') === "on" || $request->input('sprueche') === "off"){
if($request->filled("zitate") && $request->input('zitate') === "on" || $request->input('zitate') === "off"){
$this->sprueche = $request->input('quotes');
}
......
......@@ -91,10 +91,10 @@
<input type="hidden" name="fokus" value="{{ $fokus }}">
<input type="hidden" name="url" value="{{ $url }}">
<div class="form-group">
<label for="sprueche">Sprüche</label>
<select name="sprueche" id="sprueche" class="form-control">
<option value="on" @if(Cookie::get($fokus . "_setting_sprueche") === null)disabled selected @endif>Anzeigen</option>
<option value="off" {{ Cookie::get($fokus . "_setting_sprueche") === "off" ? "disabled selected" : "" }}>Nicht Anzeigen</option>
<label for="zitate">Zitate</label>
<select name="zitate" id="zitate" class="form-control">
<option value="on" @if(Cookie::get($fokus . "_setting_zitate") === null)disabled selected @endif>Anzeigen</option>
<option value="off" {{ Cookie::get($fokus . "_setting_zitate") === "off" ? "disabled selected" : "" }}>Nicht Anzeigen</option>
</select>
</div>
<button type="submit" class="btn btn-default">@lang('settings.save')</button>
......
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