Index: openacs-4/packages/assessment/tcl/as-item-display-sb-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-display-sb-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/assessment/tcl/as-item-display-sb-procs.tcl 13 Apr 2005 18:51:54 -0000 1.10 +++ openacs-4/packages/assessment/tcl/as-item-display-sb-procs.tcl 12 Jun 2006 02:49:50 -0000 1.11 @@ -12,6 +12,7 @@ {-choice_label_orientation ""} {-sort_order_type ""} {-item_answer_alignment ""} + {-prepend_empty_p "f"} } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-08 @@ -23,15 +24,16 @@ # Insert as_item_display_sb in the CR (and as_item_display_sb table) getting the revision_id (as_item_display_id) db_transaction { - set item_item_display_sb_id [content::item::new -parent_id $folder_id -content_type {as_item_display_sb} -name [exec uuidgen]] + set item_item_display_sb_id [content::item::new -parent_id $folder_id -content_type {as_item_display_sb} -name [as::item::generate_unique_name]] set as_item_display_sb_id [content::revision::new \ -item_id $item_item_display_sb_id \ -content_type {as_item_display_sb} \ -attributes [list [list html_display_options $html_display_options] \ [list mulitple_p $multiple_p] \ [list choice_label_orientation $choice_label_orientation] \ [list sort_order_type $sort_order_type] \ - [list item_answer_alignment $item_answer_alignment] ] ] + [list item_answer_alignment $item_answer_alignment] \ + [list prepend_empty_p $prepend_empty_p] ] ] } return $as_item_display_sb_id @@ -44,6 +46,7 @@ {-choice_label_orientation ""} {-sort_order_type ""} {-item_answer_alignment ""} + {-prepend_empty_p "f"} } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-08 @@ -60,7 +63,8 @@ [list multiple_p $multiple_p] \ [list choice_label_orientation $choice_label_orientation] \ [list sort_order_type $sort_order_type] \ - [list item_answer_alignment $item_answer_alignment] ] ] + [list item_answer_alignment $item_answer_alignment] \ + [list prepend_empty_p $prepend_empty_p] ] ] } return $new_item_display_id @@ -133,11 +137,15 @@ } } + if { $type(prepend_empty_p) == "t" } { + set data [linsert $data 0 [list "" ""]] + } + set optional "" if {$required_p != "t"} { set optional ",optional" } - set param_list [list [list label $title] [list help_text $subtext] [list values $default_value] [list options $data] [list html $type(html_display_options)]] + set param_list [list [list label \$title] [list help_text \$subtext] [list values \$default_value] [list options \$data] [list html \$type(html_display_options)]] set element_params [concat [list "$element\:text($widget)$optional"] $param_list] ad_form -extend -name $form -form [list $element_params]