Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
7081ea3f
Commit
7081ea3f
authored
Oct 12, 2018
by
Karl Hasselbring
Browse files
Der Eigene Suchfokus funktioniert jetzt auch über mehrere Suchen
parent
9bb8f040
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/StartpageController.php
View file @
7081ea3f
...
...
@@ -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'
)
...
...
app/MetaGer.php
View file @
7081ea3f
...
...
@@ -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
;
}
}
...
...
resources/views/parts/searchbar.blade.php
View file @
7081ea3f
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment