Commit 73e01ab3 authored by chauveau's avatar chauveau
Browse files

correctifs chemins / i18n sous menus

parent 0c1c7563
...@@ -305,6 +305,7 @@ function max:getHTMLByID($project, $id, $xsl, $xslparams as xs:string *, $wrap a ...@@ -305,6 +305,7 @@ function max:getHTMLByID($project, $id, $xsl, $xslparams as xs:string *, $wrap a
declare declare
%rest:GET %rest:GET
%output:method("html") %output:method("html")
%output:indent("no")
%rest:path("/editions/{$project}/doc/{$doc=.*\.xml|.*\.svg}") %rest:path("/editions/{$project}/doc/{$doc=.*\.xml|.*\.svg}")
function max:getFullDocument($project, $doc){ function max:getFullDocument($project, $doc){
......
...@@ -98,8 +98,7 @@ function max.plugin.index:index($project){ ...@@ -98,8 +98,7 @@ function max.plugin.index:index($project){
else max.plugin.index:generateIndex($project) else max.plugin.index:generateIndex($project)
}; };
declare %private declare function max.plugin.index:generateIndex($project){
function max.plugin.index:generateIndex($project){
try{ try{
let $indexFilePath :=file:parent(file:parent(file:parent(static-base-uri()))) || '/editions/'||$project||'/fragments/index.frag.html' let $indexFilePath :=file:parent(file:parent(file:parent(static-base-uri()))) || '/editions/'||$project||'/fragments/index.frag.html'
let $dbPath := max.config:getProjectDBPath($project) let $dbPath := max.config:getProjectDBPath($project)
......
...@@ -361,8 +361,8 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){ ...@@ -361,8 +361,8 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){
<div id="sub-navbar" class="collapse navbar-collapse"> <div id="sub-navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">{ <ul class="nav navbar-nav">{
for $c in $parentEntry/subentry for $c in $parentEntry/subentry
let $target := $c/target/text() let $target := $docMenu//entry[./id=$c/text()]/target/text()
let $label := max.i18n:getText($projectId, "menu." || $c/id/text()) let $label := max.i18n:getText($projectId, "menu." || $docMenu//entry[./id=$c/text()]/id/text())
return <li><a href="{$target}">{if(not($label='menu.')) then $label else $c/text()}</a></li> return <li><a href="{$target}">{if(not($label='menu.')) then $label else $c/text()}</a></li>
} }
</ul> </ul>
...@@ -381,18 +381,15 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){ ...@@ -381,18 +381,15 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){
(:gets a project static HTML fragment (wrapped in an html div):) (:gets a project static HTML fragment (wrapped in an html div):)
declare function max.html:getHTMLFragment($project, $fragmentName as xs:string) declare function max.html:getHTMLFragment($project, $fragmentName as xs:string)
as element(div){ as element(div){
let $fragmentPath := max.util:maxHome() ||"/editions/"||$project|| "/fragments/"||$fragmentName|| ".frag.html"
let $fragmentPath := concat("../editions/",$project, "/fragments/", $fragmentName, ".frag.html") return <div id='content'>{doc($fragmentPath)}</div>
return <div id='content'>{doc($fragmentPath)}</div>
}; };
(:gets a project static HTML fragment (wrapped in an html div):) (:gets a project static HTML fragment (wrapped in an html div):)
declare function max.html:getHTMLFragmentFile($project, $fragmentFile as xs:string) declare function max.html:getHTMLFragmentFile($project, $fragmentFile as xs:string)
as element(){ as element(){
let $fragmentPath := concat("../", $fragmentFile) let $fragmentPath := max.util:maxHome() ||'/'|| $fragmentFile
return doc($fragmentPath)/*[1] return doc($fragmentPath)/*[1]
......
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