Commit 7081ea3f authored by Karl Hasselbring's avatar Karl Hasselbring

Der Eigene Suchfokus funktioniert jetzt auch über mehrere Suchen

parent 9bb8f040
......@@ -3,12 +3,12 @@
namespace App\Http\Controllers;
use App;
use DB;
use Illuminate\Http\Request;
use Jenssegers\Agent\Agent;
use LaravelLocalization;
use Response;
use DB;
use Log;
use Response;
class StartpageController extends Controller
{
......@@ -22,9 +22,9 @@ class StartpageController extends Controller
public function loadStartPage(Request $request)
{
$focusPages = [];
$theme = "default";
$theme = "default";
$optionParams = ['param_sprueche', 'param_newtab', 'param_maps', 'param_autocomplete', 'param_lang', 'param_key'];
$optionParams = ['param_sprueche', 'param_newtab', 'param_maps', 'param_autocomplete', 'param_lang', 'param_key'];
$option_values = [];
foreach ($optionParams as $param) {
......@@ -43,12 +43,12 @@ class StartpageController extends Controller
if ($lang === 'de' || $lang === "en") {
$lang = 'all';
}
# Sponsorenlinks
$sponsors = [];
try{
try {
$sponsors = DB::table('sponsorenlinks')->where('langcode', 'de')->orderByRaw('LENGTH(linktext)', 'ASC')->get();
} catch(\Illuminate\Database\QueryException $e){
} catch (\Illuminate\Database\QueryException $e) {
Log::info($e);
}
......@@ -89,9 +89,9 @@ class StartpageController extends Controller
public function loadPlugin($params, $locale = "de")
{
$params = unserialize(base64_decode($params));
$params = unserialize(base64_decode($params));
$requests = $params;
$params = [];
$params = [];
foreach ($requests as $key => $value) {
if (strpos($key, "param_") === 0) {
$key = substr($key, strpos($key, "param_") + 6);
......@@ -146,12 +146,12 @@ class StartpageController extends Controller
public function berlin(Request $request)
{
$link = "";
$link = "";
$password = "";
if ($request->filled('eingabe')) {
$password = getenv('berlin');
$password = md5($request->input('eingabe') . " -host:userpage.fu-berlin.de" . $password);
$link = "/meta/meta.ger3?eingabe=" . $request->input('eingabe') . " -host:userpage.fu-berlin.de&focus=web&password=" . $password . "&encoding=utf8&lang=all&site=fu-berlin.de&quicktips=off&out=results-with-style";
$link = "/meta/meta.ger3?eingabe=" . $request->input('eingabe') . " -host:userpage.fu-berlin.de&focus=web&password=" . $password . "&encoding=utf8&lang=all&site=fu-berlin.de&quicktips=off&out=results-with-style";
}
return view('berlin')
->with('title', 'Testseite für die FU-Berlin')
......
......@@ -98,8 +98,8 @@ class MetaGer
$focusPages = [];
foreach ($this->request->all() as $key => $value) {
if ($value === 'on') {
$focusPages[] = str_replace('param_', '', str_replace('engine_', '', $key));
if (starts_with($key, 'engine_') && $value === 'on') {
$focusPages[] = $key;
}
}
......
......@@ -45,7 +45,6 @@
<input type="hidden" name="time" value={{ $time }}>
@endif
@if (isset($focusPages) && !empty($focusPages))
<input type="hidden" name="focus" value="focus_custom">
@foreach ($focusPages as $fp)
<input type="hidden" name={{ $fp }} value="on">
@endforeach
......
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