Skip to content

Commit

Permalink
bugfixes for search
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed May 30, 2016
1 parent 44dd504 commit a92d149
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controller.xql
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ else if ($exist:resource = 'correspDesc.xml') then
(: Suche :)
else if (matches($exist:path, concat('^/', $lang, '/', lang:get-language-string('search', $lang), '/?$'))) then
(: Shortcut for IDs, given as query string :)
if(config:get-doctype-by-id(str:sanitize(string-join(request:get-parameter('q', ''), ' '))) = $search:wega-docTypes) then controller:dispatch(map:put($exist-vars, 'resource', str:sanitize(string-join(request:get-parameter('q', ''), ' '))))
if(config:get-combined-doctype-by-id(str:sanitize(string-join(request:get-parameter('q', ''), ' '))) = $search:wega-docTypes) then controller:dispatch(map:put($exist-vars, 'resource', str:sanitize(string-join(request:get-parameter('q', ''), ' '))))
else controller:forward-html('/templates/search.html', $exist-vars)

(: Register :)
Expand Down
7 changes: 7 additions & 0 deletions modules/config.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ declare function config:get-doctype-by-id($id as xs:string?) as xs:string? {
else ()
};

declare function config:get-combined-doctype-by-id($id as xs:string?) as xs:string* {
for $func in wdt:functions-available()
return
if($func($id)('check')()) then $func($id)('name')
else ()
};

(:~
: Checks whether a given id matches the WeGA pattern of person ids
:
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h3 class="unterschriftweber">
<div class="input-group-btn dropdown">
<select class="input-group-addon gradient-light bootstrap-select form-control" name="d">
<option value="all" data-template="lang:translate">all</option>
<option value="persons" data-template="lang:translate">persons</option>
<option value="personsPlus" data-template="lang:translate">personsPlus</option>
<option value="letters" data-template="lang:translate">correspondence</option>
<option value="diaries" data-template="lang:translate">diaries</option>
<option value="writings" data-template="lang:translate">writings</option>
Expand Down

0 comments on commit a92d149

Please sign in to comment.