Skip to content
GitLab
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
6bb885f1
Commit
6bb885f1
authored
Jan 06, 2023
by
Dominik Hebeler
Browse files
fixed view creation
parent
792462ea
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
metager/app/Http/Controllers/MetaGerSearch.php
View file @
6bb885f1
...
...
@@ -28,23 +28,20 @@ class MetaGerSearch extends Controller
}
if
(
$request
->
filled
(
"chrome-plugin"
))
{
echo
redirect
(
LaravelLocalization
::
getLocalizedURL
(
LaravelLocalization
::
getCurrentLocale
(),
"/plugin"
));
return
;
return
redirect
(
LaravelLocalization
::
getLocalizedURL
(
LaravelLocalization
::
getCurrentLocale
(),
"/plugin"
));
}
$focus
=
$request
->
input
(
"focus"
,
"web"
);
if
(
$focus
===
"maps"
)
{
$searchinput
=
$request
->
input
(
'eingabe'
,
''
);
echo
redirect
()
->
to
(
'https://maps.metager.de/map/'
.
$searchinput
.
'/1240908.5493525574,6638783.2192695495,6'
);
return
;
return
redirect
()
->
to
(
'https://maps.metager.de/map/'
.
$searchinput
.
'/1240908.5493525574,6638783.2192695495,6'
);
}
# If there is no query parameter we redirect to the startpage
$eingabe
=
$request
->
input
(
'eingabe'
,
''
);
if
(
empty
(
trim
(
$eingabe
)))
{
echo
redirect
(
LaravelLocalization
::
getLocalizedURL
(
LaravelLocalization
::
getCurrentLocale
(),
'/'
));
return
;
return
redirect
(
LaravelLocalization
::
getLocalizedURL
(
LaravelLocalization
::
getCurrentLocale
(),
'/'
));
}
# Mit gelieferte Formulardaten parsen und abspeichern:
...
...
@@ -60,8 +57,7 @@ class MetaGerSearch extends Controller
# Search query can be empty after parsing the formdata
# we will cancel the search in that case and show an error to the user
if
(
empty
(
$metager
->
getQ
()))
{
echo
$metager
->
createView
();
return
;
return
$metager
->
createView
();
}
$query_timer
->
observeStart
(
"Search_CreateQuicktips"
);
...
...
@@ -142,9 +138,6 @@ class MetaGerSearch extends Controller
}
$query_timer
->
observeEnd
(
"Search_CacheFiller"
);
# Die Ausgabe erstellen:
$resultpage
=
$metager
->
createView
(
$quicktipResults
);
$registry
=
CollectorRegistry
::
getDefault
();
$counter
=
$registry
->
getOrRegisterCounter
(
'metager'
,
'result_counter'
,
'counts total number of returned results'
,
[]);
$counter
->
incBy
(
sizeof
(
$metager
->
getResults
()));
...
...
@@ -152,13 +145,7 @@ class MetaGerSearch extends Controller
$counter
->
inc
();
$query_timer
->
observeTotal
();
// Splitting the response return into multiple parts.
// This might speed up page view time for users with slow network
$responseArray
=
str_split
(
$resultpage
->
render
(),
1024
);
foreach
(
$responseArray
as
$responsePart
)
{
echo
(
$responsePart
);
flush
();
}
return
$metager
->
createView
(
$quicktipResults
);
}
public
function
searchTimings
(
Request
$request
,
MetaGer
$metager
)
...
...
@@ -355,4 +342,4 @@ class MetaGerSearch extends Controller
->
with
(
'title'
,
trans
(
'tips.title'
))
->
with
(
'tips'
,
$tips
);
}
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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