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.31 -r1.32 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 27 Jan 2007 17:29:57 -0000 1.31 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 29 Jan 2007 07:55:23 -0000 1.32 @@ -180,6 +180,8 @@ if {$page ne ""} { return [my call $page $method] } 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 @@ -414,7 +416,9 @@ } else { set localvar local.$_var upvar $_var $localvar - if {[info exists $localvar]} { + if {[array exists $localvar]} { + lappend __vars &$_var $localvar + } elseif {[info exists $localvar]} { # ignore undefined variables lappend __vars $_var [set $localvar] } @@ -428,9 +432,9 @@ upvar #$level $f $f } } - my log "--before adp" ;#$__vars + #my log "--before adp" ; # $__vars set text [template::adp_include $adp $__vars] - my log "--after adp" + #my log "--after adp" return $text } @@ -469,8 +473,9 @@ Package instproc edit-new {} { my instvar folder_id id set object_type [my query_parameter object_type "::xowiki::Page"] + set autoname [my query_parameter autoname 0] set page [$object_type new -volatile -parent_id $folder_id -package_id $id] - return [$page edit -new true] + return [$page edit -new true -autoname $autoname] } Package instproc delete {-item_id -name} { 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.27 -r1.28 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 1 Jan 2007 16:41:24 -0000 1.27 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 29 Jan 2007 07:55:23 -0000 1.28 @@ -47,14 +47,18 @@ {with_categories true} {submit_link "view"} {folderspec ""} + {autoname 0} } WikiForm instproc mkFields {} { - my instvar data + my instvar data autoname set __fields "" set field_list [my field_list] if {[::xo::db::has_ltree]} {set field_list [linsert $field_list 2 page_order]} + if {$autoname} { + my f.name {name:text(hidden),optional} + } foreach __field $field_list { set __spec [my set f.$__field] if {[string first "richtext" [lindex $__spec 0]] > -1} { @@ -168,7 +172,10 @@ if {![regexp {^..:} $name]} { if {![info exists nls_language]} {set nls_language ""} if {$nls_language eq ""} {set nls_language [lang::conn::locale]} - set name [string range $nls_language 0 1]:$name + if {$name ne ""} { + # prepend the language prefix only, if the entry is not empty + set name [string range $nls_language 0 1]:$name + } } set name [::$package_id normalize_name $name] } Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.32 -r1.33 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 27 Jan 2007 17:29:57 -0000 1.32 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 29 Jan 2007 07:55:23 -0000 1.33 @@ -1,5 +1,5 @@ ad_library { - XoWiki - www procs. These procs are the methods called on xowiki objects via + XoWiki - www procs. These procs are the methods called on xowiki pages via the web interface. @creation-date 2006-04-10 @@ -33,13 +33,7 @@ if {[$package_id get_parameter with_views_package_if_available 1] && [apm_package_installed_p "views"]} { views::record_view -object_id $item_id -viewer_id [::xo::cc user_id] - array set views_arr [views::get -object_id $item_id] - if {$views_arr(views) ne ""} { - set views $views_arr(views) - set unique_views $views_arr(unique_views) - set last_viewed $views_arr(last_viewed) - } - views unique_views last_viewed + array set views_data [views::get -object_id $item_id] } #my log "--after user_tracking" @@ -219,14 +213,15 @@ digg_link delicious_link my_yahoo_link gc_link gc_comments notification_subscribe_link notification_image top_portlets page + views_data } } } else { ns_return 200 text/html $content } } - Page instproc edit {{-new:boolean false}} { + Page instproc edit {{-new:boolean false} {-autoname:boolean false}} { my instvar package_id item_id revision_id $package_id instvar folder_id ;# this is the root folder @@ -282,7 +277,8 @@ -action [export_vars -base [$package_id url] $action_vars] \ -data [self] \ -folderspec [expr {$fs_folder_id ne "" ?"folder_id $fs_folder_id":""}] \ - -submit_link $submit_link + -submit_link $submit_link \ + -autoname $autoname if {[info exists return_url]} { ::xowiki::f1 generate -export [list [list return_url $return_url]]