diff options
author | Ralph Amissah <ralph@amissah.com> | 2010-10-09 22:54:08 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2010-10-09 22:54:19 -0400 |
commit | fb20770a4b7f21e6f8b2ef975b0a77eab637ff50 (patch) | |
tree | bf4562288a1a9c85ea9a7f7271fe4c6db77cab00 | |
parent | odt fix cornercase breakage matching and representing " ", "&" and urls (diff) |
param, metadata rights, keep colon separator from interfering with urls
(+changelog)
-rw-r--r-- | CHANGELOG_v2 | 2 | ||||
-rw-r--r-- | data/doc/sisu/v2/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/sisu/v2/param.rb | 44 |
3 files changed, 36 insertions, 12 deletions
diff --git a/CHANGELOG_v2 b/CHANGELOG_v2 index d27ff32d..fbe60bf4 100644 --- a/CHANGELOG_v2 +++ b/CHANGELOG_v2 @@ -27,6 +27,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.5.orig.tar.gz * shared_metadata, fix cornercase odt document breakage when matching and representing " ", "&" and urls in metadata + * param, metadata rights, keep colon separator from interfering with urls + %% 2.7.4.orig.tar.gz (2010-10-08:40/5) http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.4.orig.tar.gz 3d36b407f7f2df7b260f0a7932adf520a0539f8578dac59c6ca6de3bbfd03e62 2743433 sisu_2.7.4.orig.tar.gz diff --git a/data/doc/sisu/v2/CHANGELOG b/data/doc/sisu/v2/CHANGELOG index 6f8b3edf..da409f26 100644 --- a/data/doc/sisu/v2/CHANGELOG +++ b/data/doc/sisu/v2/CHANGELOG @@ -27,6 +27,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.5.orig.tar.gz * shared_metadata, fix cornercase odt document breakage when matching and representing " ", "&" and urls in metadata + * param, metadata rights, keep colon separator from interfering with urls + %% 2.7.4.orig.tar.gz (2010-10-08:40/5) http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.4.orig.tar.gz 3d36b407f7f2df7b260f0a7932adf520a0539f8578dac59c6ca6de3bbfd03e62 2743433 sisu_2.7.4.orig.tar.gz 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? |