diff options
Diffstat (limited to 'lib/sisu/v0/html_promo.rb')
-rw-r--r-- | lib/sisu/v0/html_promo.rb | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/lib/sisu/v0/html_promo.rb b/lib/sisu/v0/html_promo.rb index 1fc8fb4d..1f31b3b9 100644 --- a/lib/sisu/v0/html_promo.rb +++ b/lib/sisu/v0/html_promo.rb @@ -146,23 +146,27 @@ module SiSU_HTML_promo def search_form_sisu(table=true) db=if @prod['db']=~/\S+/ @prod['db']=~/^SiSU_\S+/ ? @prod['db'] : "SiSU_#{@prod['db']}" - elsif defined? @rc['search']['sisu']['db'] and @rc['search']['sisu']['db'] =~/\S+/ + elsif defined? @rc['search']['sisu']['db'] \ + and @rc['search']['sisu']['db'] =~/\S+/ @rc['search']['sisu']['db']=~/^SiSU_\S+/ ? @prod['search']['sisu']['db'] : "SiSU_#{@prod['db']}" else nil end action=if @prod['action']=~/^http:\/\// @prod['action'] - elsif defined? @rc['search']['sisu']['action'] and @rc['search']['sisu']['action'] =~/^http:\/\// + elsif defined? @rc['search']['sisu']['action'] \ + and @rc['search']['sisu']['action'] =~/^http:\/\// @rc['search']['sisu']['action'] else nil end - form=if action and db + form=if action \ + and db '<br />' + @env.widget.search_form('sisusearch',action,db,table) else '' end end def search_form_hyperestraier(table=true) - action=if defined? @rc['search']['hyperestraier']['action'] and @rc['search']['hyperestraier']['action'] =~/^http:\/\// + action=if defined? @rc['search']['hyperestraier']['action'] \ + and @rc['search']['hyperestraier']['action'] =~/^http:\/\// @rc['search']['hyperestraier']['action'] else nil end @@ -176,7 +180,9 @@ module SiSU_HTML_promo if @prod['links'] #and @prod['links'] == Array links_a=[] @prod['links'].each do |x| - if x and x['url'] and x['title'] + if x \ + and x['url'] \ + and x['title'] subtitle=x['subtitle'] ? %{ - #{x['subtitle']}} : '' url_=x['url'] =~/http:/ ? x['url'] : "../#{x['url']}" #url_=x['url'] =~/http:/ ? x['url'] : "#{@env.url.root}/#{x['url']}" @@ -214,19 +220,22 @@ module SiSU_HTML_promo end def price def gbp - if defined? @prod['price']['gbp'] and @prod['price']['gbp'] + if defined? @prod['price']['gbp'] \ + and @prod['price']['gbp'] " £ #{@prod['price']['gbp']} (GBP) " else '' end end def euro - if defined? @prod['price']['euro'] and @prod['price']['euro'] + if defined? @prod['price']['euro'] \ + and @prod['price']['euro'] " € #{@prod['price']['euro']} (Euro) " else '' end end def usd - if defined? @prod['price']['usd'] and @prod['price']['usd'] + if defined? @prod['price']['usd'] \ + and @prod['price']['usd'] " $ #{@prod['price']['usd']} (USD) " else '' end @@ -365,13 +374,15 @@ WOK #end def advert_extract_subject(category) #extracts products from category/subject list adverts=[] - if defined? @ad[:promo_list][category] and @ad[:promo_list][category] + if defined? @ad[:promo_list][category] \ + and @ad[:promo_list][category] @ad[:promo_list][category].keys.each do |type| @ad[:promo_list][category][type].each do |i| if i id=i.to_s =~/^\d/ ? "id_#{i.to_s.strip}" : i.to_s.strip gbp=usd=euro=nil - if defined? @ad[:promo][type][id] and not @ad[:promo][type][id].nil? + if defined? @ad[:promo][type][id] \ + and not @ad[:promo][type][id].nil? adverts << output_form_select(type,id) end end |