Commit 175f5636 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch '245-confidential-issue' into 'development'

dict.cc nur für Suchen mit weniger als 3 Wörtern

Closes #245

See merge request !692
parents d616a8e8 99043fc4
...@@ -166,19 +166,21 @@ class MetaGerSearch extends Controller ...@@ -166,19 +166,21 @@ class MetaGerSearch extends Controller
$mquicktips = array_merge($mquicktips, $quicktips); $mquicktips = array_merge($mquicktips, $quicktips);
# Dict.cc Quicktip # Dict.cc Quicktip
$url = "http://www.dict.cc/metager.php?s=" . urlencode($q); if (count(explode(' ', $q)) < 3) {
$decodedResponse = json_decode($this->get($url), true); $url = "http://www.dict.cc/metager.php?s=" . urlencode($q);
if ($decodedResponse["headline"] != "" && $decodedResponse["link"] != "") { $decodedResponse = json_decode($this->get($url), true);
$quicktip = []; if ($decodedResponse["headline"] != "" && $decodedResponse["link"] != "") {
$quicktip["title"] = $decodedResponse["headline"]; $quicktip = [];
$quicktip["URL"] = $decodedResponse["link"]; $quicktip["title"] = $decodedResponse["headline"];
$quicktip["summary"] = implode(", ", $decodedResponse["translations"]); $quicktip["URL"] = $decodedResponse["link"];
$quicktip['gefVon'] = trans('metaGerSearch.quicktips.dictcc.adress'); $quicktip["summary"] = implode(", ", $decodedResponse["translations"]);
$quicktip['gefVon'] = trans('metaGerSearch.quicktips.dictcc.adress');
if (App::isLocale('de')) {
array_unshift($mquicktips, $quicktip); if (App::isLocale('de')) {
} else { array_unshift($mquicktips, $quicktip);
$mquicktips[] = $quicktip; } else {
$mquicktips[] = $quicktip;
}
} }
} }
......
Supports Markdown
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