::xotcl::Class
::xowiki::formfield::richtext
Class Hierarchy of ::xowiki::formfield::richtext
- ::xotcl::Object
- Meta-class:
- ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- Methods for instances:
- __api_make_doc, __api_make_forward_doc, __nextC, __timediff, abstract, ad_doc, ad_forward, ad_proc, appendC, arrayC, asHTML, autonameC, checkC, classC, cleanupC, configureC, contains, copy, db_1rowC, debug, defaultmethod, destroyC, destroy_on_cleanup, dot_append_method, dotclass, dotcode, dotquote, dotquotel, evalC, existsC, extractConfigureArg, filterC, filterguardC, filtersearchC, forwardC, hasclass, incrC, infoC, init, instvarC, invarC, isclassC, ismetaclassC, ismixinC, isobjectC, istypeC, lappendC, log, method, mixinC, mixinguardC, move, msg, noinitC, parametercmdC, procC, procsearchC, qn, requireNamespaceC, self, serialize, setC, substC, traceC, unsetC, uplevelC, upvarC, volatileC, vwaitC
- Methods to be applied on the class (in addition to the methods provided by the meta-class):
- __exitHandler, getExitHandler, setExitHandler, unsetExitHandler
- ::xo::OrderedComposite
- Meta-class:
- ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- Methods for instances:
- __compare, add, children, contains, delete, destroy, last_child, orderby, show
- Methods to be applied on the class:
- Methods provided by the meta-class
- ::xo::tdom::Object
- Meta-class:
- ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- Parameter for instances:
- autorender (default "true")
- Methods for instances:
- get_attributes, render
- Methods to be applied on the class:
- Methods provided by the meta-class
- ::xowiki::formfield::FormField
- Meta-class:
- ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- Parameter for instances:
- CSSclass, answer, correct_when, default, disabled, display_field (default "true"), error_msg (default ""), feedback_answer_correct, feedback_answer_incorrect, form-widget-CSSclass, help_text (default ""), hide_value (default "false"), id, inline (default "false"), label, locale, name, object, required (default "false"), show_raw_value, slot, spec (default ""), style, type (default "text"), validator (default ""), value (default "")
- Methods for instances:
- answer_check=btwn, answer_check=eq, answer_check=ge, answer_check=gt, answer_check=in, answer_check=le, answer_check=lt, answer_check=match, answer_is_correct, asWidgetSpec, behavior, config_from_spec, convert_to_external, convert_to_internal, field_value, has_instance_variable, init, interprete_single_spec, localize, pretty_image, pretty_value, remove_omit, render, render_error_msg, render_form_widget, render_help_text, render_input, render_item, render_localizer, reset_parameter, set_disabled, validate, value_if_nothing_is_returned_from_from
- Methods to be applied on the class (in addition to the methods provided by the meta-class):
- fc_decode, fc_encode, get_single_spec, interprete_condition
- ::xowiki::formfield::textarea
- Meta-class:
- ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- Parameter for instances:
- cols (default "80"), rows (default "2"), spell (default "false")
- Methods for instances:
- initialize, render_input
- Methods to be applied on the class:
- Methods provided by the meta-class
- ::xowiki::formfield::richtext
- Meta-class:
- ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- Parameter for instances:
- folder_id, height, plugins, script_dir, width, wiki (default "false")
- Methods for instances:
- check=safe_html, editor, initialize, pretty_value, render_richtext_as_div, validatorC
- Methods to be applied on the class:
- Methods provided by the meta-class
Class Relations
- superclass: ::xowiki::formfield::textarea
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- subclass: ::xowiki::formfield::form
, ::xowiki::formfield::richtext::wym
, ::xowiki::formfield::richtext::xinha![[i]](/resources/acs-subsite/ZoomIn16.gif)
::xotcl::Class create ::xowiki::formfield::richtext \
-superclass ::xowiki::formfield::textarea \
-parameter {folder_id height plugins script_dir width {wiki false}}
Methods
instproc check=safe_html
::xowiki::formfield::richtext instproc check=safe_html value {
# don't check if the user has admin permissions on the package
if {[::xo::cc permission -object_id [::xo::cc package_id] -privilege admin -party_id [::xo::cc user_id]]} {
set msg ""
} else {
set msg [ad_html_security_check $value]
}
if {$msg ne ""} {
my uplevel [list set errorMsg $msg]
return 0
}
return 1
}
instproc editor
::xowiki::formfield::richtext instproc editor args {
#
# TODO: this should be made a slot setting
#
#my msg "setting editor for [my name], args=$args,[llength $args]"
if {[llength $args] == 0} {return [my set editor]}
set editor [lindex $args 0]
if {[my exists editor] && $editor eq [my set editor] && [my exists __initialized]} return
set editor_class [self class]::$editor
if {$editor ne "" && ![my hasclass $editor_class]} {
if {![my 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 [my name] editor [my editor] editors $editors]]
}
foreach m [my info mixin] {if {[$m exists editor_mixin]} {my mixin delete $m}}
my mixin add $editor_class
#my msg "MIXIN $editor: [my info precedence]"
my reset_parameter
my set __initialized 1
}
my set editor $editor
}
instproc initialize
::xowiki::formfield::richtext instproc initialize {} {
my display_field false
next
if {![my exists editor]} {my set editor xinha} ;# set the default editor
if {![my exists __initialized]} {
# Mixin the editor based on the attribute 'editor' if necessary
# and call initialize again in this case...
my editor [my set editor]
my initialize
}
}
instproc pretty_value
::xowiki::formfield::richtext instproc pretty_value v {
# for richtext, perform minimal output escaping
if {[my wiki]} {
return [[my object] substitute_markup [list $v text/html]]
} else {
return [string map [list @ "@"] $v]
}
}
instproc render_richtext_as_div
::xowiki::formfield::richtext instproc render_richtext_as_div {} {
#my msg "[my get_attributes id style {CSSclass class}]"
::html::div [my get_attributes id style {CSSclass class}] {
if {[my wiki]} {
[my object] set unresolved_references 0
[my object] set __unresolved_references [list]
::html::t -disableOutputEscaping [[my object] substitute_markup [list [my value] text/html]]
} else {
::html::t -disableOutputEscaping [my value]
}
}
::html::div
}