aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/cgi_sql_common.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v4/cgi_sql_common.rb')
-rw-r--r--lib/sisu/v4/cgi_sql_common.rb24
1 files changed, 11 insertions, 13 deletions
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
<body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en">
<table summary="band" border="0" cellpadding="3" cellspacing="0">
<tr><td align="left" bgcolor="#ffffff"><a href="http://www.jus.uio.no/sisu/" target="_top"><img border="0" src="#{@image_src}/sisu.png" alt="SiSU --&gt;" /></a></td><td>
-<!-- <p class="tiny"><a href="http://www.jus.uio.no/sisu/SiSU/">&nbsp;http://www.jus.uio.no/sisu/SiSU/</a></p> -->
- <label for="find"><b>#{@env.sample_search_form_title}</b></label>
+ <label for="find"><b>#{@env.sample_search_form_title(@opt.dir_structure_by)}</b></label>
</td></tr>
</table>
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/) \
? %{<a href="#{@canned_base_url}&fns=#{c['src_filename']}&lang=#{c['language_document_char']}&view=text"><img border="0" width="24" height="16" src="#{@image_src}/b_search.png" alt="search"></a>&nbsp;}
: %{<a href="#{@canned_base_url}&fns=#{c['src_filename']}&lang=#{c['language_document_char']}&view=index"><img border="0" width="24" height="16" src="#{@image_src}/b_search.png" alt="search"></a>&nbsp;}
- title=%{<span style="background-color: #{@color_heading}"><a href="#{path_toc(location,c['language_document_char'])}"><img border="0" width="15" height="18" src="#{@image_src}/b_toc.png" alt="toc html">&nbsp;#{ti}</a></span> [#{c['language_document_char']}] by #{c['creator_author']} #{can_txt_srch}<a href="#{path_toc(location,c['language_document_char'])}"><img border="0" width="15" height="18" src="#{@image_src}/b_toc.png" alt="toc html"></a>&nbsp;<a href="#{path_manifest(location,c['language_document_char'])}"><img border="0" width="15" height="15" src="#{@image_src}/b_info.png" alt="manifest"></a><br />} if file_suffix=~/s/ #hmm watch file_suffix
+ title=%{<span style="background-color: #{@color_heading}"><a href="#{path_toc(location,c['language_document_char'])}"><img border="0" width="15" height="18" src="#{@image_src}/b_toc.png" alt="toc html">&nbsp;#{ti}</a></span> [#{c['language_document_char']}] by #{c['creator_author']} <a href="#{path_manifest(location,c['language_document_char'])}"><img border="0" width="15" height="15" src="#{@image_src}/b_info.png" alt="manifest"></a> #{can_txt_srch}<br />} if file_suffix=~/s/ #hmm watch file_suffix
title=@text_search_flag \
? '<br /><hr>'+title
: '<br />'+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(/(<a\s+href="https?:\/\/[^><\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{<span style="background-color: #{@color_match}">\\1</span>}))
: c['body']
- %{<hr><p><font size="2">ocn <b><a href="#{path_filename(location,c['seg'],@ln)}##{c['ocn']}">#{c['ocn']}</a></b>:</font></p>#{matched_para}}
+ %{<hr><p><font size="2">ocn <b><a href="#{path_filename(location,c['seg'],c['language_document_char'])}##{c['ocn']}">#{c['ocn']}</a></b>:</font></p>#{matched_para}}
elsif c['suffix'] =~/1/ #doc
%{#{title}<hr><p><font size="2">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=%{<a href="#{path_filename(location,c['seg'],@ln)}##{c['ocn']}">#{c['ocn']}</a>, } if @text_search_flag
+ index=%{<a href="#{path_filename(location,c['seg'],c['language_document_char'])}##{c['ocn']}">#{c['ocn']}</a>, } if @text_search_flag
elsif c['suffix'] =~/1/ #doc #FIX
- index=%{<a href="#{path_html_doc(location,@ln)}##{c['ocn']}">#{c['ocn']}</a>, }
+ index=%{<a href="#{path_html_doc(location,c['language_document_char'])}##{c['ocn']}">#{c['ocn']}</a>, }
end
if c['seg'] =~/\S+/
if @text_search_flag
@@ -1015,7 +1013,7 @@ module SiSU_CGI_SQL
can_txt_srch=(cgi['view']=~/index/) \
? %{<a href="#{@canned_base_url}&fns=#{e['src_filename']}&lang=#{e['language_document_char']}&view=text"><img border="0" width="24" height="16" src="#{@image_src}/b_search.png" alt="search"></a>&nbsp;}
: %{<a href="#{@canned_base_url}&fns=#{e['src_filename']}&lang=#{e['language_document_char']}&view=index"><img border="0" width="24" height="16" src="#{@image_src}/b_search.png" alt="search"></a>&nbsp;}
- title=%{<br /><hr><span style="background-color: #{@color_heading}"><a href="#{path_toc(location,@ln)}"><img border="0" width="15" height="18" src="#{@image_src}/b_toc.png" alt="toc html">&nbsp;#{ti}</a></span> [#{e['language_document_char']}] by #{e['creator_author']} #{can_txt_srch}<a href="#{path_toc(location,@ln)}"><img border="0" width="15" height="18" src="#{@image_src}/b_toc.png" alt="toc html"></a>&nbsp;<a href="#{path_manifest(location,@ln)}"><img border="0" width="15" height="15" src="#{@image_src}/b_info.png" alt="manifest"></a><br />} if file_suffix=~/s/
+ title=%{<br /><hr><span style="background-color: #{@color_heading}"><a href="#{path_toc(location,e['language_document_char'])}"><img border="0" width="15" height="18" src="#{@image_src}/b_toc.png" alt="toc html">&nbsp;#{ti}</a></span> [#{e['language_document_char']}] by #{e['creator_author']} #{can_txt_srch}<a href="#{path_toc(location,e['language_document_char'])}"><img border="0" width="15" height="18" src="#{@image_src}/b_toc.png" alt="toc html"></a>&nbsp;<a href="#{path_manifest(location,e['language_document_char'])}"><img border="0" width="15" height="15" src="#{@image_src}/b_info.png" alt="manifest"></a><br />} 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(/(<a\s+href="https?:\/\/[^><\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{<span style="background-color: #{@color_match}">\\1</span>}))
: e['body']
- output=%{#{title}<hr><font size="2">note <b><a href="#{path_endnotes(location,@ln)}#_#{e['nr']}">#{e['nr']}</a></b> referred to from ocn <a href="#{path_html_doc(location,@ln)}##{e['ocn']}">#{e['ocn']}</a>:</font> #{matched_endnote}}
+ output=%{#{title}<hr><font size="2">note <b><a href="#{path_endnotes(location,e['language_document_char'])}#_#{e['nr']}">#{e['nr']}</a></b> referred to from ocn <a href="#{path_html_doc(location,e['language_document_char'])}##{e['ocn']}">#{e['ocn']}</a>:</font> #{matched_endnote}}
else #elsif cgi['view']=~/index/ #doc #FIX #% idx endnotes
@counter_endn_ocn+=1
- output=%{#{title}<a href="#{path_endnotes(location,@ln)}#_#{e['nr']}">#{e['nr']}</a> [&sect; <a href="#{path_html_doc(location,@ln)}##{e['ocn']}">#{e['ocn']}</a>], }
+ output=%{#{title}<a href="#{path_endnotes(location,e['language_document_char'])}#_#{e['nr']}">#{e['nr']}</a> [&sect; <a href="#{path_html_doc(location,e['language_document_char'])}##{e['ocn']}">#{e['ocn']}</a>], }
end
@counters_endn=if @counter_endn_doc > 0
if checked_stats =~/\S/