Index: openacs-4/packages/xowiki/tcl/menu-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/menu-procs.tcl,v diff -u -r1.8.2.1 -r1.8.2.2 --- openacs-4/packages/xowiki/tcl/menu-procs.tcl 9 Feb 2016 11:06:35 -0000 1.8.2.1 +++ openacs-4/packages/xowiki/tcl/menu-procs.tcl 21 Mar 2016 09:50:35 -0000 1.8.2.2 @@ -128,6 +128,8 @@ Class create ::xowiki::MenuBar -parameter { id + {dropzone:boolean true} + {parent_id ""} } if {[info commands ::dict] ne ""} { @@ -176,6 +178,23 @@ my set Menu($menu) [list text $(text)] } + ::xowiki::MenuBar instproc current_folder {} { + if {${:parent_id} ne ""} { + return ${:parent_id} + } else { + # + # If the current object is the package, use the root folder as + # current_folder; else use the parent of the current object. + # + set object [::xo::cc invoke_object] + if {[$object istype ::xowiki::Package]} { + return [$object folder_id] + } else { + return [$object parent_id] + } + } + } + ::xowiki::MenuBar instproc add_menu_item {-name:required -item:required} { # # The provided items are of the form of attribute-value pairs @@ -238,6 +257,7 @@ # # {clear_menu -menu New} # {entry -name New.Page -label #xowiki.new# -form en:page.form} + my set parent_id $parent_id foreach me $items { array unset ""