Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.204 -r1.205 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 17 Feb 2012 15:21:24 -0000 1.204 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 21 Feb 2012 13:04:59 -0000 1.205 @@ -87,9 +87,13 @@ # # todo: we could speed this up by an index if needed foreach f [::xowiki::formfield::FormField info instances -closure] { - if {[$f name] eq $name && $object eq [$f object]} { - #my msg FOUND-$object-$name->$f - return $f + if {[$f name] eq $name} { + if {![$f exists object]} { + my msg "strange, $f [$f name] was created without object but fits name" + return $f + } elseif {$object eq [$f object]} { + return $f + } } } #my msg not-found-$object-$name @@ -1432,6 +1436,8 @@ {callback "/* callback code */"} {destroy_callback "/* callback code */"} {extraPlugins ""} + {templatesFiles ""} + {templates ""} {contentsCss /resources/xowiki/ck_contents.css} {imageSelectorDialog /xowiki/ckeditor-images/} } @@ -1487,6 +1493,18 @@ } } + richtext::ckeditor instproc pathNames {fileNames} { + set result [list] + foreach fn $fileNames { + if {[regexp {^[./]} $fn]} { + append result $fn + } else { + append result "/resources/xowiki/$fn" + } + } + return $result + } + richtext::ckeditor instproc render_input {} { set disabled [expr {[my exists disabled] && [my disabled] ne "false"}] if {![my istype ::xowiki::formfield::richtext] || $disabled } { @@ -1527,6 +1545,12 @@ ready_callback: '$ready_callback', customConfig: '[my customConfig]' }] + if {[my templatesFiles] ne ""} { + append options " , templates_files: \['[join [my pathNames [my templatesFiles]] ',' ]' \]\n" + } + if {[my templates] ne ""} { + append options " , templates: '[my templates]'\n" + } #set parent [[[my object] package_id] get_page_from_item_or_revision_id [[my object] parent_id]];# ???