Commit 6fe8b2f1 authored by Aria Givi's avatar Aria Givi

umschalten von custom focus auf andere funktioniert noch nicht richtig, auswahl wird nicht gemerkt

parent 7a319a7f
......@@ -37,15 +37,6 @@ class StartpageController extends Controller
$autocomplete = $option_values['autocomplete'];
}
foreach ($request->all() as $key => $value) {
if ($value === 'on' && !in_array($key, $optionParams)) {
$focusPages[] = str_replace('param_', '', $key);
}
if ($key === 'param_theme') {
$theme = str_replace('param_', '', $key);
}
}
$lang = LaravelLocalization::getCurrentLocale();
if ($lang === 'de') {
$lang = 'all';
......@@ -54,10 +45,8 @@ class StartpageController extends Controller
return view('index')
->with('title', trans('titles.index'))
->with('homeIcon')
->with('focusPages', $focusPages)
->with('browser', (new Agent())->browser())
->with('navbarFocus', 'suche')
->with('theme', $theme)
->with('focus', $request->input('focus', 'web'))
->with('time', $request->input('param_time', '1500'))
->with('request', $request->input('request', 'GET'))
......
......@@ -90,6 +90,15 @@ class MetaGer
# Erstellt aus den gesammelten Ergebnissen den View
public function createView()
{
# Hiermit werden die evtl. ausgewählten SuMas extrahiert, damit die Input-Boxen richtig gesetzt werden können
$focusPages = [];
foreach ($this->request->all() as $key => $value) {
if ($value === 'on') {
$focusPages[] = str_replace('param_', '', $key);
}
}
$viewResults = [];
# Wir extrahieren alle notwendigen Variablen und geben Sie an unseren View:
foreach ($this->results as $result) {
......@@ -179,6 +188,7 @@ class MetaGer
default:
return view('metager3')
->with('eingabe', $this->eingabe)
->with('focusPages', $focusPages)
->with('mobile', $this->mobile)
->with('warnings', $this->warnings)
->with('errors', $this->errors)
......
/* Rund ums Fokus Modal */
#show-create-focus {
.focus-input {
display: none;
}
......
<input type="checkbox" id="show-create-focus">
<input type="checkbox" id="show-create-focus" class="focus-input">
<div id="create-focus-modal" tab-index="-1" role="dialog">
<div id="foki-modal-dialog">
<div id="foki-modal-content">
......@@ -10,37 +10,38 @@
<p class="text-muted">@lang("index.focus-creator.description")</p>
</div>
<div class="modal-body">
<form id="customize-search" role="form" method="POST">
@foreach( App\Http\Controllers\FokiLoader::loadFoki() as $fokus => $sumas )
<div class="headingGroup {{ $fokus }}">
<input type="checkbox" id="toggle-{{ $fokus }}-dropdown" class="focus-dropdown-toggle">
<label for="toggle-{{ $fokus }}-dropdown" class="focus-category focus-dropdown-label h3">
@lang("settings.foki." . $fokus)
</label>
<div class="row">
@foreach( $sumas as $name => $data )
<div class="col-sm-6 col-md-4 col-lg-3">
<div class="checkbox settings-checkbox">
<label>
<input type="checkbox" name="engine_{{ strtolower($name) }}" class="focusCheckbox" @if ($fokus=='web' ) checked @endif>{{ $data['displayName'] }}
<a class="settings-icon" target="_blank" rel="noopener" href="{{ $data['url'] }}">
<i class="fa fa-link" aria-hidden="true"></i>
</a>
</label>
</div>
<input type="hidden" form="searchForm" name="focus" @if(isset($focusPages) && !empty($focusPages)) value="focus_custom"@else value="web" @endif
id="custom-focus-flag" class="focus-input">
@foreach( App\Http\Controllers\FokiLoader::loadFoki() as $fokus => $sumas )
<div class="headingGroup {{ $fokus }}">
<input type="checkbox" id="toggle-{{ $fokus }}-dropdown" class="focus-dropdown-toggle">
<label for="toggle-{{ $fokus }}-dropdown" class="focus-category focus-dropdown-label h3">
@lang("settings.foki." . $fokus)
</label>
<div class="row">
@foreach( $sumas as $name => $data )
<div class="col-sm-6 col-md-4 col-lg-3">
<div class="checkbox settings-checkbox">
<label>
<input type="checkbox" form="searchForm" name="engine_{{ strtolower($name) }}" class="focusCheckbox" @if(isset($focusPages) && in_array('engine_{{ strtolower($name) }}', $focusPages)) checked @endif>
{{ $data['displayName'] }}
<a class="settings-icon" target="_blank" rel="noopener" href="{{ $data['url'] }}">
<i class="fa fa-link" aria-hidden="true"></i>
</a>
</label>
</div>
@endforeach
</div>
@endforeach
</div>
@endforeach
<div class="clearfix">
<div class="settings-modal-buttons pull-right">
<button type="submit" class="save-focus-btn btn btn-primary">
@lang('index.focus-creator.save')
</button>
</div>
</div>
</form>
@endforeach
<div class="clearfix">
<div class="settings-modal-buttons pull-right">
<button type="submit" form="searchForm" class="save-focus-btn btn btn-primary">
@lang('index.focus-creator.save')
</button>
</div>
</div>
</div>
</div>
</div>
......
......@@ -23,11 +23,6 @@
@if (isset($option_values))
<input type="hidden" name="time" value={{ $time }}>
@endif
@if (isset($focusPages))
@foreach ($focusPages as $fp)
<input type="hidden" name={{ $fp }} value="on">
@endforeach
@endif
@if (isset($theme))
<input type="hidden" name="theme" value={{ $theme }}>
@endif
......
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