aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2009-08-31 23:32:34 -0400
committerRalph Amissah <ralph@amissah.com>2009-08-31 23:32:34 -0400
commit0f69b7cdc97385972c13560c03bbb0ecaf147457 (patch)
tree1da9c8dbf65377a68a5383920b383531dacb019a /lib
parentsha256 for 0.71.4 (diff)
cgi search, cosmetic
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v1/cgi_sql_common.rb13
-rw-r--r--lib/sisu/v1/sysenv.rb22
2 files changed, 16 insertions, 19 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
diff --git a/lib/sisu/v1/sysenv.rb b/lib/sisu/v1/sysenv.rb
index 8b15f957..945cf07c 100644
--- a/lib/sisu/v1/sysenv.rb
+++ b/lib/sisu/v1/sysenv.rb
@@ -1040,10 +1040,9 @@ module SiSU_Env
<input type="hidden" name="db" value="#{db}" />
<input type="hidden" name="ltd" value="1000" />
<input type="hidden" name="off" value="0" />
-<input type="radio" name="view" value="index" checked="checked" /> idx
-<input type="radio" name="view" value="text" /> txt
-<input type="submit" name="ignore" value="search" />
-<input type="checkbox" name="fns" value="#{@md.fnb}" />
+<input type="hidden" name="doc" value="#{@md.fnb}" />
+<input type="submit" name="search" value="search doc" />
+<input type="submit" name="search" value="search db" />
</font></form>
#{table_close}
<!-- SiSU Search -->
@@ -1102,10 +1101,9 @@ WOK
<input type="hidden" name="db" value="#{db}" />
<input type="hidden" name="ltd" value="1000" />
<input type="hidden" name="off" value="0" />
-<input type="radio" name="view" value="index" checked="checked" /> idx
-<input type="radio" name="view" value="text" /> txt
-<input type="submit" name="ignore" value="search" />
-<input type="checkbox" name="fns" value="#{@md.fnb}" />
+<input type="hidden" name="doc" value="#{@md.fnb}" />
+<input type="submit" name="search" value="search doc" />
+<input type="submit" name="search" value="search db" />
</font>
</form>
<!-- SiSU Search -->
@@ -1198,9 +1196,9 @@ WOK
<br />
<input type="hidden" name="db" value="#{db}" />
<input type="hidden" name="fns" value="#@fnb" />
-<input type="radio" name="view" value="index" /> idx
-<input type="radio" name="view" value="text" checked="checked" /> txt
-<input type="submit" name="ignore" value="search" />
+<input type="hidden" name="doc" value="#{@fnb}" />
+<input type="submit" name="search" value="search doc" />
+<input type="submit" name="search" value="search db" />
</font>
</form>
<!-- SiSU Search --> }
@@ -1212,8 +1210,6 @@ WOK
<input type="text" name="s1" size="24" maxlength="255" />
<br />
<input type="hidden" name="db" value="#{db}" />
-<input type="radio" name="view" value="index" checked="checked" /> idx
-<input type="radio" name="view" value="text" /> txt
<input type="submit" />
</font>
</form>