Skip to content
Snippets Groups Projects
Commit 43c8379e authored by chauveau's avatar chauveau
Browse files

attr de debug pour le plugin search, i18n

parent 5a5de813
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,7 @@ function max:page($project, $page){
return max.html:wrapInHTML($project, $page, $content)
}
catch err:FODC0002{
admin:write-log('Page/fragment "'||$page ||'" introuvable ou mal formé', 'INFO'),
let $content := max.route:HTMLRouteList($project)
return max.html:wrapInHTML($project, $page, $content)
}
......
......@@ -59,6 +59,7 @@ function max.plugin.search:search($project, $search as xs:string, $docs as item(
let $dbPath := max.config:getProjectDBPath($project)
let $plugin := max.config:getPluginByName($project, $max.plugin.search:PLUGIN_ID)
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 $docTargets := if($docs = $max.plugin.search:ALL_TXT)
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(
else $docs
return
<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
return
......
......@@ -46,6 +46,7 @@ declare function max.route:HTMLRouteList($project){
'baseURI': max.config:getReversedProxyBaseURI(),
'dbPath':max.config:getProjectDBPath($project)
})
(:route list collected from config file:)
case $max.cons:CONFIG_LIST_ROUTE_TYPE
return
......
......@@ -8,6 +8,7 @@
<entry key="menu.contacts">Contacts</entry>
<entry key="menu.partenaires">Partenaires</entry>
<entry key="menu.recherche">Rechercher</entry>
<entry key="menu.index">Index</entry>
<entry key="search.loading">Recherche en cours ...</entry>
<entry key="search.results">résultat(s)</entry>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment