From 4b26d5daffa0ce38c92c7328991332c4f97f27d1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 14 Jul 2007 01:46:03 +0100 Subject: sample search form, previous next arrows --- lib/sisu/v0/cgi_sql_common.rb | 60 +++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 19 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/cgi_sql_common.rb b/lib/sisu/v0/cgi_sql_common.rb index 6239b6bf..9f89913e 100644 --- a/lib/sisu/v0/cgi_sql_common.rb +++ b/lib/sisu/v0/cgi_sql_common.rb @@ -451,31 +451,53 @@ module SiSU_CGI_sql end self end - def sql_canned_search_url(ok) - if ok - can=sql_canned_search - page=(sql_offset.to_i + sql_limit.to_i)/sql_limit.to_i - case page.to_s - when /^1$/ - %{

- pg. #{page.to_s} -   > -
} - when /^2$/ + def sql_canned_search_url(ok,img) + @image_src=img + can=sql_canned_search + page=(sql_offset.to_i + sql_limit.to_i)/sql_limit.to_i + case page.to_s + when /^1$/ + %{

+ pg. #{page.to_s} + +  >> + +
} + when /^2$/ + %{

+ + <<  + + pg. #{page.to_s} + +  >> + +
} + else + if ok %{

- <   + + |<  + + + <<  + pg. #{page.to_s} -   > + +  >> +
} else %{

- |<   - <   + + |<  + + + <<  + pg. #{page.to_s} -   >
} end - else '' end end WOK_SQL @@ -910,9 +932,9 @@ module SiSU_CGI_sql limit=dbi_statement.sql_limit.to_s @@lt_t ||=false; @@lt_e ||=false canned=if (@@lt_t or @@lt_e) - dbi_statement.sql_canned_search_url(true).to_s + dbi_statement.sql_canned_search_url(true,@image_src).to_s else - dbi_statement.sql_canned_search_url(false).to_s + dbi_statement.sql_canned_search_url(false,@image_src).to_s end limit=dbi_statement.sql_limit.to_s cgi.out{@header + @counters_txt + @counters_endn + @body_main.join + @endnotes.join + canned + @tail} #% print cgi_output_header+counters+body+endnotes -- cgit v1.2.3