mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 02:13:15 +00:00
Merge branch '3.8'
Conflicts: composer.lock lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
"symfony/symfony" : "2.4.x-dev",
|
"symfony/symfony" : "2.4.x-dev",
|
||||||
"alchemy-fr/tcpdf-clone" : "~6.0",
|
"alchemy-fr/tcpdf-clone" : "~6.0",
|
||||||
"themattharris/tmhoauth" : "~0.7",
|
"themattharris/tmhoauth" : "~0.7",
|
||||||
"twig/twig" : "~1.13.0",
|
"twig/twig" : "~1.14, >=1.14.2",
|
||||||
"twig/extensions" : "~1.0",
|
"twig/extensions" : "~1.0",
|
||||||
"zend/gdata" : "~1.12.1"
|
"zend/gdata" : "~1.12.1"
|
||||||
},
|
},
|
||||||
|
|||||||
22
composer.lock
generated
22
composer.lock
generated
@@ -3,7 +3,7 @@
|
|||||||
"This file locks the dependencies of your project to a known state",
|
"This file locks the dependencies of your project to a known state",
|
||||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
|
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
|
||||||
],
|
],
|
||||||
"hash": "4f95339f95a308e3ad5bef8f973bffa9",
|
"hash": "090224c87151fc64fac81c3e8d258481",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "alchemy-fr/tcpdf-clone",
|
"name": "alchemy-fr/tcpdf-clone",
|
||||||
@@ -2821,12 +2821,12 @@
|
|||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/symfony.git",
|
"url": "https://github.com/symfony/symfony.git",
|
||||||
"reference": "f7692beec7ad44e4b48c92d9936501ac235925b6"
|
"reference": "7fecfbce3e7ce87d3a04d8276fd835cd73979309"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/symfony/zipball/f7692beec7ad44e4b48c92d9936501ac235925b6",
|
"url": "https://api.github.com/repos/symfony/symfony/zipball/7fecfbce3e7ce87d3a04d8276fd835cd73979309",
|
||||||
"reference": "f7692beec7ad44e4b48c92d9936501ac235925b6",
|
"reference": "7fecfbce3e7ce87d3a04d8276fd835cd73979309",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -2926,7 +2926,7 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"framework"
|
"framework"
|
||||||
],
|
],
|
||||||
"time": "2013-10-31 11:15:14"
|
"time": "2013-10-31 14:00:33"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "themattharris/tmhoauth",
|
"name": "themattharris/tmhoauth",
|
||||||
@@ -3019,16 +3019,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "twig/twig",
|
"name": "twig/twig",
|
||||||
"version": "v1.13.2",
|
"version": "v1.14.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/fabpot/Twig.git",
|
"url": "https://github.com/fabpot/Twig.git",
|
||||||
"reference": "6d6a1009427d1f398c9d40904147bf9f723d5755"
|
"reference": "ca445842fcea4f844d68203ffa2d00f5e3cdea64"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/fabpot/Twig/zipball/6d6a1009427d1f398c9d40904147bf9f723d5755",
|
"url": "https://api.github.com/repos/fabpot/Twig/zipball/ca445842fcea4f844d68203ffa2d00f5e3cdea64",
|
||||||
"reference": "6d6a1009427d1f398c9d40904147bf9f723d5755",
|
"reference": "ca445842fcea4f844d68203ffa2d00f5e3cdea64",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -3037,7 +3037,7 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.13-dev"
|
"dev-master": "1.14-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -3064,7 +3064,7 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"templating"
|
"templating"
|
||||||
],
|
],
|
||||||
"time": "2013-08-03 15:35:31"
|
"time": "2013-10-30 08:20:53"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "zend/gdata",
|
"name": "zend/gdata",
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class Step35 implements DatasUpgraderInterface
|
|||||||
$stmt->execute(array(':record_id' => $row['record_id']));
|
$stmt->execute(array(':record_id' => $row['record_id']));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$record = new \record_adapter($app, $databox->get_sbas_id(), $row['record_id']);
|
$record = new \record_adapter($this->app, $databox->get_sbas_id(), $row['record_id']);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->app['monolog']->addError(sprintf("Unable to load record %d on databox %d : %s", $record->get_record_id(), $record->get_sbas_id(), $record->get_sbas_id(), $e->getMessage()));
|
$this->app['monolog']->addError(sprintf("Unable to load record %d on databox %d : %s", $record->get_record_id(), $record->get_sbas_id(), $record->get_sbas_id(), $e->getMessage()));
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -28,11 +28,16 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
|
|
||||||
$controllers->before(function () use ($app) {
|
$controllers->before(function () use ($app) {
|
||||||
$app['firewall']->requireAuthentication();
|
$app['firewall']->requireAuthentication();
|
||||||
$app['firewall']->requireAccessToModule('thesaurus');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$controllers->match('acceptcandidates.j.php', 'controller.thesaurus.xmlhttp:AcceptCandidatesJson');
|
$controllers->match('acceptcandidates.j.php', 'controller.thesaurus.xmlhttp:AcceptCandidatesJson')
|
||||||
$controllers->match('checkcandidatetarget.j.php', 'controller.thesaurus.xmlhttp:CheckCandidateTargetJson');
|
->before(function () use ($app) {
|
||||||
|
$app['firewall']->requireAccessToModule('thesaurus');
|
||||||
|
});
|
||||||
|
$controllers->match('checkcandidatetarget.j.php', 'controller.thesaurus.xmlhttp:CheckCandidateTargetJson')
|
||||||
|
->before(function () use ($app) {
|
||||||
|
$app['firewall']->requireAccessToModule('thesaurus');
|
||||||
|
});
|
||||||
$controllers->match('editing_presets.j.php', 'controller.thesaurus.xmlhttp:EditingPresetsJson');
|
$controllers->match('editing_presets.j.php', 'controller.thesaurus.xmlhttp:EditingPresetsJson');
|
||||||
$controllers->match('getsy_prod.x.php', 'controller.thesaurus.xmlhttp:GetSynonymsXml');
|
$controllers->match('getsy_prod.x.php', 'controller.thesaurus.xmlhttp:GetSynonymsXml');
|
||||||
$controllers->match('getterm_prod.h.php', 'controller.thesaurus.xmlhttp:GetTermHtml');
|
$controllers->match('getterm_prod.h.php', 'controller.thesaurus.xmlhttp:GetTermHtml');
|
||||||
@@ -40,7 +45,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$controllers->match('openbranch_prod.j.php', 'controller.thesaurus.xmlhttp:OpenBranchJson');
|
$controllers->match('openbranch_prod.j.php', 'controller.thesaurus.xmlhttp:OpenBranchJson');
|
||||||
$controllers->match('openbranches_prod.h.php', 'controller.thesaurus.xmlhttp:OpenBranchesHtml');
|
$controllers->match('openbranches_prod.h.php', 'controller.thesaurus.xmlhttp:OpenBranchesHtml');
|
||||||
$controllers->match('openbranches_prod.x.php', 'controller.thesaurus.xmlhttp:OpenBranchesXml');
|
$controllers->match('openbranches_prod.x.php', 'controller.thesaurus.xmlhttp:OpenBranchesXml');
|
||||||
$controllers->match('replacecandidate.j.php', 'controller.thesaurus.xmlhttp:ReplaceCandidateJson');
|
$controllers->match('replacecandidate.j.php', 'controller.thesaurus.xmlhttp:ReplaceCandidateJson')
|
||||||
|
->before(function () use ($app) {
|
||||||
|
$app['firewall']->requireAccessToModule('thesaurus');
|
||||||
|
});
|
||||||
$controllers->match('search_th_term_prod.j.php', 'controller.thesaurus.xmlhttp:SearchTermJson');
|
$controllers->match('search_th_term_prod.j.php', 'controller.thesaurus.xmlhttp:SearchTermJson');
|
||||||
|
|
||||||
return $controllers;
|
return $controllers;
|
||||||
@@ -75,6 +83,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$q = "/thesaurus//te[@id='" . $request->get("tid") . "']";
|
$q = "/thesaurus//te[@id='" . $request->get("tid") . "']";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
printf("qth: %s<br/>\n", $q);
|
||||||
|
}
|
||||||
|
|
||||||
$parentnode = $xpathth->query($q)->item(0);
|
$parentnode = $xpathth->query($q)->item(0);
|
||||||
if (!$parentnode) {
|
if (!$parentnode) {
|
||||||
throw new \Exception('Unable to find branch');
|
throw new \Exception('Unable to find branch');
|
||||||
@@ -85,6 +97,9 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
|
|
||||||
foreach ($request->get("cid") as $cid) {
|
foreach ($request->get("cid") as $cid) {
|
||||||
$q = "//te[@id='" . $cid . "']";
|
$q = "//te[@id='" . $cid . "']";
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
printf("qct: %s<br/>\n", $q);
|
||||||
|
}
|
||||||
$ct = $xpathct->query($q)->item(0);
|
$ct = $xpathct->query($q)->item(0);
|
||||||
if (!$ct) {
|
if (!$ct) {
|
||||||
continue;
|
continue;
|
||||||
@@ -106,6 +121,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$this->renumerate($request->get('piv'), $te, $pid, $chgids);
|
$this->renumerate($request->get('piv'), $te, $pid, $chgids);
|
||||||
$te = $parentnode->appendChild($te);
|
$te = $parentnode->appendChild($te);
|
||||||
|
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
printf("newid=%s<br/>\n", $te->getAttribute("id"));
|
||||||
|
}
|
||||||
|
|
||||||
$soldid = str_replace(".", "d", $oldid) . "d";
|
$soldid = str_replace(".", "d", $oldid) . "d";
|
||||||
$snewid = str_replace(".", "d", $pid) . "d";
|
$snewid = str_replace(".", "d", $pid) . "d";
|
||||||
$l = strlen($soldid) + 1;
|
$l = strlen($soldid) + 1;
|
||||||
@@ -114,9 +133,13 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
SET value=CONCAT('$snewid', SUBSTRING(value FROM $l))
|
SET value=CONCAT('$snewid', SUBSTRING(value FROM $l))
|
||||||
WHERE value LIKE :like";
|
WHERE value LIKE :like";
|
||||||
|
|
||||||
$stmt = $connbas->prepare($sql);
|
if ($request->get("debug")) {
|
||||||
$stmt->execute(array(':like' => $soldid . '%'));
|
printf("soldid=%s ; snewid=%s<br/>\nsql=%s<br/>\n", $soldid, $snewid, $sql);
|
||||||
$stmt->closeCursor();
|
} else {
|
||||||
|
$stmt = $connbas->prepare($sql);
|
||||||
|
$stmt->execute(array(':like' => $soldid . '%'));
|
||||||
|
$stmt->closeCursor();
|
||||||
|
}
|
||||||
|
|
||||||
$refreshid = $parentnode->getAttribute('id');
|
$refreshid = $parentnode->getAttribute('id');
|
||||||
$refresh['T' . $refreshid] = array(
|
$refresh['T' . $refreshid] = array(
|
||||||
@@ -142,6 +165,9 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
if ($ct2->nodeType != XML_ELEMENT_NODE || $ct2->nodeName != 'sy') {
|
if ($ct2->nodeType != XML_ELEMENT_NODE || $ct2->nodeName != 'sy') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("ct2:%s \n", var_export($ct2, true));
|
||||||
|
}
|
||||||
$nid = $parentnode->getAttribute("nextid");
|
$nid = $parentnode->getAttribute("nextid");
|
||||||
$parentnode->setAttribute("nextid", (int) $nid + 1);
|
$parentnode->setAttribute("nextid", (int) $nid + 1);
|
||||||
|
|
||||||
@@ -158,6 +184,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$this->renumerate($request->get('piv'), $te, $pid, $chgids);
|
$this->renumerate($request->get('piv'), $te, $pid, $chgids);
|
||||||
$te = $parentnode->appendChild($te);
|
$te = $parentnode->appendChild($te);
|
||||||
|
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
printf("newid=%s<br/>\n", $te->getAttribute("id"));
|
||||||
|
}
|
||||||
|
|
||||||
$soldid = str_replace(".", "d", $oldid) . "d";
|
$soldid = str_replace(".", "d", $oldid) . "d";
|
||||||
$snewid = str_replace(".", "d", $pid) . "d";
|
$snewid = str_replace(".", "d", $pid) . "d";
|
||||||
$l = strlen($soldid) + 1;
|
$l = strlen($soldid) + 1;
|
||||||
@@ -166,9 +196,13 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
SET value = CONCAT('$snewid', SUBSTRING(value FROM $l))
|
SET value = CONCAT('$snewid', SUBSTRING(value FROM $l))
|
||||||
WHERE value LIKE :like";
|
WHERE value LIKE :like";
|
||||||
|
|
||||||
$stmt = $connbas->prepare($sql);
|
if ($request->get("debug")) {
|
||||||
$stmt->execute(array(':like' => $soldid . '%'));
|
printf("soldid=%s ; snewid=%s<br/>\nsql=%s<br/>\n", $soldid, $snewid, $sql);
|
||||||
$stmt->closeCursor();
|
} else {
|
||||||
|
$stmt = $connbas->prepare($sql);
|
||||||
|
$stmt->execute(array(':like' => $soldid . '%'));
|
||||||
|
$stmt->closeCursor();
|
||||||
|
}
|
||||||
|
|
||||||
$thchanged = true;
|
$thchanged = true;
|
||||||
}
|
}
|
||||||
@@ -254,6 +288,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$tbranch = $databox_field->get_tbranch();
|
$tbranch = $databox_field->get_tbranch();
|
||||||
$q = "(" . $tbranch . ")/descendant-or-self::te[@id='" . $request->get("id") . "']";
|
$q = "(" . $tbranch . ")/descendant-or-self::te[@id='" . $request->get("id") . "']";
|
||||||
|
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
printf("tbranch-q = \" $q \" <br/>\n");
|
||||||
|
}
|
||||||
|
|
||||||
$nodes = $xpath->query($q);
|
$nodes = $xpath->query($q);
|
||||||
|
|
||||||
$json['acceptable'] = ($nodes->length > 0);
|
$json['acceptable'] = ($nodes->length > 0);
|
||||||
@@ -267,6 +305,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$q = "/thesaurus//te[@id='" . $request->get("id") . "']";
|
$q = "/thesaurus//te[@id='" . $request->get("id") . "']";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
print("q:" . $q . "<br/>\n");
|
||||||
|
}
|
||||||
|
|
||||||
$nodes = $xpath->query($q);
|
$nodes = $xpath->query($q);
|
||||||
$json['found'] = $nodes->length;
|
$json['found'] = $nodes->length;
|
||||||
|
|
||||||
@@ -274,14 +316,23 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$fullpath_html = $fullpath = "";
|
$fullpath_html = $fullpath = "";
|
||||||
for ($depth = 0, $n = $nodes->item(0); $n; $n = $n->parentNode, $depth--) {
|
for ($depth = 0, $n = $nodes->item(0); $n; $n = $n->parentNode, $depth--) {
|
||||||
if ($n->nodeName == "te") {
|
if ($n->nodeName == "te") {
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
printf("parent:%s<br/>\n", $n->nodeName);
|
||||||
|
}
|
||||||
$firstsy = $goodsy = null;
|
$firstsy = $goodsy = null;
|
||||||
for ($n2 = $n->firstChild; $n2; $n2 = $n2->nextSibling) {
|
for ($n2 = $n->firstChild; $n2; $n2 = $n2->nextSibling) {
|
||||||
if ($n2->nodeName == "sy") {
|
if ($n2->nodeName == "sy") {
|
||||||
$sy = $n2->getAttribute("v");
|
$sy = $n2->getAttribute("v");
|
||||||
if (!$firstsy) {
|
if (!$firstsy) {
|
||||||
$firstsy = $sy;
|
$firstsy = $sy;
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
printf("fullpath : firstsy='%s' in %s<br/>\n", $firstsy, $n2->getAttribute("lng"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($n2->getAttribute("lng") == $request->get("piv")) {
|
if ($n2->getAttribute("lng") == $request->get("piv")) {
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
printf("fullpath : found '%s' in %s<br/>\n", $sy, $n2->getAttribute("lng"));
|
||||||
|
}
|
||||||
$goodsy = $sy;
|
$goodsy = $sy;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -324,6 +375,7 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
'presetid' => $request->get('presetid'),
|
'presetid' => $request->get('presetid'),
|
||||||
'title' => $request->get('title'),
|
'title' => $request->get('title'),
|
||||||
'f' => $request->get('f'),
|
'f' => $request->get('f'),
|
||||||
|
'debug' => $request->get('debug'),
|
||||||
));
|
));
|
||||||
|
|
||||||
switch ($request->get('act')) {
|
switch ($request->get('act')) {
|
||||||
@@ -474,6 +526,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$xpath = $databox->get_xpath_thesaurus();
|
$xpath = $databox->get_xpath_thesaurus();
|
||||||
$q = "/thesaurus//sy[@id='" . $request->get('id') . "']";
|
$q = "/thesaurus//sy[@id='" . $request->get('id') . "']";
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
print("q:" . $q . "<br/>\n");
|
||||||
|
}
|
||||||
|
|
||||||
$nodes = $xpath->query($q);
|
$nodes = $xpath->query($q);
|
||||||
if ($nodes->length > 0) {
|
if ($nodes->length > 0) {
|
||||||
$n2 = $nodes->item(0);
|
$n2 = $nodes->item(0);
|
||||||
@@ -508,6 +564,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$q = "/thesaurus//te[@id='" . $request->get("id") . "']";
|
$q = "/thesaurus//te[@id='" . $request->get("id") . "']";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
print("q:" . $q . "<br/>\n");
|
||||||
|
}
|
||||||
|
|
||||||
$nodes = $xpath->query($q);
|
$nodes = $xpath->query($q);
|
||||||
if ($nodes->length > 0) {
|
if ($nodes->length > 0) {
|
||||||
$nts = 0;
|
$nts = 0;
|
||||||
@@ -582,6 +642,9 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
if ($request->get("sortsy") && $request->get("lng")) {
|
if ($request->get("sortsy") && $request->get("lng")) {
|
||||||
ksort($tts, SORT_STRING);
|
ksort($tts, SORT_STRING);
|
||||||
}
|
}
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
printf("tts : <pre>%s</pre><br/>\n", var_export($tts, true));
|
||||||
|
}
|
||||||
|
|
||||||
$bid = $request->get("bid");
|
$bid = $request->get("bid");
|
||||||
foreach ($tts as $ts) {
|
foreach ($tts as $ts) {
|
||||||
@@ -623,6 +686,7 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
"bid" => $request->get('bid'),
|
"bid" => $request->get('bid'),
|
||||||
"id" => $request->get('id'),
|
"id" => $request->get('id'),
|
||||||
"sortsy" => $request->get('sortsy'),
|
"sortsy" => $request->get('sortsy'),
|
||||||
|
"debug" => $request->get('debug'),
|
||||||
), true)));
|
), true)));
|
||||||
|
|
||||||
$html = $root->appendChild($ret->createElement("html"));
|
$html = $root->appendChild($ret->createElement("html"));
|
||||||
@@ -645,6 +709,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$q = "/thesaurus//te[@id='" . $request->get("id") . "']";
|
$q = "/thesaurus//te[@id='" . $request->get("id") . "']";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
print("q:" . $q . "<br/>\n");
|
||||||
|
}
|
||||||
|
|
||||||
$nodes = $xpath->query($q);
|
$nodes = $xpath->query($q);
|
||||||
if ($nodes->length > 0) {
|
if ($nodes->length > 0) {
|
||||||
$nts = 0;
|
$nts = 0;
|
||||||
@@ -720,6 +788,9 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
if ($request->get("sortsy") && $app['locale']) {
|
if ($request->get("sortsy") && $app['locale']) {
|
||||||
ksort($tts, SORT_STRING);
|
ksort($tts, SORT_STRING);
|
||||||
}
|
}
|
||||||
|
if ($request->get("debug")) {
|
||||||
|
printf("tts : <pre>%s</pre><br/>\n", var_export($tts, true));
|
||||||
|
}
|
||||||
|
|
||||||
$zhtml = "";
|
$zhtml = "";
|
||||||
$bid = $request->get("bid");
|
$bid = $request->get("bid");
|
||||||
@@ -788,6 +859,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("/*\n thid=%s\n %s \n */\n", $thid, $sql);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($rs as $rowbas) {
|
foreach ($rs as $rowbas) {
|
||||||
$t_nrec[$thid] = $rowbas;
|
$t_nrec[$thid] = $rowbas;
|
||||||
}
|
}
|
||||||
@@ -804,6 +879,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("/*\n thid=%s\n %s \n */\n", $thid, $sql);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($rs as $rowbas) {
|
foreach ($rs as $rowbas) {
|
||||||
$t_nrec[$thid . $rowbas['k']] = $rowbas;
|
$t_nrec[$thid . $rowbas['k']] = $rowbas;
|
||||||
}
|
}
|
||||||
@@ -821,6 +900,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("/*\n thid=%s\n %s \n */\n", $thid, $sql);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($rs as $rowbas) {
|
foreach ($rs as $rowbas) {
|
||||||
$t_nrec[$thid] = $rowbas;
|
$t_nrec[$thid] = $rowbas;
|
||||||
}
|
}
|
||||||
@@ -837,11 +920,19 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("/*\n thid=%s\n %s \n */\n", $thid, $sql);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($rs as $rowbas) {
|
foreach ($rs as $rowbas) {
|
||||||
$t_nrec[$thid . '.' . $rowbas['k']] = $rowbas;
|
$t_nrec[$thid . '.' . $rowbas['k']] = $rowbas;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("/* %s */\n", var_export($t_nrec, true));
|
||||||
|
}
|
||||||
|
|
||||||
$databox = $app['phraseanet.appbox']->get_databox($sbid);
|
$databox = $app['phraseanet.appbox']->get_databox($sbid);
|
||||||
if ($request->get('type') == 'T') {
|
if ($request->get('type') == 'T') {
|
||||||
$xqroot = 'thesaurus';
|
$xqroot = 'thesaurus';
|
||||||
@@ -852,12 +943,19 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($dom) {
|
if ($dom) {
|
||||||
|
$term0 = '';
|
||||||
|
$firstTerm0 = '';
|
||||||
|
|
||||||
$xpath = new \DOMXPath($dom);
|
$xpath = new \DOMXPath($dom);
|
||||||
if ($thid == 'T' || $thid == 'C') {
|
if ($thid == 'T' || $thid == 'C') {
|
||||||
$q = '/' . $xqroot;
|
$q = '/' . $xqroot;
|
||||||
|
$term0 = $dbname;
|
||||||
} else {
|
} else {
|
||||||
$q = '/' . $xqroot . '//te[@id=\'' . $thid . '\']';
|
$q = '/' . $xqroot . '//te[@id=\'' . $thid . '\']';
|
||||||
}
|
}
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
print("q:" . $q . "<br/>\n");
|
||||||
|
}
|
||||||
|
|
||||||
$nodes = $xpath->query($q);
|
$nodes = $xpath->query($q);
|
||||||
if ($nodes->length > 0) {
|
if ($nodes->length > 0) {
|
||||||
@@ -911,6 +1009,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("tts(%s) : <pre>%s</pre><br/>\n", $nts, var_export($tts, true));
|
||||||
|
}
|
||||||
|
|
||||||
if ($nts > 0) {
|
if ($nts > 0) {
|
||||||
$field0 = $node0->getAttribute('field');
|
$field0 = $node0->getAttribute('field');
|
||||||
if ($field0) {
|
if ($field0) {
|
||||||
@@ -924,6 +1026,9 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
} elseif ($request->get('type') == 'C') {
|
} elseif ($request->get('type') == 'C') {
|
||||||
$tts = array_reverse($tts);
|
$tts = array_reverse($tts);
|
||||||
}
|
}
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("%s: type=%s : <pre>%s</pre><br/>\n", __LINE__, $request->get('type'), var_export($tts, true));
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($tts as $ts) {
|
foreach ($tts as $ts) {
|
||||||
$class = '';
|
$class = '';
|
||||||
@@ -973,6 +1078,7 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
'id' => $request->get('id'),
|
'id' => $request->get('id'),
|
||||||
'lng' => $request->get('lng'),
|
'lng' => $request->get('lng'),
|
||||||
'sortsy' => $request->get('sortsy'),
|
'sortsy' => $request->get('sortsy'),
|
||||||
|
'debug' => $request->get('debug'),
|
||||||
'root' => $request->get('root'),
|
'root' => $request->get('root'),
|
||||||
'last' => $request->get('last'),
|
'last' => $request->get('last'),
|
||||||
), 'html' => $html));
|
), 'html' => $html));
|
||||||
@@ -1049,6 +1155,9 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$xpath = $databox->get_xpath_thesaurus();
|
$xpath = $databox->get_xpath_thesaurus();
|
||||||
$q = '/thesaurus';
|
$q = '/thesaurus';
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
print('q:' . $q . '<br/>\n');
|
||||||
|
}
|
||||||
if (($znode = $xpath->query($q)->item(0))) {
|
if (($znode = $xpath->query($q)->item(0))) {
|
||||||
$q2 = '//sy';
|
$q2 = '//sy';
|
||||||
if ($request->get('t')) {
|
if ($request->get('t')) {
|
||||||
@@ -1085,6 +1194,9 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$html .= '</p>';
|
$html .= '</p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf('zhtml=%s<br/>\n', $html);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Response($html);
|
return new Response($html);
|
||||||
@@ -1170,10 +1282,11 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$ret->preserveWhiteSpace = false;
|
$ret->preserveWhiteSpace = false;
|
||||||
$root = $ret->appendChild($ret->createElement('result'));
|
$root = $ret->appendChild($ret->createElement('result'));
|
||||||
$root->appendChild($ret->createCDATASection(var_export(array(
|
$root->appendChild($ret->createCDATASection(var_export(array(
|
||||||
'bid' => $request->get('bid'),
|
'bid' => $request->get('bid'),
|
||||||
't' => $request->get('t'),
|
't' => $request->get('t'),
|
||||||
'mod' => $request->get('mod'),
|
'mod' => $request->get('mod'),
|
||||||
), true)));
|
'debug' => $request->get('debug'),
|
||||||
|
), true)));
|
||||||
|
|
||||||
$html = $root->appendChild($ret->createElement('html'));
|
$html = $root->appendChild($ret->createElement('html'));
|
||||||
|
|
||||||
@@ -1191,6 +1304,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$xpath = $databox->get_xpath_thesaurus();
|
$xpath = $databox->get_xpath_thesaurus();
|
||||||
$q = '/thesaurus';
|
$q = '/thesaurus';
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
print('q:' . $q . '<br/>\n');
|
||||||
|
}
|
||||||
|
|
||||||
if (($znode = $xpath->query($q)->item(0))) {
|
if (($znode = $xpath->query($q)->item(0))) {
|
||||||
$q2 = '//sy';
|
$q2 = '//sy';
|
||||||
if ($request->get('t')) {
|
if ($request->get('t')) {
|
||||||
@@ -1200,12 +1317,18 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$q2 .= ' and starts-with(@k, \'' . \thesaurus::xquery_escape($app['unicode']->remove_indexer_chars($t[1])) . '\')';
|
$q2 .= ' and starts-with(@k, \'' . \thesaurus::xquery_escape($app['unicode']->remove_indexer_chars($t[1])) . '\')';
|
||||||
$q2 = '//sy[' . $q2 . ']';
|
$q2 = '//sy[' . $q2 . ']';
|
||||||
}
|
}
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
print('q2:' . $q2 . '<br/>\n');
|
||||||
|
}
|
||||||
$nodes = $xpath->query($q2, $znode);
|
$nodes = $xpath->query($q2, $znode);
|
||||||
if ($mod == 'TREE') {
|
if ($mod == 'TREE') {
|
||||||
for ($i = 0; $i < $nodes->length; $i++) {
|
for ($i = 0; $i < $nodes->length; $i++) {
|
||||||
$nodes->item($i)->setAttribute('bold', '1');
|
$nodes->item($i)->setAttribute('bold', '1');
|
||||||
for ($n = $nodes->item($i)->parentNode; $n && $n->nodeType == XML_ELEMENT_NODE && $n->nodeName == 'te'; $n = $n->parentNode) {
|
for ($n = $nodes->item($i)->parentNode; $n && $n->nodeType == XML_ELEMENT_NODE && $n->nodeName == 'te'; $n = $n->parentNode) {
|
||||||
$n->setAttribute('open', '1');
|
$n->setAttribute('open', '1');
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf('opening node te id=%s<br/>\n', $n->getAttribute('id'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1223,6 +1346,9 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$zhtml .= '</p>';
|
$zhtml .= '</p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf('zhtml=%s<br/>\n', $zhtml);
|
||||||
|
}
|
||||||
$html->appendChild($ret->createTextNode($zhtml));
|
$html->appendChild($ret->createTextNode($zhtml));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1308,6 +1434,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$tsbas['b' . $sbas_id]['tids'][] = implode('.', $id);
|
$tsbas['b' . $sbas_id]['tids'][] = implode('.', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
var_dump($tsbas);
|
||||||
|
}
|
||||||
|
|
||||||
$appbox = $app['phraseanet.appbox'];
|
$appbox = $app['phraseanet.appbox'];
|
||||||
|
|
||||||
// first, count the number of records to update
|
// first, count the number of records to update
|
||||||
@@ -1334,7 +1464,7 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$xp = '//te[@id="' . $tid . '"]/sy';
|
$xp = '//te[@id="' . $tid . '"]/sy';
|
||||||
$nodes = $xpathct->query($xp);
|
$nodes = $xpathct->query($xp);
|
||||||
if ($nodes->length == 1) {
|
if ($nodes->length == 1) {
|
||||||
$sy = $nodes->item(0);
|
$sy = $term = $nodes->item(0);
|
||||||
$syid = str_replace('.', 'd', $sy->getAttribute('id')) . 'd';
|
$syid = str_replace('.', 'd', $sy->getAttribute('id')) . 'd';
|
||||||
$lid .= ( $lid ? ',' : '') . "'" . $syid . "'";
|
$lid .= ( $lid ? ',' : '') . "'" . $syid . "'";
|
||||||
$field = $sy->parentNode->parentNode->getAttribute('field');
|
$field = $sy->parentNode->parentNode->getAttribute('field');
|
||||||
@@ -1359,12 +1489,22 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$stmt = $connbas->prepare($sql);
|
$stmt = $connbas->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("(%d) sql: \n", __LINE__);
|
||||||
|
var_dump($sql);
|
||||||
|
}
|
||||||
|
|
||||||
$tsbas[$ksbas]['trids'] = $stmt->fetchAll(\PDO::FETCH_COLUMN, 0);
|
$tsbas[$ksbas]['trids'] = $stmt->fetchAll(\PDO::FETCH_COLUMN, 0);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$ret['nRecsToUpdate'] += count($tsbas[$ksbas]['trids']);
|
$ret['nRecsToUpdate'] += count($tsbas[$ksbas]['trids']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("(%d) nRecsToUpdate = %d \ntsbas: \n", __LINE__, $ret['nRecsToUpdate']);
|
||||||
|
print_r($tsbas);
|
||||||
|
}
|
||||||
|
|
||||||
if ($ret['nRecsToUpdate'] <= self::SEARCH_REPLACE_MAXREC) {
|
if ($ret['nRecsToUpdate'] <= self::SEARCH_REPLACE_MAXREC) {
|
||||||
foreach ($tsbas as $sbas) {
|
foreach ($tsbas as $sbas) {
|
||||||
|
|
||||||
@@ -1378,6 +1518,10 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
|
|
||||||
// fix caption of records
|
// fix caption of records
|
||||||
foreach ($sbas['trids'] as $rid) {
|
foreach ($sbas['trids'] as $rid) {
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("(%d) ======== working on record_id = %d ======= \n", __LINE__, $rid);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
$record = $databox->get_record($rid);
|
$record = $databox->get_record($rid);
|
||||||
|
|
||||||
@@ -1387,11 +1531,17 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
/* @var $field caption_field */
|
/* @var $field caption_field */
|
||||||
foreach ($record->get_caption()->get_fields(null, true) as $field) {
|
foreach ($record->get_caption()->get_fields(null, true) as $field) {
|
||||||
$meta_struct_id = $field->get_meta_struct_id();
|
$meta_struct_id = $field->get_meta_struct_id();
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("(%d) field '%s' meta_struct_id=%s \n", __LINE__, $field->get_name(), $meta_struct_id);
|
||||||
|
}
|
||||||
|
|
||||||
/* @var $v caption_Field_Value */
|
/* @var $v caption_Field_Value */
|
||||||
$fname = $field->get_name();
|
$fname = $field->get_name();
|
||||||
if (!array_key_exists($fname, $sbas['tvals'])) {
|
if (!array_key_exists($fname, $sbas['tvals'])) {
|
||||||
foreach ($field->get_values() as $v) {
|
foreach ($field->get_values() as $v) {
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("(%d) ...v = '%s' (meta_id=%s) keep \n", __LINE__, $v->getValue(), $v->getId());
|
||||||
|
}
|
||||||
$metadatask[] = array(
|
$metadatask[] = array(
|
||||||
'meta_struct_id' => $meta_struct_id,
|
'meta_struct_id' => $meta_struct_id,
|
||||||
'meta_id' => $v->getId(),
|
'meta_id' => $v->getId(),
|
||||||
@@ -1408,6 +1558,9 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("(%d) ...v = '%s' (meta_id=%s) %s \n", __LINE__, $v->getValue(), $v->getId(), ($keep ? '' : '!!! drop !!!'));
|
||||||
|
}
|
||||||
if ($keep) {
|
if ($keep) {
|
||||||
$metadatask[] = array(
|
$metadatask[] = array(
|
||||||
'meta_struct_id' => $meta_struct_id,
|
'meta_struct_id' => $meta_struct_id,
|
||||||
@@ -1425,15 +1578,28 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("(%d) metadatask: \n", __LINE__);
|
||||||
|
var_dump($metadatask);
|
||||||
|
printf("(%d) metadatasd: \n", __LINE__);
|
||||||
|
var_dump($metadatasd);
|
||||||
|
}
|
||||||
|
|
||||||
if (count($metadatasd) > 0) {
|
if (count($metadatasd) > 0) {
|
||||||
$record->set_metadatas($metadatasd, true);
|
if (!$request->get('debug')) {
|
||||||
$ret['nRecsUpdated']++;
|
$record->set_metadatas($metadatasd, true);
|
||||||
|
$ret['nRecsUpdated']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// delete the branch from the cterms
|
||||||
|
if ($request->get('debug')) {
|
||||||
|
printf("cterms before :\n%s \n", $sbas['domct']->saveXML());
|
||||||
|
}
|
||||||
foreach ($sbas['tvals'] as $tval) {
|
foreach ($sbas['tvals'] as $tval) {
|
||||||
foreach ($tval as $sy) {
|
foreach ($tval as $sy) {
|
||||||
// remove candidate from cterms
|
// remove candidate from cterms
|
||||||
@@ -1442,7 +1608,12 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$ret['ctermsDeleted'][] = $sbas['sbas_id'] . '.' . $te->getAttribute('id');
|
$ret['ctermsDeleted'][] = $sbas['sbas_id'] . '.' . $te->getAttribute('id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$databox->saveCterms($sbas['domct']);
|
if ($request->get('debug')) {
|
||||||
|
printf("cterms after :\n%s \n", $sbas['domct']->saveXML());
|
||||||
|
}
|
||||||
|
if (!$request->get('debug')) {
|
||||||
|
$databox->saveCterms($sbas['domct']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$ret['msg'] = sprintf(_('prod::thesaurusTab:dlg:%d record(s) updated'), $ret['nRecsUpdated']);
|
$ret['msg'] = sprintf(_('prod::thesaurusTab:dlg:%d record(s) updated'), $ret['nRecsUpdated']);
|
||||||
} else {
|
} else {
|
||||||
@@ -1464,6 +1635,7 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
|
|
||||||
$html = '';
|
$html = '';
|
||||||
$sbid = (int) $request->get('sbid');
|
$sbid = (int) $request->get('sbid');
|
||||||
|
$dbname = '';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$databox = $app['phraseanet.appbox']->get_databox($sbid);
|
$databox = $app['phraseanet.appbox']->get_databox($sbid);
|
||||||
@@ -1497,13 +1669,21 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
if (($q !== null) && $domth) {
|
if (($q !== null) && $domth) {
|
||||||
$xpath = new \DOMXPath($domth);
|
$xpath = new \DOMXPath($domth);
|
||||||
|
|
||||||
|
if ($request->get('debug'))
|
||||||
|
print('q:' . $q . "\n");
|
||||||
|
|
||||||
$t = $this->splitTermAndContext($request->get('t'));
|
$t = $this->splitTermAndContext($request->get('t'));
|
||||||
$q2 = 'starts-with(@w, \'' . \thesaurus::xquery_escape($app['unicode']->remove_indexer_chars($t[0])) . '\')';
|
$q2 = 'starts-with(@w, \'' . \thesaurus::xquery_escape($app['unicode']->remove_indexer_chars($t[0])) . '\')';
|
||||||
if ($t[1])
|
if ($t[1])
|
||||||
$q2 .= ' and starts-with(@k, \'' . \thesaurus::xquery_escape($app['unicode']->remove_indexer_chars($t[1])) . '\')';
|
$q2 .= ' and starts-with(@k, \'' . \thesaurus::xquery_escape($app['unicode']->remove_indexer_chars($t[1])) . '\')';
|
||||||
$q2 = '//sy[' . $q2 . ' and @lng=\'' . $lng . '\']';
|
$q2 = '//sy[' . $q2 . ' and @lng=\'' . $lng . '\']';
|
||||||
|
|
||||||
|
if ($request->get('debug'))
|
||||||
|
print('q2:' . $q2 . "\n");
|
||||||
|
|
||||||
$q .= $q2;
|
$q .= $q2;
|
||||||
|
if ($request->get('debug'))
|
||||||
|
print('q:' . $q . "\n");
|
||||||
|
|
||||||
$nodes = $xpath->query($q);
|
$nodes = $xpath->query($q);
|
||||||
|
|
||||||
@@ -1511,6 +1691,8 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
$nodes->item($i)->setAttribute('bold', '1');
|
$nodes->item($i)->setAttribute('bold', '1');
|
||||||
for ($n = $nodes->item($i)->parentNode; $n && $n->nodeType == XML_ELEMENT_NODE && $n->nodeName == 'te'; $n = $n->parentNode) {
|
for ($n = $nodes->item($i)->parentNode; $n && $n->nodeType == XML_ELEMENT_NODE && $n->nodeName == 'te'; $n = $n->parentNode) {
|
||||||
$n->setAttribute('open', '1');
|
$n->setAttribute('open', '1');
|
||||||
|
if ($request->get('debug'))
|
||||||
|
printf("opening node te id=%s \n", $n->getAttribute('id'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1530,10 +1712,11 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
't' => $request->get('t'),
|
't' => $request->get('t'),
|
||||||
'field' => $request->get('field'),
|
'field' => $request->get('field'),
|
||||||
'lng' => $request->get('lng'),
|
'lng' => $request->get('lng'),
|
||||||
|
'debug' => $request->get('debug'),
|
||||||
), 'html' => $html));
|
), 'html' => $html));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildTermLabel($language, \DOMNode $n, &$key0, &$nts0)
|
private function buildTermLabel($language, $n, &$key0, &$nts0)
|
||||||
{
|
{
|
||||||
$lngfound = false; // true when wet met a first synonym in the current language
|
$lngfound = false; // true when wet met a first synonym in the current language
|
||||||
$key0 = null; // key of the sy in the current language (or key of the first sy if we can't find good lng)
|
$key0 = null; // key of the sy in the current language (or key of the first sy if we can't find good lng)
|
||||||
@@ -1639,4 +1822,9 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function call($method)
|
||||||
|
{
|
||||||
|
return sprintf('%s::%s', __CLASS__, $method);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user