lib/knj/web.rb in knjrbfw-0.0.42 vs lib/knj/web.rb in knjrbfw-0.0.43
- old
+ new
@@ -367,15 +367,15 @@
elsif args[:type] == :headline
html << "<tr#{classes_tr_html}><td colspan=\"2\"><h2 class=\"input_headline\">#{title_html}</h2></td></tr>"
elsif args[:type] == :spacer
html << "<tr#{classes_tr_html}><td colspan=\"2\"> </td></tr>"
else
- html << "<tr#{classes_tr_html}>"
- html << "<td class=\"tdt\">"
+ html << "<tr#{classes_tr_html} id=\"#{Knj::Web.html("#{args[:id]}_tr")}\">"
+ html << "<td class=\"tdt\" id=\"#{Knj::Web.html("#{args[:id]}_label")}\"><div>"
html << title_html
- html << "</td>"
- html << "<td#{self.style_html(css)} class=\"tdc\">"
+ html << "</div></td>"
+ html << "<td#{self.style_html(css)} class=\"tdc\" id=\"#{Knj::Web.html("#{args[:id]}_content")}\"><div>"
if args[:type] == :textarea
if args.key?(:height)
if Knj::Php.is_numeric(args[:height])
css["height"] = "#{args[:height]}px"
@@ -383,29 +383,25 @@
css["height"] = args[:height]
end
end
html << "<textarea#{self.style_html(css)} class=\"input_textarea\" name=\"#{args[:name].html}\" id=\"#{args[:id].html}\">#{value}</textarea>"
- html << "</td>"
elsif args[:type] == :fckeditor
args[:height] = 400 if !args[:height]
require "/usr/share/fckeditor/fckeditor.rb"
fck = FCKeditor.new(args[:name])
fck.Height = args[:height].to_i
fck.Value = value
html << fck.CreateHtml
-
- html << "</td>"
elsif args[:type] == :select
attr["multiple"] = "multiple" if args[:multiple]
attr["size"] = args["size"] if args[:size]
html << "<select#{self.attr_html(attr)}>"
html << Knj::Web.opts(args[:opts], value, args[:opts_args])
html << "</select>"
- html << "</td>"
elsif args[:type] == :imageupload
html << "<table class=\"designtable\"><tr#{classes_tr_html}><td style=\"width: 100%;\">"
html << "<input type=\"file\" name=\"#{args[:name].html}\" class=\"input_file\" />"
html << "</td><td style=\"padding-left: 5px;\">"
@@ -421,15 +417,14 @@
html << "<div style=\"text-align: center;\">(<a href=\"javascript: if (confirm('#{_("Do you want to delete the image?")}')){location.href='#{dellink}';}\">#{_("delete")}</a>)</div>"
end
end
html << "</td></tr></table>"
- html << "</td>"
elsif args[:type] == :file
- html << "<input type=\"#{args[:type].to_s}\" class=\"input_#{args[:type].to_s}\" name=\"#{args[:name].html}\" /></td>"
+ html << "<input type=\"#{args[:type].to_s}\" class=\"input_#{args[:type].to_s}\" name=\"#{args[:name].html}\" />"
elsif args[:type] == :textshow or args[:type] == :info
- html << "#{value}</td>"
+ html << value.to_s
elsif args[:type] == :plain
html << "#{Knj::Php.nl2br(Knj::Web.html(value))}"
elsif args[:type] == :editarea
css["width"] = "100%"
css["height"] = args[:height] if args.key?(:height)
@@ -448,16 +443,19 @@
html << "<script type=\"text/javascript\">"
html << "function knj_web_init_#{args[:name]}(){"
html << "editAreaLoader.init(#{Knj::Php.json_encode(jshash)});"
html << "}"
html << "</script>"
+ elsif args[:type] == :numeric
+ attr[:type] = :text
+ attr[:value] = value
+ html << "<input#{self.attr_html(attr)} />"
else
attr[:value] = value
- html << "<input#{self.attr_html(attr)} /></td>"
- html << "</td>"
+ html << "<input#{self.attr_html(attr)} />"
end
- html << "</tr>"
+ html << "</div></td></tr>"
end
html << "<tr#{classes_tr_html}><td colspan=\"2\" class=\"tdd\">#{args[:descr]}</td></tr>" if args[:descr]
return html
end
\ No newline at end of file