Skip to content

Commit 1e5b690

Browse files
peterstadlerdaniel-jettka
authored andcommitted
sort out editionURI first
and then get "additional_css_path" from preferences
1 parent 97bc2f5 commit 1e5b690

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

add/index.xql

100755100644
+5-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ xquery version "3.1";
33
(: IMPORTS ================================================================= :)
44

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

78
(: NAMESPACE DECLARATIONS ================================================== :)
89

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

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

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

0 commit comments

Comments
 (0)