aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/cgi_sql_common.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-07-30 21:38:47 -0400
committerRalph Amissah <ralph@amissah.com>2013-07-30 21:39:02 -0400
commit9e8a84f55ed79c58b3309e7fef4ec7242fb4c5e2 (patch)
tree3305d6e1d1701e3f412fb48cd890816706876b31 /lib/sisu/v5/cgi_sql_common.rb
parentv5: output structure by, monolingual alternative, documentation (diff)
v5: cgi helper script, sample search form, single form, monolingual optionsisu_4.1.8
* single cgi form, (with different internal variables set for output types) * monolingual output search form option
Diffstat (limited to 'lib/sisu/v5/cgi_sql_common.rb')
-rw-r--r--lib/sisu/v5/cgi_sql_common.rb113
1 files changed, 59 insertions, 54 deletions
diff --git a/lib/sisu/v5/cgi_sql_common.rb b/lib/sisu/v5/cgi_sql_common.rb
index b551d6c8..0944ab61 100644
--- a/lib/sisu/v5/cgi_sql_common.rb
+++ b/lib/sisu/v5/cgi_sql_common.rb
@@ -845,72 +845,77 @@ module SiSU_CGI_SQL
@hostpath="#{@hosturl_files}/#{@stub}"
WOK_SQL
end
- def dir_structure
- case @opt.dir_structure_by
- when :language
- <<-'WOK_SQL'
- def path_manifest(fn,ln=nil)
- "#{@hostpath}/#{ln}/manifest/#{fn}.html"
- end
- def path_html_seg(fn,ln=nil)
- "#{@hostpath}/#{ln}/html/#{fn}"
- end
- def path_toc(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/toc.html"
- end
- def path_filename(fn,seg,ln=nil)
- "#{path_html_seg(fn,ln)}/#{seg}.html"
- end
- def path_endnotes(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/endnotes.html"
- end
- def path_html_doc(fn,ln=nil)
- "#{@hostpath}/#{ln}/html/#{fn}.html"
- end
- WOK_SQL
- when :filetype
- <<-'WOK_SQL'
- def path_manifest(fn,ln=nil)
- "#{@hostpath}/manifest/#{fn}.#{ln}.html"
- end
- def path_html_seg(fn,ln=nil)
- "#{@hostpath}/html/#{fn}"
- end
- def path_toc(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/toc.#{ln}.html"
- end
- def path_filename(fn,seg,ln=nil)
- "#{path_html_seg(fn,ln)}/#{seg}.#{ln}.html"
- end
- def path_endnotes(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/endnotes.#{ln}.html"
- end
- def path_html_doc(fn,ln=nil)
- "#{@hostpath}/html/#{fn}.#{ln}.html"
- end
- WOK_SQL
- else
- <<-'WOK_SQL'
+ def dir_structure #@opt.dir_structure_by
+ <<-'WOK_SQL'
def path_manifest(fn,ln=nil)
- "#{@hostpath}/#{fn}/sisu_manifest.#{ln}.html"
+ case @output_dir_structure_by
+ when 'filename'
+ @lingual =='mono' \
+ ? "#{@hostpath}/#{fn}/sisu_manifest.html"
+ : "#{@hostpath}/#{fn}/sisu_manifest.#{ln}.html"
+ when 'filetype'
+ @lingual =='mono' \
+ ? "#{@hostpath}/manifest/#{fn}.html"
+ : "#{@hostpath}/manifest/#{fn}.#{ln}.html"
+ else
+ "#{@hostpath}/#{ln}/manifest/#{fn}.html"
+ end
end
def path_html_seg(fn,ln=nil)
- "#{@hostpath}/#{fn}"
+ case @output_dir_structure_by
+ when 'filename'
+ "#{@hostpath}/#{fn}"
+ when 'filetype'
+ "#{@hostpath}/html/#{fn}"
+ else
+ "#{@hostpath}/#{ln}/html/#{fn}"
+ end
end
def path_toc(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/toc.#{ln}.html"
+ if @output_dir_structure_by =='filename' \
+ or @output_dir_structure_by =='filetype'
+ @lingual =='mono' \
+ ? "#{path_html_seg(fn,ln)}/toc.html"
+ : "#{path_html_seg(fn,ln)}/toc.#{ln}.html"
+ else
+ "#{path_html_seg(fn,ln)}/toc.html"
+ end
end
def path_filename(fn,seg,ln=nil)
- "#{path_html_seg(fn,ln)}/#{seg}.#{ln}.html"
+ if @output_dir_structure_by =='filename' \
+ or @output_dir_structure_by =='filetype'
+ @lingual =='mono' \
+ ? "#{path_html_seg(fn,ln)}/#{seg}.html"
+ : "#{path_html_seg(fn,ln)}/#{seg}.#{ln}.html"
+ else
+ "#{path_html_seg(fn,ln)}/#{seg}.html"
+ end
end
def path_endnotes(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/endnotes.#{ln}.html"
+ if @output_dir_structure_by =='filename' \
+ or @output_dir_structure_by =='filetype'
+ @lingual =='mono' \
+ ? "#{path_html_seg(fn,ln)}/endnotes.html"
+ : "#{path_html_seg(fn,ln)}/endnotes.#{ln}.html"
+ else
+ "#{path_html_seg(fn,ln)}/endnotes.html"
+ end
end
def path_html_doc(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/scroll.#{ln}.html"
+ case @output_dir_structure_by
+ when 'filename'
+ @lingual =='mono' \
+ ? "#{path_html_seg(fn,ln)}/scroll.html"
+ : "#{path_html_seg(fn,ln)}/scroll.#{ln}.html"
+ when 'filetype'
+ @lingual =='mono' \
+ ? "#{@hostpath}/html/#{fn}.html"
+ : "#{@hostpath}/html/#{fn}.#{ln}.html"
+ else
+ "#{@hostpath}/#{ln}/html/#{fn}.html"
+ end
end
- WOK_SQL
- end
+ WOK_SQL
end
def main3
<<-'WOK_SQL'