From 7bc559f85cb0b6c6f4cdfe127a386573b4c5d8ce Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 5 Sep 2011 10:36:28 -0400 Subject: v3: unix conditional tests (? :) remove line break markers before : cosmetic --- lib/sisu/v3/cgi_sql_common.rb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'lib/sisu/v3/cgi_sql_common.rb') diff --git a/lib/sisu/v3/cgi_sql_common.rb b/lib/sisu/v3/cgi_sql_common.rb index 5a2b9fde..c377e002 100644 --- a/lib/sisu/v3/cgi_sql_common.rb +++ b/lib/sisu/v3/cgi_sql_common.rb @@ -471,7 +471,7 @@ module SiSU_CGI_sql end def previous @offset_previous >= 0 \ - ? (@@canned_search_url.to_s + '<d=' + sql_match_limit.to_s + '&off=' + @offset_previous.to_s) \ + ? (@@canned_search_url.to_s + '<d=' + sql_match_limit.to_s + '&off=' + @offset_previous.to_s) : '' end def start @@ -664,7 +664,7 @@ module SiSU_CGI_sql 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/) \ - ? result_type={ :index => '', :text => 'checked'} \ + ? result_type={ :index => '', :text => 'checked'} : result_type={ :index => 'checked', :text => ''} @@limit=if cgi['sql_match_limit'].to_s=~/2500/ checked_sql_limit={ :l1000 => '', :l2500 => 'checked'} @@ -735,7 +735,7 @@ module SiSU_CGI_sql dtv='&dtv=' + CGI.escape(@search_for.date_valid) if @search_for.date_valid=~/\S/ fns='&fns=' + CGI.escape(@search_for.filename) if @search_for.filename=~/\S/ @@canned_search_url=(checked_all =~/checked/) \ - ? "#{@base}?#{s1}#{ft}#{key}#{ti}#{au}#{tr}#{sj}#{dsc}#{pb}#{edt}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1" \ + ? "#{@base}?#{s1}#{ft}#{key}#{ti}#{au}#{tr}#{sj}#{dsc}#{pb}#{edt}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1" : "#{@base}?#{s1}#{ft}#{key}#{ti}#{au}#{tr}#{sj}#{dsc}#{pb}#{edt}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}" mod=ft=~/\S+/ ? (ft.gsub(/ft/,'s1')) : s1 @canned_base_url="#{@base}?#{mod}&db=#{cgi['db']}" @@ -809,7 +809,7 @@ module SiSU_CGI_sql puts (@header+@tail) else #% searches s1=(@search_for.text1 =~/\S/) \ - ? @search_for.text1 \ + ? @search_for.text1 : 'Unavailable' if checked_case=~/\S/ @search[:text]<<%{doc_objects.clean~'#{CGI.unescape(s1)}'} @@ -924,11 +924,11 @@ module SiSU_CGI_sql if c['tid'].to_i != oldtid.to_i ti=c['title'] can_txt_srch=(cgi['view']=~/index/) \ - ? %{search } \ + ? %{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=@text_search_flag \ - ? '

'+title \ + ? '

'+title : '
'+title @counter_txt_doc+=1 oldtid=c['tid'].to_i @@ -950,7 +950,7 @@ module SiSU_CGI_sql search_regex=[] build=unescaped_search.scan(/\S+/).each do |g| (g.to_s =~/(AND|OR)/) \ - ? (search_regex << '|') \ + ? (search_regex << '|') : (search_regex << %{#{g.to_s}}) end search_regex=search_regex.join(' ') @@ -961,7 +961,7 @@ module SiSU_CGI_sql else nil end 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'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{\\1})) : c['body'] %{

ocn #{c['ocn']}:

#{matched_para}} elsif c['suffix'] =~/1/ #doc @@ -983,7 +983,7 @@ module SiSU_CGI_sql else @counter_txt_ocn+=1 output=c['suffix'] !~/1/ \ - ? title+index \ + ? title+index : %{#{title}#{c['ocn'].sort}, } end end @@ -1017,7 +1017,7 @@ module SiSU_CGI_sql if e['metadata_tid'].to_i != oldtid.to_i ti=e['title'] can_txt_srch=(cgi['view']=~/index/) \ - ? %{search } \ + ? %{search } : %{search } 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 @@ -1028,7 +1028,7 @@ module SiSU_CGI_sql or (cgi['view']!~/index/ and cgi['search'] !~/search db/) #% txt endnotes @counter_endn_ocn+=1 matched_endnote=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) \ - ? matched=e['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{\\1}) \ + ? 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}} else #elsif cgi['view']=~/index/ #doc #FIX #% idx endnotes @@ -1038,7 +1038,7 @@ module SiSU_CGI_sql @counters_endn=if @counter_endn_doc > 0 if checked_stats =~/\S/ @@lt_e=@counter_endn_ocn==dbi_statement.sql_match_limit.to_i \ - ? true \ + ? true : false start=(@@offset.to_i+1).to_s range=(@@offset.to_i+@counter_endn_ocn.to_i).to_s @@ -1054,7 +1054,7 @@ module SiSU_CGI_sql limit=dbi_statement.sql_match_limit.to_s @@lt_t ||=false; @@lt_e ||=false canned=(@@lt_t or @@lt_e) \ - ? dbi_statement.pre_next(true,@image_src).to_s \ + ? dbi_statement.pre_next(true,@image_src).to_s : dbi_statement.pre_next(false,@image_src).to_s limit=dbi_statement.sql_match_limit.to_s cgi.out{@header.force_encoding("UTF-8") + @counters_txt.force_encoding("UTF-8") + @counters_endn.force_encoding("UTF-8") + canned.force_encoding("UTF-8") + @body_main.force_encoding("UTF-8") + @endnotes.force_encoding("UTF-8") + canned.force_encoding("UTF-8") + @tail.force_encoding("UTF-8")} #% print cgi_output_header+counters+body+endnotes -- cgit v1.2.3