Index: openacs-4/packages/xowiki/tcl/link-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/link-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 8 Nov 2006 22:22:21 -0000 1.12 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 30 Nov 2006 20:03:13 -0000 1.13 @@ -22,8 +22,11 @@ my log "--L link has class [my info class] // $class" } Link instproc resolve {} { - #my log "--lookup of [my name]" - ::Generic::CrItem lookup -name [my name] -parent_id [my folder_id] + my log "--lookup of [my name]" + if {![regexp {(.*?)(\#|%23)+(.*)$} [my stripped_name] full_name name anchor_tag anchor]} { + set name [my name] + } + ::Generic::CrItem lookup -name $name -parent_id [my folder_id] } Link instproc render_found {href label} { return "$label" @@ -35,11 +38,16 @@ my instvar package_id set page [my page] set item_id [my resolve] - #my log "--u resolve returns $item_id" + my log "--u resolve returns $item_id" if {$item_id} { $page lappend references [list $item_id [my type]] ::xowiki::Package require $package_id - set href [::$package_id pretty_link -lang [my lang] [my stripped_name]] + if {![regexp {(.*?)(\#|%23)+(.*)$} [my stripped_name] full_name name anchor_tag anchor]} { + set name [my stripped_name] + set anchor "" + } + set href [::$package_id pretty_link -lang [my lang] -anchor $anchor $name] + my render_found $href [my label] } else { $page incr unresolved_references 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 -r1.21 -r1.22 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 30 Nov 2006 17:37:39 -0000 1.21 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 30 Nov 2006 20:03:13 -0000 1.22 @@ -57,7 +57,7 @@ } Package instproc pretty_link { - {-absolute:boolean false} {-lang ""} name + {-anchor ""} {-absolute:boolean false} {-lang ""} name } { #my log "--u name=<$name>" if {$lang eq ""} { @@ -72,9 +72,9 @@ set host [expr {$absolute ? [ad_url] : ""}] if {$lang ne ""} { - return $host[my package_url]$lang/[ad_urlencode $name] + return $host[my package_url]$lang/[ad_urlencode $name][expr {$anchor ne "" ? "\#${anchor}" : ""}] } else { - return $host[my package_url][ad_urlencode $name] + return $host[my package_url][ad_urlencode $name][expr {$anchor ne "" ? "#${anchor}" : ""}] } } @@ -212,6 +212,7 @@ set item_id 0 if {$path ne ""} { + set item_id [::Generic::CrItem lookup -name $path -parent_id $folder_id] my log "--try $path -> $item_id" Index: openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 17 Nov 2006 21:26:23 -0000 1.16 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 30 Nov 2006 20:03:13 -0000 1.17 @@ -14,22 +14,21 @@ Class create WikiForm -superclass ::Generic::Form \ -parameter { - {field_list {item_id name title creator text description nls_language}} - {f.item_id - {item_id:key}} - {f.name - {name:text {label #xowiki.name#} {html {size 80}} }} - {f.title - {title:text {label #xowiki.title#} {html {size 80}} }} - {f.creator - {creator:text,optional {label #xowiki.creator#} {html {size 80}} }} - {f.text - {text:richtext(richtext),nospell,optional - {label #xowiki.content#} - {options {editor xinha plugins { - GetHtml CharacterMap ContextMenu FullScreen InsertAnchor - ListType TableOperations EditTag LangMarks Abbreviation OacsFs - } height 350px + {field_list {item_id name title creator text description nls_language}} + {f.item_id + {item_id:key}} + {f.name + {name:text {label #xowiki.name#} {html {size 80}} }} + {f.title + {title:text {label #xowiki.title#} {html {size 80}} }} + {f.creator + {creator:text,optional {label #xowiki.creator#} {html {size 80}} }} + {f.text + {text:richtext(richtext),nospell,optional + {label #xowiki.content#} + {options {editor xinha plugins { +[parameter::get -parameter "XowikiXinhaDefaultPlugins" -default [parameter::get_from_package_key -package_key "acs-templating" -parameter "XinhaDefaultPlugins"]] + } height 350px }} {html {rows 15 cols 50 style {width: 100%}}}} } @@ -197,6 +196,10 @@ ::xowiki::notification::do_notifications -page $data } } + application_data_link::update_links_from \ + -object_id [$data set item_id] \ + -text [$data set text] + } @@ -373,6 +376,7 @@ #my submit_link [export_vars -base edit {folder_id object_type item_id page_template return_url}] my submit_link [export_vars -base $link {{m edit} page_template return_url item_id}] my log "-- submit_link = [my submit_link]" + ns_log notice "-- submit_link = [my submit_link]" } PageInstanceForm instproc new_data {} { @@ -384,7 +388,7 @@ PageInstanceForm instproc edit_data {} { set item_id [next] - #my log "-- edit_data item_id=$item_id" + my log "-- edit_data item_id=$item_id" return $item_id }