aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v1/cgi_sql_common.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v1/cgi_sql_common.rb')
-rw-r--r--lib/sisu/v1/cgi_sql_common.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/sisu/v1/cgi_sql_common.rb b/lib/sisu/v1/cgi_sql_common.rb
index fea17a7a..bd0b38a5 100644
--- a/lib/sisu/v1/cgi_sql_common.rb
+++ b/lib/sisu/v1/cgi_sql_common.rb
@@ -123,8 +123,6 @@ module SiSU_CGI_sql
* Ralph Amissah
<ralph@amissah.com>
<ralph.amissah@gmail.com>
-
- ** Description: html generation, processing
WOK_SQL
end
def header1
@@ -288,6 +286,7 @@ module SiSU_CGI_sql
@date_available=q['dta'] if q['dta']=~/\S/
@date_valid=q['dtv'] if q['dtv']=~/\S/
@filename=q['fns'] if q['fns']=~/\S/
+ @filename=q['doc'] if q['search'] !~/search db/
@@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000
@@offset=q['off'] if q['off']=~/\d+/ # 0
end
@@ -818,7 +817,8 @@ module SiSU_CGI_sql
else title=''
end
if @text_search_flag
- if cgi['view']=~/text/ #% txt body
+ if cgi['view']=~/text/ \
+ or (cgi['view']!~/index/ and cgi['search'] !~/search db/) #% txt body
text=if c['suffix'] !~/1/ #seg
if @search_for.text1 =~/\S+/ \
or q['s1'] =~/\S+/ #% only this branch is working !!
@@ -855,7 +855,7 @@ module SiSU_CGI_sql
output=if c['seg'] =~/\S+/; title+text
else text
end
- elsif cgi['view']=~/index/ #% idx body
+ else #elsif cgi['view']=~/index/ #% idx body
if c['suffix'] !~/1/ #seg
index=%{<a href="#@hosturl_files/#@stub/#{location}/#{c['seg']}#{lang}.html##{c['ocn']}">#{c['ocn']}</a>, } if @text_search_flag
elsif c['suffix'] =~/1/ #doc
@@ -916,14 +916,15 @@ module SiSU_CGI_sql
oldtid=e['metadata_tid'].to_i
else title = ''
end
- if cgi['view']=~/text/ #% txt endnotes
+ if cgi['view']=~/text/ \
+ or (cgi['view']!~/index/ and cgi['search'] !~/search db/) #% txt endnotes
@counter_endn_ocn+=1
matched_endnote=if (@search_regx.to_s.class==String && @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>})
else e['body']
end
output=%{#{title}<hr><font size="2">note <b><a href="#@hosturl_files/#@stub/#{location}/endnotes.html#_#{e['nr']}">#{e['nr']}</a></b> referred to from ocn <a href="#@hosturl_files/#@stub/#{location}/doc.html##{e['ocn']}">#{e['ocn']}</a>:</font> #{matched_endnote}}
- elsif cgi['view']=~/index/ #% idx endnotes
+ else #elsif cgi['view']=~/index/ #% idx endnotes
@counter_endn_ocn+=1
output=%{#{title}<a href="#@hosturl_files/#@stub/#{location}/endnotes.html#_#{e['nr']}">#{e['nr']}</a> [&sect; <a href="#@hosturl_files/#@stub/#{location}/doc.html##{e['ocn']}">#{e['ocn']}</a>], }
end