diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v2/param.rb | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/lib/sisu/v2/param.rb b/lib/sisu/v2/param.rb index b44a5b8e..78cad7c6 100644 --- a/lib/sisu/v2/param.rb +++ b/lib/sisu/v2/param.rb @@ -427,32 +427,52 @@ module SiSU_Param l,n=Db[:col_info_note],'rights.license' validate_length(s,l,n) end + def sep(str) + (str =~/https?:\/\/\S+$/) ? ' ;' : ';' + end def all s=if @h['all']; @h['all'] else - s=copyright.text + ';' + s='' + if defined? copyright.text \ + and copyright.text \ + and not copyright.text.empty? + v=sep(copyright.text) + s +=copyright.text + v + end if defined? copyright.translation \ - and copyright.translation - s +='<br> translation ' + copyright.translation + ';' + and copyright.translation \ + and not copyright.translation.empty? + v=sep(copyright.translation) + s +='<br> translation ' + copyright.translation + v end if defined? copyright.illustrations \ - and copyright.illustrations - s +='<br> illustrations ' + copyright.illustrations + ';' + and copyright.illustrations \ + and not copyright.illustrations.empty? + v=sep(copyright.illustrations) + s +='<br> illustrations ' + copyright.illustrations + v end if defined? copyright.photographs \ - and copyright.photographs - s +='<br> photographs ' + copyright.photographs + ';' + and copyright.photographs \ + and not copyright.photographs.empty? + v=sep(copyright.photographs) + s +='<br> photographs ' + copyright.photographs + v end if defined? copyright.digitization \ - and copyright.digitization - s +='<br> digitization ' + copyright.digitization + ';' + and copyright.digitization \ + and not copyright.digitization.empty? + v=sep(copyright.digitization) + s +='<br> digitization ' + copyright.digitization + v end if defined? copyright.audio \ - and copyright.audio - s +='<br> audio ' + copyright.audio + ';' + and copyright.audio \ + and not copyright.audio.empty? + v=sep(copyright.audio) + s +='<br> audio ' + copyright.audio + v end if defined? copyright.license \ - and copyright.license + and copyright.license \ + and not copyright.license.empty? s +='<br> License: ' + copyright.license end if s.empty? |