diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-03-19 22:19:13 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-03-19 22:19:13 -0400 |
commit | 98192c43c2d8686397a3884cacdc66ac93bafb02 (patch) | |
tree | 90903de5b159ac19992c88fe0d7fe7e232f969e4 /lib/sisu/v3/xml_tables.rb | |
parent | debian/changelog (3.1.15-2) (diff) | |
parent | COPYRIGHT, name change using uppercase, format changed (diff) |
Merge tag 'sisu_3.2.0' into debian/sid
Diffstat (limited to 'lib/sisu/v3/xml_tables.rb')
-rw-r--r-- | lib/sisu/v3/xml_tables.rb | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/lib/sisu/v3/xml_tables.rb b/lib/sisu/v3/xml_tables.rb index 1f154bda..5457a2fc 100644 --- a/lib/sisu/v3/xml_tables.rb +++ b/lib/sisu/v3/xml_tables.rb @@ -63,30 +63,30 @@ module SiSU_Tables @@tablehead=0 @@tablefoot=[] #watch #bug??? #check was @@tablefoot def initialize(one,ocn='') - @one,@parablock,@ocn,@vz=one,one,ocn,SiSU_Env::Get_init.instance.skin + @one,@parablock,@ocn,@vz=one,one,ocn,SiSU_Env::GetInit.instance.skin end def table_split #% used but, no longer operational, revisit @new_content=[] @one.split(/\n/).each do |parablock| - table=Table_xml.new("#{parablock}\n") + table=TableXML.new("#{parablock}\n") @new_content << table.table end @new_content.join end end - class Table_xml <Table + class TableXML <Table @@tablehead=0 @@tablefoot=[] def initialize(one,ocn='') - @one,@parablock,@ocn,@vz=one,one,ocn,SiSU_Env::Get_init.instance.skin + @one,@parablock,@ocn,@vz=one,one,ocn,SiSU_Env::GetInit.instance.skin end def table m=@parablock[/<!f(.+?)!>/,1] @@tablefoot << m if m - @parablock.gsub!(/<!f.+?!>/,'') + @parablock=@parablock.gsub(/<!f.+?!>/,'') @@tablehead=1 if @parablock =~/#{Mx[:gr_o]}Th#{Mx[:tc_p]}/u if @parablock =~/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}/u - @parablock.gsub!(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}.+?#{Mx[:tc_p]}~(\d+);\w\d+;\w\d+#{Mx[:gr_c]}/u, + @parablock=@parablock.gsub(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}.+?#{Mx[:tc_p]}~(\d+);\w\d+;\w\d+#{Mx[:gr_c]}/u, %{\n<ocn>#{@ocn}</ocn><table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">}) end if @parablock =~/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/ @@ -96,37 +96,37 @@ module SiSU_Tables end if @@tablehead==1 if @parablock =~/#{Mx[:tc_p]}#{Mx[:tc_p]}/u - @parablock.gsub!(/#{Mx[:tc_o]}#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u, + @parablock=@parablock.gsub(/#{Mx[:tc_o]}#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u, %{<tr> <td width="\\1%" valign="top"> - #{@vz.paragraph_table_xml}<b>}) - @parablock.gsub!(/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u, - %{</b></td><td width="\\1%" valign="top"> - #{@vz.paragraph_table_xml}<b>}) - @parablock.gsub!(/#{Mx[:tc_c]}/,"</b>\n</td>\n</tr>") + #{@vz.paragraph_table_xml}<b>}). + gsub(/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u, + %{</b></td><td width="\\1%" valign="top"> + #{@vz.paragraph_table_xml}<b>}). + gsub(/#{Mx[:tc_c]}/,"</b>\n</td>\n</tr>") @@tablehead=0 end @parablock else - @parablock.gsub!(/#{Mx[:tc_o]}#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u, + @parablock=@parablock.gsub(/#{Mx[:tc_o]}#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u, %{<tr> <td width="\\1%" valign="top"> - #{@vz.paragraph_table_xml}}) - @parablock.gsub!(/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u, - %{ + #{@vz.paragraph_table_xml}}). + gsub(/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u, + %{ </td> <td width="\\1%" valign="top"> - #{@vz.paragraph_table_xml}}) - @parablock.gsub!(/#{Mx[:tc_c]}/,"\n</td>\n</tr>\n") + #{@vz.paragraph_table_xml}}). + gsub(/#{Mx[:tc_c]}/,"\n</td>\n</tr>\n") end @parablock end end - class Table_xml_exp <Table + class TableXMLexp <Table @@tablehead=0 @@tablefoot=[] def initialize(one) - @one,@parablock,@vz=one,one,SiSU_Env::Get_init.instance.skin + @one,@parablock,@vz=one,one,SiSU_Env::GetInit.instance.skin end def table_head(inf) %{<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center"> @@ -159,7 +159,7 @@ module SiSU_Tables def table m=@parablock[/<!f(.+?)!>/,1] @@tablefoot << m if m - @parablock.gsub!(/<!f.+?!>/,'') + @parablock=@parablock.gsub(/<!f.+?!>/,'') @@tablehead=1 if @parablock =~/#{Mx[:gr_o]}Th#{Mx[:tc_p]}/u if @parablock =~/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}.+?#{Mx[:tc_p]}~(\d+);\w\d+;\w\d+#{Mx[:gr_c]}/u; @parablock=table_head($1) end @@ -173,26 +173,26 @@ module SiSU_Tables if @@tablehead==1 if @parablock =~/#{Mx[:tc_p]}#{Mx[:tc_p]}/u if @parablock =~/#{Mx[:tc_o]}#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u - @parablock.gsub!(/#{Mx[:tc_o]}#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u,table_row($1,true)) + @parablock=@parablock.gsub(/#{Mx[:tc_o]}#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u,table_row($1,true)) end if @parablock =~/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u - @parablock.gsub!(/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u,table_cell($1,true)) + @parablock=@parablock.gsub(/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u,table_cell($1,true)) end if @parablock =~/#{Mx[:tc_c]}/ - @parablock.gsub!(/#{Mx[:tc_c]}/,table_row_close(true)) + @parablock=@parablock.gsub(/#{Mx[:tc_c]}/,table_row_close(true)) end @@tablehead=0 end @parablock else if @parablock =~/^#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u - @parablock.gsub!(/^#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u,table_row($1)) + @parablock=@parablock.gsub(/^#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u,table_row($1)) end if @parablock =~/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u - @parablock.gsub!(/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u,table_cell($1)) + @parablock=@parablock.gsub(/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u,table_cell($1)) end if @parablock =~/#{Mx[:tc_c]}/ - @parablock.gsub!(/#{Mx[:tc_c]}/,table_row_close) + @parablock=@parablock.gsub(/#{Mx[:tc_c]}/,table_row_close) end @parablock end |