mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
port to 4.1 search thesaurus term to all language
This commit is contained in:
@@ -1426,12 +1426,7 @@ class ThesaurusXmlHttpController extends Controller
|
|||||||
|
|
||||||
public function searchTermJson(Request $request)
|
public function searchTermJson(Request $request)
|
||||||
{
|
{
|
||||||
if (null === $lng = $request->get('lng')) {
|
$lng = $request->get('lng');
|
||||||
$data = explode('_', $this->app['locale']);
|
|
||||||
if (count($data) > 0) {
|
|
||||||
$lng = $data[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$html = '';
|
$html = '';
|
||||||
$sbid = (int) $request->get('sbid');
|
$sbid = (int) $request->get('sbid');
|
||||||
@@ -1485,7 +1480,10 @@ class ThesaurusXmlHttpController extends Controller
|
|||||||
$q2 .= ' and starts-with(@k, \'' . \thesaurus::xquery_escape($unicode->remove_indexer_chars($t[1])) . '\')';
|
$q2 .= ' and starts-with(@k, \'' . \thesaurus::xquery_escape($unicode->remove_indexer_chars($t[1])) . '\')';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($lng != null){
|
||||||
$q2 .= ' and @lng=\'' . \thesaurus::xquery_escape($lng) . '\'';
|
$q2 .= ' and @lng=\'' . \thesaurus::xquery_escape($lng) . '\'';
|
||||||
|
}
|
||||||
|
|
||||||
$q .= ('//sy[' . $q2 . ']');
|
$q .= ('//sy[' . $q2 . ']');
|
||||||
|
|
||||||
$nodes = $xpath->query($q);
|
$nodes = $xpath->query($q);
|
||||||
|
|||||||
Reference in New Issue
Block a user