Skip to content

Commit

Permalink
sort out editionURI first
Browse files Browse the repository at this point in the history
and then get "additional_css_path" from preferences
  • Loading branch information
peterstadler authored and daniel-jettka committed Dec 11, 2024
1 parent 97bc2f5 commit 1e5b690
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions add/index.xql
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ xquery version "3.1";
(: IMPORTS ================================================================= :)

import module namespace edition = "http://www.edirom.de/xquery/edition" at "data/xqm/edition.xqm";
import module namespace eutil = "http://www.edirom.de/xquery/eutil" at "data/xqm/eutil.xqm";

(: NAMESPACE DECLARATIONS ================================================== :)

Expand All @@ -20,8 +21,8 @@ declare option output:omit-xml-declaration "yes";
(: VARIABLE DECLARATIONS =================================================== :)

declare variable $edition := request:get-parameter("edition", "");
declare variable $editionUri := if($edition) then edition:findEdition($edition) else();
declare variable $preferences := if($editionUri) then(doc(edition:getPreferencesURI($editionUri))) else();
declare variable $editionUri := edition:findEdition($edition);
declare variable $additional_css_path := eutil:getPreference('additional_css_path', $editionUri);

let $eoEditionFiles := collection('/db/apps')//edirom:edition[@xml:id]
let $eoEditionFilesCount := count($eoEditionFiles)
Expand Down Expand Up @@ -77,9 +78,9 @@ let $eoIndexPage := <html>
()
else
(<!-- TODO if prefs css then include here -->,
if ($preferences//entry[@key = "additional_css_path" and @value != ''])
if ($additional_css_path)
then
<link rel="stylesheet" href="{string-join((request:get-context-path(), substring-after($preferences//entry[@key = 'additional_css_path']/@value, 'xmldb:exist:///db/')), '/')}"/>
<link rel="stylesheet" href="{string-join((request:get-context-path(), substring-after($additional_css_path, 'xmldb:exist:///db/')), '/')}"/>
else (),
<script type="text/javascript" src="app.js"/>,
<!-- **WHERE TO OPEN LINKS** -->,
Expand Down

0 comments on commit 1e5b690

Please sign in to comment.