Index: openacs-4/packages/assessment/tcl/as-item-display-rb-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-display-rb-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/tcl/as-item-display-rb-procs.tcl 22 Nov 2004 11:59:22 -0000 1.3 +++ openacs-4/packages/assessment/tcl/as-item-display-rb-procs.tcl 8 Dec 2004 15:30:34 -0000 1.4 @@ -37,3 +37,57 @@ return $as_item_display_rb_id } + +ad_proc -public as::item_display_rb::edit { + -as_item_display_id:required + {-html_display_options ""} + {-choice_orientation ""} + {-choice_label_orientation ""} + {-sort_order_type ""} + {-item_answer_alignment ""} +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2004-12-07 + + Edit Item Display RadioButton Type to the database +} { + # Update as_item_display_rb in the CR (and as_item_display_rb table) getting the revision_id (as_item_display_id) + db_transaction { + set display_item_id [db_string display_item_id {}] + set new_item_display_id [content::revision::new \ + -item_id $display_item_id \ + -content_type {as_item_display_rb} \ + -attributes [list [list html_display_options $html_display_options] \ + [list choice_orientation $choice_orientation] \ + [list choice_label_orientation $choice_label_orientation] \ + [list sort_order_type $sort_order_type] \ + [list item_answer_alignment $item_answer_alignment] ] ] + } + + return $new_item_display_id +} + +ad_proc -public as::item_display_rb::copy { + -type_id:required +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2004-12-07 + + Copy an Item Display RadioButton Type +} { + set package_id [ad_conn package_id] + set folder_id [db_string get_folder_id "select folder_id from cr_folders where package_id=:package_id"] + + # Insert as_item_display_rb in the CR (and as_item_display_rb table) getting the revision_id (as_item_display_id) + db_transaction { + db_1row display_item_data {} + + set new_item_display_id [new -html_display_options $html_display_options \ + -choice_orientation $choice_orientation \ + -choice_label_orientation $choice_label_orientation \ + -sort_order_type $sort_order_type \ + -item_answer_alignment $item_answer_alignment] + } + + return $new_item_display_id +}