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 -N -r1.56 -r1.57 --- openacs-4/packages/acs-templating/tcl/richtext-procs.tcl 24 Dec 2017 12:56:09 -0000 1.56 +++ openacs-4/packages/acs-templating/tcl/richtext-procs.tcl 22 Jan 2018 09:42:31 -0000 1.57 @@ -187,114 +187,8 @@ } } -ad_proc -public -deprecated template::widget::richtext_htmlarea { 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: - - 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. - @see template::widget::richtext -} { - upvar $element_reference element - - if { [info exists element(html)] } { - array set attributes $element(html) - } - - array set attributes $tag_attributes - - if { [info exists element(value)] } { - set contents [template::util::richtext::get_property contents $element(value)] - set format [template::util::richtext::get_property format $element(value)] - } else { - set contents {} - set format {} - } - - set output {} - - if {$element(mode) eq "edit"} { - append output {} - - set attributes(id) "richtext__$element(form_id)__$element(id)" - - if { ([info exists element(htmlarea_p)] && $element(htmlarea_p) ne "") } { - 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] - } - - # Check browser's User-Agent header for compatibility with htmlArea - ad_return_complaint 1 "use htmlareap = $htmlarea_p" - if { $htmlarea_p } { - set user_agent [string tolower [ns_set get [ns_conn headers] User-Agent]] - if { [string first "opera" $user_agent] != -1 } { - # Opera - doesn't work, even though Opera claims to be IE - set htmlarea_p 0 - } elseif { [regexp {msie ([0-9]*)\.([0-9]+)} $user_agent matches major minor] } { - # IE, works for browsers > 5.5 - if { $major < 5 || ($major == 5 && $minor < 5) } { - set htmlarea_p 0 - } - } elseif { [regexp {gecko/0*([1-9][0-9]*)} $user_agent match build] } { - if { $build < 20030210 } { - set htmlarea_p 0 - } - } else { - set htmlarea_p 0 - } - } - - if { $htmlarea_p } { - # Tell the blank-master to include the special stuff for htmlArea in the page header - lappend ::acs_blank_master__htmlareas $attributes(id) - } - - append output [textarea_internal $element(id) attributes $contents] - if { $htmlarea_p } { - append output [subst {}] - } else { - append output \ - [subst {
[_ acs-templating.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] - if { $spellcheck(render_p) } { - append output \ - [subst { [_ acs-templating.Spellcheck]: }] \ - [menu "$element(id).spellcheck" [nsv_get spellchecker lang_options] \ - $spellcheck(selected_option) attributes] - } - } else { - # Display mode - if { [info exists element(value)] } { - append output \ - [template::util::richtext::get_property html_value $element(value)] \ - [subst {}] \ - [subst {}] - } - } - - return $output -} - - # ---------------------------------------------------------------------- # # Richtext plugin interface