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
bcec71e8
Commit
bcec71e8
authored
Sep 25, 2020
by
Dominik Hebeler
Browse files
key will be included into opensearch.xml
parent
ee27fc43
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/KeyController.php
View file @
bcec71e8
...
...
@@ -29,7 +29,7 @@ class KeyController extends Controller
$host
=
$request
->
header
(
"Host"
,
""
);
}
Cookie
::
queue
(
'key'
,
$key
,
525600
,
'/
meta/
'
,
null
,
false
,
false
);
Cookie
::
queue
(
'key'
,
$key
,
525600
,
'/'
,
null
,
false
,
false
);
return
redirect
(
$redirUrl
);
}
else
{
return
view
(
'key'
)
...
...
@@ -41,7 +41,7 @@ class KeyController extends Controller
public
function
removeKey
(
Request
$request
)
{
$redirUrl
=
$request
->
input
(
'redirUrl'
,
""
);
Cookie
::
queue
(
'key'
,
''
,
0
,
'/
meta/
'
,
null
,
false
,
false
);
Cookie
::
queue
(
'key'
,
''
,
0
,
'/'
,
null
,
false
,
false
);
$url
=
LaravelLocalization
::
getLocalizedURL
(
LaravelLocalization
::
getCurrentLocale
(),
action
(
'KeyController@index'
,
[
'redirUrl'
=>
$redirUrl
]));
return
redirect
(
$url
);
}
...
...
@@ -68,7 +68,6 @@ class KeyController extends Controller
}
else
{
return
false
;
}
}
catch
(
\
ErrorException
$e
)
{
return
false
;
}
...
...
app/Http/Controllers/StartpageController.php
View file @
bcec71e8
...
...
@@ -3,6 +3,7 @@
namespace
App\Http\Controllers
;
use
App
;
use
Cookie
;
use
Illuminate\Http\Request
;
use
Jenssegers\Agent\Agent
;
use
LaravelLocalization
;
...
...
@@ -76,13 +77,15 @@ class StartpageController extends Controller
return
loadPage
(
$subpage
);
}
public
function
loadPlugin
(
$locale
=
"de"
)
public
function
loadPlugin
(
Request
$request
,
$locale
=
"de"
)
{
$link
=
action
(
'MetaGerSearch@search'
,
[]);
$key
=
Cookie
::
get
(
'key'
);
$response
=
Response
::
make
(
view
(
'plugin'
)
->
with
(
'link'
,
$link
)
->
with
(
'key'
,
$key
)
,
"200"
);
$response
->
header
(
'Content-Type'
,
"application/opensearchdescription+xml"
);
return
$response
;
...
...
resources/views/plugin.blade.php
View file @
bcec71e8
...
...
@@ -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 }}?eingabe={searchTerms}"
method=
"GET"
/>
<Url
type=
"text/html"
template=
"{{ $link }}?
{{ empty($key) ? "
"
:
"
key=
" . urlencode($key) . "
&
amp
;"
}}
eingabe=
{searchTerms}"
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