Index: openacs-4/packages/acs-templating/tcl/richtext-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/richtext-procs.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/acs-templating/tcl/richtext-procs.tcl 6 Jul 2006 20:09:47 -0000 1.23 +++ openacs-4/packages/acs-templating/tcl/richtext-procs.tcl 29 Jul 2006 02:01:39 -0000 1.24 @@ -24,6 +24,13 @@ {contents {}} {format {}} } { + Create a richtext widget + + @param contents The text content of the widget + @param format How that text is formatted (text, html, etc) + + @return Two-element list of the joined parameters +} { return [list $contents $format] } @@ -52,8 +59,18 @@ } } -ad_proc -public template::data::validate::richtext { value_ref message_ref } { +ad_proc -public template::data::validate::richtext { + value_ref + message_ref +} { + Validate richtext after form submission. + @param value_ref Reference variable to the submitted value + @param message_ref Reference variable for returning an error message + + @return True (1) if the submitted data is valid, false (0) if not +} { + upvar 2 $message_ref message $value_ref richtext_list set contents [lindex $richtext_list 0] @@ -76,8 +93,17 @@ return 1 } -ad_proc -public template::data::transform::richtext { element_ref } { +ad_proc -public template::data::transform::richtext { + element_ref +} { + Transform the previously-validated submitted data into a two-element list + as defined by the richtext datatype. + @param element_ref Reference variable to the form element + + @return Two-element list defined by the richtext datatype +} { + upvar $element_ref element set element_id $element(id)