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 -N -r1.69 -r1.70 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 18 Apr 2008 10:14:37 -0000 1.69 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 18 Apr 2008 20:22:53 -0000 1.70 @@ -393,28 +393,6 @@ return [string map [list & "&" < "<" > ">" \" """ ' "'" @ "@"] $v] } - FormField instproc config_from_form {form_name} { - set package_id [[my object] package_id] - set form_item_id [::xo::db::CrClass lookup -name $form_name -parent_id [$package_id folder_id]] - if {$form_item_id == 0} {error "Cannot lookup page $form"} - - array set wc {tcl true h ""} - if {[info exists where]} { - array set wc [::xowiki::FormPage filter_expression $where &&] - set init_vars [concat $init_vars $wc(vars)] - } - - set items [::xowiki::FormPage get_children \ - -base_item_id $form_item_id \ - -form_fields [list] \ - -publish_status ready \ - -always_queried_attributes [list _name _title _last_modified _creation_user] \ - -h_where $wc(h) \ - -folder_id [$package_id folder_id]] - foreach i [$items children] {lappend options [list [$i title] [$i name]]} - my options $options - } - FormField instproc config_from_category_tree {tree_name} { # Get the options of a select or rado from the specified # category tree. @@ -905,12 +883,11 @@ {options} {multiple "false"} {category_tree} - {form} } + FormField::select instproc initialize {} { my set widget_type text(select) if {[my exists category_tree]} {my config_from_category_tree [my category_tree]} - if {[my exists form]} {my config_from_form [my form]} if {![my exists options]} {my options [list]} } FormField::select instproc render_input {} { @@ -943,7 +920,33 @@ {form} {as_box false} } - + FormField instproc config_from_form {form_name} { + set form [[my object] resolve_included_page_name $form_name] + if {$form eq ""} {error "Cannot lookup Form '$form_name'"} + + set prefix "" + regexp {^(//[^/]+/)} $form_name _ prefix + + array set wc {tcl true h ""} + if {[info exists where]} { + array set wc [::xowiki::FormPage filter_expression $where &&] + set init_vars [concat $init_vars $wc(vars)] + } + + set items [::xowiki::FormPage get_children \ + -base_item_id [$form item_id] \ + -form_fields [list] \ + -publish_status ready \ + -always_queried_attributes [list _name _title _last_modified _creation_user] \ + -h_where $wc(h) \ + -folder_id [$form parent_id]] + foreach i [$items children] {lappend options [list [$i title] $prefix[$i name]]} + my options $options + } + FormField::form_page instproc initialize {} { + if {[my exists form]} {my config_from_form [my form]} + next + } FormField::form_page instproc pretty_value {v} { set package_id [[my object] package_id] if {[my multiple]} { Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -N -r1.115 -r1.116 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 10 Apr 2008 07:52:57 -0000 1.115 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 18 Apr 2008 20:22:53 -0000 1.116 @@ -13,9 +13,10 @@ -pretty_name "XoWiki" \ -package_key xowiki \ -parameter { - {folder_id "[::xo::cc query_parameter folder_id 0]"} + {folder_id 0} {force_refresh_login true} } + # {folder_id "[::xo::cc query_parameter folder_id 0]"} Package ad_proc instantiate_page_from_id { {-revision_id 0} @@ -316,9 +317,9 @@ } } } + if {[string match "//*" $object]} { - - # we have a reference to another instance, we cant resolve this from this package. + # we have a reference to another instance, we cant resolve this from this package. # Report back not found return "" } @@ -461,7 +462,7 @@ if {$path ne ""} { set item_id [::xo::db::CrClass lookup -name $path -parent_id $folder_id] - my log "--try $path -> $item_id" + my log "--try $path ($folder_id) -> $item_id" if {$item_id == 0} { my get_name_and_lang_from_path $path lang local_name 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 -N -r1.228 -r1.229 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 17 Apr 2008 11:45:55 -0000 1.228 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 18 Apr 2008 20:22:53 -0000 1.229 @@ -509,6 +509,10 @@ # Handle cross package resolve requests # Note, that package::initialize might change the package id. # + # + # TODO: We assume here that the package is an xowiki package. + # The package might be as well a subclass of xowiki... + # ::xowiki::Package initialize -parameter {{-m view}} -url $url \ -actual_query "" if {$package_id != 0} {