From 91f5be6f02bb6c3cd0ba26ff62acb603a33e741f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 22 Aug 2007 23:56:23 +0100 Subject: version bump to 0.57, minor addition to markup (a header to heading shortcut) and sisurc.yml update for additional search form option (hyperestraier) * markup addition, headings, shortcut for top level title (and author) :A~ @title @author (also available for level 2 (or 3) author) [version bump] * param markup identifier (and identifier) updated to identify markup addition in 0.57, :A~ @title * html search form in navigation band/banner and promo, adjustments, hyperestraier option offered in promo, requires change in sisurc.yml * sisurc.yml requires changes to make use search form options, [version bump] sample updated and commented out --- lib/sisu/v0/html_promo.rb | 52 +++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 17 deletions(-) (limited to 'lib/sisu/v0/html_promo.rb') diff --git a/lib/sisu/v0/html_promo.rb b/lib/sisu/v0/html_promo.rb index cc60f4c9..c4e18184 100644 --- a/lib/sisu/v0/html_promo.rb +++ b/lib/sisu/v0/html_promo.rb @@ -143,25 +143,35 @@ module SiSU_HTML_promo def blurb @prod['blurb'] ? %{

#{@prod['blurb']}

} : '' end - def search_form + def search_form_sisu(table=true) db=if @prod['db']=~/\S+/ @prod['db']=~/^SiSU_\S+/ ? @prod['db'] : "SiSU_#{@prod['db']}" - elsif defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/ - @rc['search']['db']=~/^SiSU_\S+/ ? @prod['search']['db'] : "SiSU_#{@prod['db']}" + 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 - #target=@prod['target']=~/^\S+/ ? @prod['target'] : '_top' action=if @prod['action']=~/^http:\/\// @prod['action'] - elsif defined? @rc['search']['action'] and @rc['search']['action'] =~/^http:\/\// - @rc['search']['action'] + elsif defined? @rc['search']['sisu']['action'] and @rc['search']['sisu']['action'] =~/^http:\/\// + @rc['search']['sisu']['action'] else nil end form=if action and db - '
' + @env.widget.search_form(action,db) + '
' + @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:\/\// + @rc['search']['hyperestraier']['action'] + else nil + end + form=if action + '
' + @env.widget.search_form('hyperestraier',action,'',table) + else '' + end + form + end def links if @prod['links'] #and @prod['links'] == Array links_a=[] @@ -268,10 +278,15 @@ WOK #{cell.links} WOK end - def output_form_search(type,id) + def output_form_search_sisu(type,id) prod_id=id.gsub(/id_/,'') cell=cell(@ad[:promo][type][id],prod_id) - cell.search_form + cell.search_form_sisu(false) + end + def output_form_search_hyperestraier(type,id) + prod_id=id.gsub(/id_/,'') + cell=cell(@ad[:promo][type][id],prod_id) + cell.search_form_hyperestraier(false) end def output_form_book(type,id) prod_id=id.gsub(/id_/,'') @@ -329,7 +344,10 @@ WOK when /sponsor/ output_form_sponsor(type,id) when /search/ - output_form_search(type,id) + if id=~/hyperestraier/ + output_form_search_hyperestraier(type,id) + else output_form_search_sisu(type,id) + end when /book/ output_form_book(type,id) when /journal/ @@ -338,13 +356,13 @@ WOK output_form_conference(type,id) end end - def advert_extract_single(type,id) #extracts single item of type with id - #type === book,journal,conference,sponsor - id=id.to_s.gsub(/^(\d)/,'id_\1') - if defined? @ad[:promo][type][id] and @ad[:promo][type][id] - output_form_select(type,id) - end - end + #def advert_extract_single(type,id) #extracts single item of type with id + # #type === book,journal,conference,sponsor + # id=id.to_s.gsub(/^(\d)/,'id_\1') + # if defined? @ad[:promo][type][id] and @ad[:promo][type][id] + # output_form_select(type,id) + # end + #end def advert_extract_subject(category) #extracts products from category/subject list adverts=[] if defined? @ad[:promo_list][category] and @ad[:promo_list][category] -- cgit v1.2.3