- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::formfield::richtext
::xowiki::formfield::richtextcreate ... \
[ -displayMode (default "standard") ] \
[ -folder_id folder_id ] \
[ -height height ] \
[ -plugins plugins ] \
[ -preset (default "standard") ] \
[ -script_dir script_dir ] \
[ -toolbar toolbar ] \
[ -width width ] \
[ -wiki (default "false") ]
Class Relations
- class: ::xotcl::Class
- superclass: ::xowiki::formfield::textarea
- subclass: ::xowiki::formfield::richtext::ckeditor4
, ::xowiki::formfield::richtext::tinymce
, ::xowiki::formfield::richtext::wym
, ::xowiki::formfield::richtext::xinha
, ::xowiki::formfield::form
, ::xowiki::formfield::localized_richtext
::xotcl::Class create ::xowiki::formfield::richtext \ -superclass ::xowiki::formfield::textareaMethods (to be applied on instances)
check=safe_html (scripted)
# # Don't check, if the user has sufficient permissions on the # package # if {[::xo::cc permission -object_id [::xo::cc package_id] -privilege swa -party_id [::xo::cc user_id]]} { set msg "" } else { # # Check, if the package has global settings for AllowedTags, # AllowedAttributes, or AllowedProtocols. If (some of) these # exist, use these for configuring "ad_html_security_check". If # not, fall back to the default (site-wide) definition. # set package_key [apm_package_key_from_id [${:object} package_id]] set options {} foreach var {attributes tags protocols} { set params [parameter::get_global_value -package_key $package_key -parameter Allowed[string totitle $var] -default ""] if {$params ne ""} { lappend options -allowed_$var $params } } set msg [ad_html_security_check {*}$options $value] } if {$msg ne ""} { :uplevel [list set errorMsg $msg] return 0 } return 1displayMode (setter)
editor (scripted)
# # TODO: this should be made a slot setting # #:log "RICHTEXT setting editor for ${:name}, args=$args,[llength $args]" if {[llength $args] == 0} { return ${:editor} } set editor [lindex $args 0] if {[info exists :editor] && $editor eq ${:editor} && [info exists :__initialized]} { return ${:editor} } # # The "none" setting for the richtext field is especially # important for cases, where no editor is specified, which causes # the PreferredRichtextEditor to be used. However, the "form" # field of the xowiki::Form class requires a content surrounded by # the form tag (<form>....</form>), but the CKEditor will remove # sich entries. Since it is better to work on the raw text, # editor=none prevents the usage of the rich text widget, although # it is a richtext field. # if {$editor eq "none"} { set :editor "none" :clear_editor_mixins if {[info exists :options]} { unset :options } return ${:editor} } set editor_class [self class]::$editor if {$editor ne "" && ![:hasclass $editor_class]} { if {![:isclass $editor_class]} { set editors [list] foreach c [::xowiki::formfield::richtext info subclass] { if {![$c exists editor_mixin]} continue lappend editors [namespace tail $c] } error [_ xowiki.error-form_constraint-unknown_editor [list name ${:name} editor [:editor] editors $editors]] } :clear_editor_mixins :mixin add $editor_class #:msg "MIXIN $editor: [:info precedence]" :reset_parameter set :__initialized 1 } set :editor $editorfolder_id (setter)
height (setter)
initialize (scripted)
#set :display_field false switch -- ${:displayMode} { inplace - inline - standard {} default {error "value '${:displayMode}' invalid: valid entries for displayMode are inplace, inline or standard (default)"} } next # # Don't set HTML5 attribute "required", since this does not match # well with Richtext Editors (at least ckeditor4 has problems, # other probably as well). # set :booleanHTMLAttributes {readonly disabled formnovalidate} #ns_log notice "==== ${:name} EDITOR specified? [info exists :editor]" if {![info exists :editor]} { set :editor [parameter::get_global_value -package_key xowiki -parameter PreferredRichtextEditor -default ckeditor4] #:msg "setting default of ${:name} to ${:editor}" } if {![info exists :__initialized]} { # # Mixin the editor based on the attribute 'editor' if necessary # and call initialize again in this case... # #ns_log notice "==== initializing EDITOR: ${:editor}" :editor ${:editor} :initialize } set :widget_type richtext #set :__initialized 1plugins (setter)
preset (setter)
preset_conf (scripted)
# # The actual richtext-editor implementation may provide some # use-case based presets. Examples may be a "minimal", "standard" # and "advanced" configuration that are reused in various forms. # # Here, we check and eventually return such conf, which will be # applied to the loading formfield. # # The default for the :preset variable is set to "standard", but # may be overridden by subclasses. This provides a hook for # site-wide customization via a Tcl proc, which enables to inject # e.g. information coming from the connection context or other tcl # commands, not possible via parameter alone. # # The purpose of this feature is to have a set of logical # configurations that do not depend on the specific editor and can # be extended downstream. # if {[info exists :preset] && [info exists :editor] && [info commands ::richtext::${:editor}::preset::${:preset}] ne ""} { return [::richtext::${:editor}::preset::${:preset}] }pretty_value (scripted)
# for richtext, perform minimal output escaping if {[:wiki]} { return [${:object} substitute_markup $v] } else { return [string map [list @ "@"] $v] }script_dir (setter)
toolbar (setter)
validator (setter)
width (setter)
wiki (setter)
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables