Index: openacs-4/packages/acs-templating/acs-templating.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/acs-templating.info,v
diff -u -r1.25 -r1.26
--- openacs-4/packages/acs-templating/acs-templating.info 27 Feb 2004 19:39:25 -0000 1.25
+++ openacs-4/packages/acs-templating/acs-templating.info 4 Mar 2004 18:41:54 -0000 1.26
@@ -34,11 +34,12 @@
-
+
+
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.15 -r1.16
--- openacs-4/packages/acs-templating/tcl/richtext-procs.tcl 29 Jan 2004 15:37:22 -0000 1.15
+++ openacs-4/packages/acs-templating/tcl/richtext-procs.tcl 4 Mar 2004 18:41:54 -0000 1.16
@@ -162,7 +162,19 @@
}
ad_proc -public template::widget::richtext { element_reference tag_attributes } {
+ Implements the richtext widget, which offers rich text editing options.
+ If the acs-templating.UseHtmlAreaForRichtextP parameter is set to true (1), this will use the htmlArea WYSIWYG editor widget.
+ Otherwise, it will use a normal textarea, with a drop-down to select a format. The available formats are:
+
+
Enhanced text = Allows HTML, but automatically inserts line and paragraph breaks.
+
Plain text = Automatically inserts line and paragraph breaks, and quotes all HTML-specific characters, such as less-than, greater-than, etc.
+
Fixed-width text = Same as plain text, but conserves spacing; useful for tabular data.
+
HTML = normal HTML.
+
+ You can also parameterize the richtext widget with a 'htmlarea_p' attribute, which can be true or false, and which will override the parameter setting.
+} {
+
upvar $element_reference element
if { [info exists element(html)] } {
@@ -184,8 +196,29 @@
if { [string equal $element(mode) "edit"] } {
append output {}
+ set attributes(id) "richtext__$element(form_id)__$element(id)"
+
+ if { [exists_and_not_null element(htmlarea_p)] } {
+ set htmlarea_p [template::util::is_true $element(htmlarea_p)]
+ } else {
+ set htmlarea_p [parameter::get \
+ -package_id [apm_package_id_from_key "acs-templating"] \
+ -parameter "UseHtmlAreaForRichtextP" \
+ -default 0]
+ }
+
+ if { $htmlarea_p } {
+ # Tell the blank-master to include the special stuff for htmlArea in the page header
+ global acs_blank_master__htmlareas
+ lappend acs_blank_master__htmlareas $attributes(id)
+ }
+
append output [textarea_internal "$element(id)" attributes $contents]
- append output " Format: [menu "$element(id).format" [template::util::richtext::format_options] $format attributes]"
+ if { $htmlarea_p } {
+ append output ""
+ } else {
+ append output " Format: [menu "$element(id).format" [template::util::richtext::format_options] $format attributes]"
+ }
# Spell-checker
array set spellcheck [template::util::spellcheck::spellcheck_properties -element_ref element]