Skip to content
Snippets Groups Projects
Commit 73e01ab3 authored by chauveau's avatar chauveau
Browse files

correctifs chemins / i18n sous menus

parent 0c1c7563
No related branches found
Tags MaX-V0.3
No related merge requests found
......@@ -305,6 +305,7 @@ function max:getHTMLByID($project, $id, $xsl, $xslparams as xs:string *, $wrap a
declare
%rest:GET
%output:method("html")
%output:indent("no")
%rest:path("/editions/{$project}/doc/{$doc=.*\.xml|.*\.svg}")
function max:getFullDocument($project, $doc){
......
......@@ -98,8 +98,7 @@ function max.plugin.index:index($project){
else max.plugin.index:generateIndex($project)
};
declare %private
function max.plugin.index:generateIndex($project){
declare function max.plugin.index:generateIndex($project){
try{
let $indexFilePath :=file:parent(file:parent(file:parent(static-base-uri()))) || '/editions/'||$project||'/fragments/index.frag.html'
let $dbPath := max.config:getProjectDBPath($project)
......
......@@ -361,8 +361,8 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){
<div id="sub-navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">{
for $c in $parentEntry/subentry
let $target := $c/target/text()
let $label := max.i18n:getText($projectId, "menu." || $c/id/text())
let $target := $docMenu//entry[./id=$c/text()]/target/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>
}
</ul>
......@@ -381,18 +381,15 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){
(:gets a project static HTML fragment (wrapped in an html div):)
declare function max.html:getHTMLFragment($project, $fragmentName as xs:string)
as element(div){
let $fragmentPath := concat("../editions/",$project, "/fragments/", $fragmentName, ".frag.html")
let $fragmentPath := max.util:maxHome() ||"/editions/"||$project|| "/fragments/"||$fragmentName|| ".frag.html"
return <div id='content'>{doc($fragmentPath)}</div>
};
(:gets a project static HTML fragment (wrapped in an html div):)
declare function max.html:getHTMLFragmentFile($project, $fragmentFile as xs:string)
as element(){
let $fragmentPath := concat("../", $fragmentFile)
let $fragmentPath := max.util:maxHome() ||'/'|| $fragmentFile
return doc($fragmentPath)/*[1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment