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.107 -r1.108 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 8 Jan 2008 16:22:06 -0000 1.107 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 11 Jan 2008 13:35:45 -0000 1.108 @@ -246,7 +246,21 @@ return "" } + Package instproc create_new_snippet { + {-object_type ::xowiki::Page} + provided_name + } { + my get_name_and_lang_from_path $provided_name lang local_name + set name ${lang}:$local_name + set new_link [my make_link [my id] edit-new object_type return_url name] + if {$new_link ne ""} { + return "
Do you want to create page $name new?" + } else { + return "" + } + } + Package instproc invoke {-method {-error_template error-template}} { set page [my resolve_page [my set object] method] #my log "--r resolve_page returned $page" @@ -260,16 +274,7 @@ } else { # the requested page was not found, provide an error message and # an optional link for creating the page - my instvar id - my get_name_and_lang_from_path [my set object] lang local_name - set name ${lang}:$local_name - set object_type ::xowiki::Page ;# for the time being; maybe a parameter? - set new_link [my make_link $id edit-new object_type return_url name] - if {$new_link ne ""} { - set edit_snippet "
Do you want to create page $name new?" - } else { - set edit_snippet "" - } + set edit_snippet [my create_new_snippet [my set object]] return [my error_msg -template_file $error_template \ "Page '[my set object]' is not available. $edit_snippet"] }