Commit 43c8379e authored by chauveau's avatar chauveau
Browse files

attr de debug pour le plugin search, i18n

parent 5a5de813
...@@ -42,6 +42,7 @@ function max:page($project, $page){ ...@@ -42,6 +42,7 @@ function max:page($project, $page){
return max.html:wrapInHTML($project, $page, $content) return max.html:wrapInHTML($project, $page, $content)
} }
catch err:FODC0002{ catch err:FODC0002{
admin:write-log('Page/fragment "'||$page ||'" introuvable ou mal formé', 'INFO'),
let $content := max.route:HTMLRouteList($project) let $content := max.route:HTMLRouteList($project)
return max.html:wrapInHTML($project, $page, $content) return max.html:wrapInHTML($project, $page, $content)
} }
......
...@@ -59,6 +59,7 @@ function max.plugin.search:search($project, $search as xs:string, $docs as item( ...@@ -59,6 +59,7 @@ function max.plugin.search:search($project, $search as xs:string, $docs as item(
let $dbPath := max.config:getProjectDBPath($project) let $dbPath := max.config:getProjectDBPath($project)
let $plugin := max.config:getPluginByName($project, $max.plugin.search:PLUGIN_ID) let $plugin := max.config:getPluginByName($project, $max.plugin.search:PLUGIN_ID)
let $tag := string($plugin//parameter[@key=$max.plugin.search:TAG_PARAMETER]/@value) let $tag := string($plugin//parameter[@key=$max.plugin.search:TAG_PARAMETER]/@value)
let $debug := string($plugin/@debug)
let $b2t_xpath := string($plugin//parameter[@key=$max.plugin.search:BACK_TO_TEXT_ID_PARAMETER]/@value) let $b2t_xpath := string($plugin//parameter[@key=$max.plugin.search:BACK_TO_TEXT_ID_PARAMETER]/@value)
let $docTargets := if($docs = $max.plugin.search:ALL_TXT) let $docTargets := if($docs = $max.plugin.search:ALL_TXT)
then for $a in max.route:HTMLRouteList($project)//a/@href then for $a in max.route:HTMLRouteList($project)//a/@href
...@@ -71,6 +72,13 @@ function max.plugin.search:search($project, $search as xs:string, $docs as item( ...@@ -71,6 +72,13 @@ function max.plugin.search:search($project, $search as xs:string, $docs as item(
else $docs else $docs
return return
<div id='hits'> <div id='hits'>
{
if($debug='true')
then <div class='debug'>
for $hit in ft:mark(doc({$dbPath}/$doc)//*[local-name(.)={$tag} and .//text() contains text {$search}])
</div>
else ()
}
{ {
for $doc in $docTargets for $doc in $docTargets
return return
......
...@@ -46,6 +46,7 @@ declare function max.route:HTMLRouteList($project){ ...@@ -46,6 +46,7 @@ declare function max.route:HTMLRouteList($project){
'baseURI': max.config:getReversedProxyBaseURI(), 'baseURI': max.config:getReversedProxyBaseURI(),
'dbPath':max.config:getProjectDBPath($project) 'dbPath':max.config:getProjectDBPath($project)
}) })
(:route list collected from config file:) (:route list collected from config file:)
case $max.cons:CONFIG_LIST_ROUTE_TYPE case $max.cons:CONFIG_LIST_ROUTE_TYPE
return return
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<entry key="menu.contacts">Contacts</entry> <entry key="menu.contacts">Contacts</entry>
<entry key="menu.partenaires">Partenaires</entry> <entry key="menu.partenaires">Partenaires</entry>
<entry key="menu.recherche">Rechercher</entry> <entry key="menu.recherche">Rechercher</entry>
<entry key="menu.index">Index</entry>
<entry key="search.loading">Recherche en cours ...</entry> <entry key="search.loading">Recherche en cours ...</entry>
<entry key="search.results">résultat(s)</entry> <entry key="search.results">résultat(s)</entry>
......
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