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
93b9c7f0
Commit
93b9c7f0
authored
Sep 25, 2020
by
Dominik Hebeler
Browse files
fixed key not used in opensearch
parent
56abd968
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/StartpageController.php
View file @
93b9c7f0
...
...
@@ -3,7 +3,6 @@
namespace
App\Http\Controllers
;
use
App
;
use
Cookie
;
use
Illuminate\Http\Request
;
use
Jenssegers\Agent\Agent
;
use
LaravelLocalization
;
...
...
@@ -80,12 +79,15 @@ class StartpageController extends Controller
public
function
loadPlugin
(
Request
$request
,
$locale
=
"de"
)
{
$link
=
action
(
'MetaGerSearch@search'
,
[]);
$key
=
Cookie
::
get
(
'key'
);
$link
.
=
"?"
;
$link
.
=
"eingabe=
{
searchTerms
}
"
;
$key
=
$request
->
input
(
'key'
,
''
);
if
(
!
empty
(
$key
))
{
$link
.
=
"&key="
.
urlencode
(
$key
);
}
$response
=
Response
::
make
(
view
(
'plugin'
)
->
with
(
'link'
,
$link
)
->
with
(
'key'
,
$key
)
,
"200"
);
$response
->
header
(
'Content-Type'
,
"application/opensearchdescription+xml"
);
return
$response
;
...
...
resources/views/layouts/staticPages.blade.php
View file @
93b9c7f0
...
...
@@ -21,7 +21,11 @@
<link
rel=
"apple-touch-icon"
sizes=
"144x144"
href=
"/img/apple/touch-icon-144.png"
>
<link
rel=
"apple-touch-icon"
sizes=
"152x152"
href=
"/img/apple/touch-icon-152.png"
>
<link
rel=
"apple-touch-icon"
sizes=
"180x180"
href=
"/img/apple/touch-icon-180.png"
>
@if(empty(Cookie::get('key')))
<link
rel=
"search"
type=
"application/opensearchdescription+xml"
title=
"{{ trans('staticPages.opensearch') }}"
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), action('StartpageController@loadPlugin')) }}"
>
@else
<link
rel=
"search"
type=
"application/opensearchdescription+xml"
title=
"{{ trans('staticPages.opensearch') }}"
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), action('StartpageController@loadPlugin', ['key' => Cookie::get('key')])) }}"
>
@endif
<link
type=
"text/css"
rel=
"stylesheet alternate"
href=
"{{ mix('css/themes/metager-dark.css') }}"
title=
"MetaGer Dark"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"{{ mix('css/themes/metager.css') }}"
title=
"MetaGer"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"{{ mix('css/utility.css') }}"
/>
...
...
resources/views/plugin.blade.php
View file @
93b9c7f0
...
...
@@ -4,6 +4,6 @@
<Description>
{{ trans('plugin.description') }}
</Description>
<Contact>
office@suma-ev.de
</Contact>
<Image
width=
"16"
height=
"16"
type=
"image/x-icon"
>
{{ url('/favicon.ico') }}
</Image>
<Url
type=
"text/html"
template=
"{{ $link }}
?{{ empty($key) ? "
"
:
"
key=
" . urlencode($key) . "
&"
}}
eingabe=
{searchTerms}
"
method=
"GET"
/>
<Url
type=
"text/html"
template=
"{{ $link }}"
method=
"GET"
/>
<InputEncoding>
UTF-8
</InputEncoding>
</OpenSearchDescription>
Write
Preview
Markdown
is supported
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