Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.432 -r1.433 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 20 May 2011 09:52:45 -0000 1.432 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 23 May 2011 10:57:30 -0000 1.433 @@ -2132,6 +2132,7 @@ # Finally provide base for auto-titles $f set __title_prefix [my title] + return $f } @@ -2331,14 +2332,20 @@ } Page instproc css_class_name {{-margin_form:boolean true}} { - # Determine the CSS class name for an HTML-form. + # Determine the CSS class name for xowiki forms # # We need this acually only for PageTemplate and FormPage, but # aliases will require XOTcl 2.0.... so we define it for the time # being on ::xowiki::Page set name [expr {$margin_form ? "margin-form " : ""}] set CSSname [my name] + + # Remove language prefix, if used. regexp {^..:(.*)$} $CSSname _ CSSname + + # Remove "file extension", since dot's in CSS class names do not + # make much sense. + regsub {[.].*$} $CSSname "" CSSname return [append name "Form-$CSSname"] } @@ -2499,8 +2506,8 @@ # template does not know about the logic with "_" (just "property" does). # if {[$form_obj istype ::xowiki::PageInstance]} { - #my msg "returning property $var from parent formpage $form_obj => '[$form_obj property $var]'" - return [$form_obj property $var] + #my msg "returning property $var from parent formpage $form_obj => '[$form_obj property $var $default]'" + return [$form_obj property $var $default] } # @@ -3056,6 +3063,7 @@ you might use flag '-new 1' for set_property to create new properties\n[lsort [my info vars]]" } my set $key $value + #my msg "[self] set $key $value" if {$instance_attributes_refresh} { my instance_attributes [my array get __ia] } Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.291 -r1.292 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 16 May 2011 12:27:53 -0000 1.291 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 23 May 2011 10:57:30 -0000 1.292 @@ -20,13 +20,19 @@ # Page instproc clipboard-add {} { my instvar package_id + if {![my exists_form_parameter "objects"]} { my msg "nothing to copy" } set ids [list] foreach page_name [my form_parameter objects] { # the page_name is the name exactly as stored in the content repository set item_id [::xo::db::CrClass lookup -name $page_name -parent_id [my item_id]] + if {$item_id == 0} { + # when the pasted item was from a child-resources includelet + # included on e.g. a plain page. we look for a sibling. + set item_id [::xo::db::CrClass lookup -name $page_name -parent_id [my parent_id]] + } #my msg "want to copy $page_name // $item_id" if {$item_id ne 0} {lappend ids $item_id} } @@ -154,6 +160,8 @@ } } } + + # load the instance attributes from the form parameters set instance_attributes [list] foreach {_att _value} [::xo::cc get_all_form_parameter] { if {[string match _* $_att]} continue @@ -1135,7 +1143,7 @@ set admin_link [$context_package_id make_link -privilege admin -link admin/ $context_package_id {} {}] set index_link [$context_package_id make_link -privilege public -link "" $context_package_id {} {}] - set import_link [$context_package_id make_link -privilege admin -link "" $context_package_id {} {}] + set import_link [$context_package_id make_link -privilege admin -link "" $context_package_id {} {}] set notification_subscribe_link "" if {[$context_package_id get_parameter "with_notifications" 1]} { @@ -1679,7 +1687,7 @@ Store the instance attributes or default values in the form. } { ::require_html_procs - #my msg "set_form_value instance attributes = [my instance_attributes]" + array set __ia [my instance_attributes] foreach f $form_fields { set att [$f name] @@ -1720,9 +1728,9 @@ if {![info exists field_names]} { set field_names [$cc array names form_parameter] - my log "form-params=[$cc array get form_parameter]" + #my log "form-params=[$cc array get form_parameter]" } - #my msg "fields $field_names, " + #my msg "fields $field_names // $form_fields" # we have a form and get all form variables