Index: openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/Attic/xowiki-portlet-procs.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 19 Jan 2007 13:53:14 -0000 1.20 +++ openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 21 Jan 2007 18:00:00 -0000 1.21 @@ -4,6 +4,10 @@ -superclass ::xo::Context \ -parameter {{name ""} {title ""} {__decoration "portlet"} {id}} + ::xowiki::Portlet instproc js_name {} { + return [string map [list : _ # _] [self]] + } + ::xowiki::Portlet instproc locale_clause {package_id locale} { set default_locale [$package_id default_locale] set system_locale "" @@ -600,6 +604,7 @@ $pages orderby page_order my set jsobjs "" + #my log "--book read [llength [$pages children]] pages" foreach o [$pages children] { $o instvar page_order title page_id name title @@ -612,7 +617,7 @@ set label "$displayed_page_order $title" set id tmpNode[incr node_cnt] set node($page_order) $id - set jsobj TocTree.objs\[$node_cnt\] + set jsobj [my js_name].objs\[$node_cnt\] set page_name($node_cnt) $name if {![regexp {^(.*)[.]([^.]+)} $page_order _ parent]} {set parent ""} @@ -641,6 +646,7 @@ } set parent_node [expr {[info exists node($parent)] ? $node($parent) : "root"}] set refvar [expr {[my set ajax] ? "ref" : "href"}] + my log "$jsobj = {label: \"$label\", id: \"$id\", $refvar: \"$href\", c: $node_cnt};" append js \ "$jsobj = {label: \"$label\", id: \"$id\", $refvar: \"$href\", c: $node_cnt};" \ "var $node($page_order) = new YAHOO.widget.TextNode($jsobj, $parent_node, $expand);\n" \ @@ -649,14 +655,14 @@ } set navigation(count) $node_cnt - #my log "--COUNT=$node_cnt" + my log "--COUNT=$node_cnt" return $js } toc instproc ajax_tree {js_tree_cmds} { return "