Commit a1cdbe29 authored by Aria Givi's avatar Aria Givi

falls keine sumas ausgewaehlt sind wird nun eine websuche durchgefuehrt

parent 759cf273
......@@ -496,6 +496,11 @@ class MetaGer
$sumaCount = 0;
$isCustomSearch = $this->startsWith($this->fokus, 'focus_');
# Im Falle einer Custom-Suche ohne mindestens einer selektierter Suchmaschine wird eine Web-Suche durchgeführt
if($isCustomSearch && !$this->atLeastOneSearchengineSelected($request)) {
$isCustomSearch = false;
$this->fokus = 'web';
}
/* Erstellt die Liste der eingestellten Sumas
* Der einzige Unterschied bei angepasstem Suchfokus ist,
......@@ -1214,6 +1219,15 @@ class MetaGer
}
}
public function atLeastOneSearchengineSelected(Request $request) {
foreach ($request->all() as $key => $value) {
if ($this->startsWith($key, 'engine')) {
return true;
}
}
return false;
}
public function showQuicktips()
{
return $this->quicktips;
......
......@@ -12,11 +12,11 @@
</div>
<div class="modal-body">
<form id="customSearchForm" method="GET" action="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/meta/meta.ger3 ") }}" accept-charset="UTF-8">
<input type="hidden" name="focus" value="focus_custom" id="custom-focus-flag">
<input type="hidden" name="eingabe" value="@if(isset($eingabe)){{$eingabe}}@endif">
<input type="hidden" name="eingabe" value="@if(isset($eingabe)){{$eingabe}}@endif">
<input type="hidden" name="focus" value="focus_custom" id="custom-focus-flag">
@foreach( App\Http\Controllers\FokiLoader::loadFoki() as $fokus => $sumas )
<div class="headingGroup {{ $fokus }}">
<input type="checkbox" id="toggle-{{ $fokus }}-dropdown" class="focus-dropdown-toggle">
<input type="checkbox" id="toggle-{{ $fokus }}-dropdown" class="focus-dropdown-toggle" checked>
<label for="toggle-{{ $fokus }}-dropdown" class="focus-category focus-dropdown-label h3">
@lang("settings.foki." . $fokus)
</label>
......
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