From 1a21bfdc762d2dfb0de56dba75fa46d8a31861af Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 29 Mar 2013 20:28:29 -0400 Subject: v4: cgi, auto-generated sample search form * for various sisu output directory structures * fixes --- lib/sisu/v4/cgi_sql_common.rb | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'lib/sisu/v4/cgi_sql_common.rb') diff --git a/lib/sisu/v4/cgi_sql_common.rb b/lib/sisu/v4/cgi_sql_common.rb index c3c07bdb..058d04ec 100644 --- a/lib/sisu/v4/cgi_sql_common.rb +++ b/lib/sisu/v4/cgi_sql_common.rb @@ -130,7 +130,7 @@ module SiSU_CGI_SQL <<-'WOK_SQL' #Common TOP @@offset=0 - @base="#{@hosturl_db}/cgi-bin/#{@version}.cgi" + @base="#{@hosturl_db}/#{@stub_default}.cgi" #fix sqlite @@canned_search_url=@base @color_heading='#DDFFAA' @color_match='#ffff48' @@ -167,8 +167,7 @@ module SiSU_CGI_SQL
SiSU --> - - +
WOK_SQL @@ -655,8 +654,8 @@ module SiSU_CGI_SQL @stub=/#{@db_name_prefix}(\S+)/.match(cgi['db'])[1] cgi['db'] else - @stub='sisu' - "#{@db_name_prefix}#{@stub}" + @stub=@stub_default + @db_name_prefix + @stub end checked_url,checked_stats,checked_searched,checked_tip,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,selected_db='','','','','','','','','' result_type=(cgi['view']=~/text/) \ @@ -834,7 +833,6 @@ module SiSU_CGI_SQL else end @hostpath="#{@hosturl_files}/#{@stub}" - @ln='en' WOK_SQL end def dir_structure @@ -922,7 +920,7 @@ module SiSU_CGI_SQL can_txt_srch=(cgi['view']=~/index/) \ ? %{search } : %{search } - title=%{toc html #{ti} [#{c['language_document_char']}] by #{c['creator_author']} #{can_txt_srch}toc html manifest
} if file_suffix=~/s/ #hmm watch file_suffix + title=%{toc html #{ti} [#{c['language_document_char']}] by #{c['creator_author']} manifest #{can_txt_srch}
} if file_suffix=~/s/ #hmm watch file_suffix title=@text_search_flag \ ? '

'+title : '
'+title @@ -959,7 +957,7 @@ module SiSU_CGI_SQL matched_para=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) \ ? (c['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{\\1})) : c['body'] - %{

ocn #{c['ocn']}:

#{matched_para}} + %{

ocn #{c['ocn']}:

#{matched_para}} elsif c['suffix'] =~/1/ #doc %{#{title}

ocn #{c['ocn']}:#{c['body']}} end @@ -967,9 +965,9 @@ module SiSU_CGI_SQL output=title+text else #elsif cgi['view']=~/index/ #% idx body if c['suffix'] !~/1/ #seg - index=%{#{c['ocn']}, } if @text_search_flag + index=%{#{c['ocn']}, } if @text_search_flag elsif c['suffix'] =~/1/ #doc #FIX - index=%{#{c['ocn']}, } + index=%{#{c['ocn']}, } end if c['seg'] =~/\S+/ if @text_search_flag @@ -1015,7 +1013,7 @@ module SiSU_CGI_SQL can_txt_srch=(cgi['view']=~/index/) \ ? %{search } : %{search } - title=%{


toc html #{ti} [#{e['language_document_char']}] by #{e['creator_author']} #{can_txt_srch}toc html manifest
} if file_suffix=~/s/ + title=%{

toc html #{ti} [#{e['language_document_char']}] by #{e['creator_author']} #{can_txt_srch}toc html manifest
} if file_suffix=~/s/ @counter_endn_doc+=1 oldtid=e['metadata_tid'].to_i else title = '' @@ -1027,10 +1025,10 @@ module SiSU_CGI_SQL && @search_regx.to_s=~/\S\S+/) \ ? (matched=e['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{\\1})) : e['body'] - output=%{#{title}
note #{e['nr']} referred to from ocn #{e['ocn']}: #{matched_endnote}} + output=%{#{title}
note #{e['nr']} referred to from ocn #{e['ocn']}: #{matched_endnote}} else #elsif cgi['view']=~/index/ #doc #FIX #% idx endnotes @counter_endn_ocn+=1 - output=%{#{title}#{e['nr']}#{e['ocn']}], } + output=%{#{title}#{e['nr']}#{e['ocn']}], } end @counters_endn=if @counter_endn_doc > 0 if checked_stats =~/\S/ -- cgit v1.2.3