lib/voruby/votables/hst.rb in voruby-1.0.2 vs lib/voruby/votables/hst.rb in voruby-1.1
- old
+ new
@@ -166,23 +166,23 @@
# [_header_class_:]
# The class to assign the header of the HTML table.
def create_headers(res, tbl,
infer_add_to_cart_ref, add_to_cart_header_value,
infer_access_ref, access_ref_header_value, access_ref_col,
- header_class)
+ header_class, id=nil)
headers = Array.new
thead = "<thead class=\"#{header_class}\">\n"
thead << "<tr>\n"
if infer_add_to_cart_ref
thead << "<th>#{add_to_cart_header_value}</th>\n"
- headers.push(' ')
+ headers.push("<a href=\"javascript:void(0);\" onclick=\"siap.addAllRowsToCart('#{id}');\">*</a>")
end
if infer_access_ref
thead << "<th>#{access_ref_header_value}</th>\n"
- headers.push(' ')
+ headers.push(' ')
end
col_count = 0
fields(res, tbl).each do |field|
field_archive = find_field_in_conf_file(field.ucd.value())
field_ucd = field_archive['ucd']
@@ -191,11 +191,11 @@
else
thead << "<th>#{field_archive['name']}</th>\n"
if field_ucd != 'nil'
headers.push(field_ucd)
else
- headers.push(' ')
+ headers.push(' ')
end
end
col_count += 1
end
thead << " </tr>\n"
@@ -358,10 +358,10 @@
if access_ref_col
# Create headers
thead = create_headers(res, tbl,
infer_add_to_cart_ref, add_to_cart_header_value,
infer_access_ref, access_ref_header_value, access_ref_col,
- header_class)
+ header_class, id)
# Create body
tbody = create_body(res, tbl,
infer_add_to_cart_ref, add_to_cart_link_value, add_to_cart_link_ref,
infer_access_ref, access_ref_link_value, access_ref_col,
\ No newline at end of file