Merge pull request #436 from jygaulier/master-fix1150

[3.8] fix #1150
This commit is contained in:
Romain Neutron
2013-06-27 04:48:18 -07:00

View File

@@ -368,9 +368,10 @@ class caption_Field_Value implements cache_cacheableInterface
$q = "//sy[@w='" . $term_noacc . "' and not(@k)]"; $q = "//sy[@w='" . $term_noacc . "' and not(@k)]";
} }
$qjs = $link = ""; $qjs = $link = "";
// loop on each linked branch for field
foreach ($DOM_branchs as $DOM_branch) { foreach ($DOM_branchs as $DOM_branch) {
$nodes = $XPATH_thesaurus->cache_query($q, $DOM_branch); $nodes = $XPATH_thesaurus->cache_query($q, $DOM_branch);
if ($nodes->length > 0) {
$lngfound = false; $lngfound = false;
foreach ($nodes as $node) { foreach ($nodes as $node) {
if ($node->getAttribute("lng") == $this->app['locale.I18n']) { if ($node->getAttribute("lng") == $this->app['locale.I18n']) {
@@ -393,15 +394,11 @@ class caption_Field_Value implements cache_cacheableInterface
$k = $synonym->getAttribute("k"); $k = $synonym->getAttribute("k");
if ($synonym->getAttribute("w") != $term_noacc || $k != $context_noacc) { if ($synonym->getAttribute("w") != $term_noacc || $k != $context_noacc) {
$link = $qjs = $synonym->getAttribute("v"); $link = $qjs = $synonym->getAttribute("v");
if ($k) {
$link .= " (" . $k . ")";
$qjs .= " [" . $k . "]";
}
$lngfound = true; $lngfound = true;
break; break;
} }
} }
} }
if (! $lngfound) { if (! $lngfound) {
list($term, $context) = $this->splitTermAndContext($fvalue); list($term, $context) = $this->splitTermAndContext($fvalue);
@@ -414,7 +411,7 @@ class caption_Field_Value implements cache_cacheableInterface
$link = $fvalue; $link = $fvalue;
} }
} }
}
if ($qjs) { if ($qjs) {
$value = "<a class=\"bounce\" onclick=\"bounce('" . $databox->get_sbas_id() . "','" $value = "<a class=\"bounce\" onclick=\"bounce('" . $databox->get_sbas_id() . "','"
. str_replace("'", "\'", $qjs) . str_replace("'", "\'", $qjs)