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.65 -r1.66
--- openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 6 Jul 2007 08:58:29 -0000 1.65
+++ openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 6 Jul 2007 10:14:43 -0000 1.66
@@ -1111,6 +1111,16 @@
toc instproc position {} {return [my set navigation(position)]}
toc instproc page_name {p} {return [my set page_name($p)]}
+ toc proc anchor {name} {
+ if {![regexp {^.*:([^:]+)$} $name _ anchor]} {
+ # we might have an unnamed entry, which has no language prefix
+ set anchor $name
+ }
+ # anchor is used between single quotes
+ regsub -all ' $anchor {\'} anchor
+ return $anchor
+ }
+
toc instproc get_nodes {open_page package_id expand_all remove_levels} {
my instvar navigation page_name book_mode
array set navigation {parent "" position 0 current ""}
@@ -1151,8 +1161,7 @@
if {![regexp {^(.*)[.]([^.]+)} $page_order _ parent]} {set parent ""}
if {$book_mode} {
- regexp {^.*:([^:]+)$} $name _ anchor
- set href [$package_id url]#$anchor
+ set href [$package_id url]#[toc anchor $name]
} else {
set href [$package_id pretty_link $name]
}
@@ -1443,10 +1452,9 @@
set content [string map [list "\{\{" "\\\{\{"] $content]
}
}
- regexp {^.*:([^:]+)$} $name _ anchor
append output "" \
$edit_markup \
- "$page_order $title" \
+ "$page_order $title" \
$content
}
return $output
@@ -1564,10 +1572,9 @@
set content [string map [list "\{\{" "\\\{\{"] $content]
}
}
- regexp {^.*:([^:]+)$} $name _ anchor
append output "" \
$edit_markup \
- "$page_order $title" \
+ "$page_order $title" \
$content
}
return $output