Index: openacs-4/packages/acs-templating/tcl/richtext-or-file-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/richtext-or-file-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/tcl/richtext-or-file-procs.tcl 29 Jan 2004 15:50:03 -0000 1.2 +++ openacs-4/packages/acs-templating/tcl/richtext-or-file-procs.tcl 29 Jul 2006 02:01:39 -0000 1.3 @@ -28,6 +28,8 @@ {tmp_filename {}} {content_url {}} } { + Create a richtext_or_file datastructure. +} { return [list $storage_type $mime_type $text $filename $tmp_filename $content_url] } @@ -56,8 +58,20 @@ } } -ad_proc -public template::data::validate::richtext_or_file { value_ref message_ref } { +ad_proc -public template::data::validate::richtext_or_file { + value_ref + message_ref +} { + Validate submitted richtext_or_file by checking that the format is valid, HTML doesn't + contain illegal tags, etc. + @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 value is valid, false (0) otherwise +} { + + upvar 2 $message_ref message $value_ref richtext_or_file_list set storage_type [lindex $richtext_or_file_list 0] @@ -84,8 +98,17 @@ return 1 } -ad_proc -public template::data::transform::richtext_or_file { element_ref } { +ad_proc -public template::data::transform::richtext_or_file { + element_ref +} { + Transform submitted data into a valid richtext_or_file data structure (list) + @param element_ref Reference variable to the form element + + @return Submitted data in the richtext_or_datafile list form + +} { + upvar $element_ref element set element_id $element(id) @@ -226,8 +249,18 @@ } } -ad_proc -public template::widget::richtext_or_file { element_reference tag_attributes } { +ad_proc -public template::widget::richtext_or_file { + element_reference + tag_attributes +} { + Render a richtext_or_file widget + @param element_reference Reference variable to the form element + @param tag_attributes Attributes to include in the generated HTML + + @return Form HTML for the widget + +} { upvar $element_reference element if { [info exists element(html)] } { 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) Index: openacs-4/packages/acs-templating/tcl/table-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/table-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-templating/tcl/table-procs.tcl 15 Oct 2003 12:35:51 -0000 1.5 +++ openacs-4/packages/acs-templating/tcl/table-procs.tcl 29 Jul 2006 02:01:39 -0000 1.6 @@ -50,7 +50,13 @@ namespace eval template::widget::table {} -ad_proc -public template::widget::table::create { statement_name name args } { +ad_proc -public template::widget::table::create { + statement_name + name + args +} { + Create a table widget +} { upvar "tablewidget:${name}" widget @@ -60,16 +66,24 @@ template::widget::table::prepare $statment_name $name 2 } -# Get the order by clause for the widget, other parameters (?) -ad_proc -public template::widget::table::get_params { name {level 1} } { +ad_proc -public template::widget::table::get_params { + name + {level 1} +} { + Get the order by clause for the widget, other parameters (?) +} { upvar $level "tablewidget:${name}" widget set widget(orderby) [ns_queryget "tablewidget:${name}_orderby"] } -# Create the default column definition if none exists -ad_proc -public template::widget::table::default_column_def { name { level 2} } { +ad_proc -public template::widget::table::default_column_def { + name + { level 2} +} { + Create the default column definition if none exists +} { upvar $level "tablewidget:${name}" widget @@ -88,8 +102,13 @@ } } -# Compose the query, if neccessary, and define the datasources -ad_proc -public template::widget::table::prepare { statement_name name {level 1} } { +ad_proc -public template::widget::table::prepare { + statement_name + name + {level 1} +} { + Compose the query, if neccessary, and define the datasources +} { upvar $level "tablewidget:${name}" widget