From fb20770a4b7f21e6f8b2ef975b0a77eab637ff50 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 9 Oct 2010 22:54:08 -0400 Subject: param, metadata rights, keep colon separator from interfering with urls (+changelog) --- lib/sisu/v2/param.rb | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) (limited to 'lib') 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 +='
translation ' + copyright.translation + ';' + and copyright.translation \ + and not copyright.translation.empty? + v=sep(copyright.translation) + s +='
translation ' + copyright.translation + v end if defined? copyright.illustrations \ - and copyright.illustrations - s +='
illustrations ' + copyright.illustrations + ';' + and copyright.illustrations \ + and not copyright.illustrations.empty? + v=sep(copyright.illustrations) + s +='
illustrations ' + copyright.illustrations + v end if defined? copyright.photographs \ - and copyright.photographs - s +='
photographs ' + copyright.photographs + ';' + and copyright.photographs \ + and not copyright.photographs.empty? + v=sep(copyright.photographs) + s +='
photographs ' + copyright.photographs + v end if defined? copyright.digitization \ - and copyright.digitization - s +='
digitization ' + copyright.digitization + ';' + and copyright.digitization \ + and not copyright.digitization.empty? + v=sep(copyright.digitization) + s +='
digitization ' + copyright.digitization + v end if defined? copyright.audio \ - and copyright.audio - s +='
audio ' + copyright.audio + ';' + and copyright.audio \ + and not copyright.audio.empty? + v=sep(copyright.audio) + s +='
audio ' + copyright.audio + v end if defined? copyright.license \ - and copyright.license + and copyright.license \ + and not copyright.license.empty? s +='
License: ' + copyright.license end if s.empty? -- cgit v1.2.3