Index: openacs-4/packages/xowiki/tcl/folder-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/folder-procs.tcl,v diff -u -r1.55.2.26 -r1.55.2.27 --- openacs-4/packages/xowiki/tcl/folder-procs.tcl 21 Sep 2019 19:03:21 -0000 1.55.2.26 +++ openacs-4/packages/xowiki/tcl/folder-procs.tcl 1 Oct 2019 19:54:08 -0000 1.55.2.27 @@ -33,11 +33,11 @@ }} {id "[xowiki::Includelet js_name [self]]"} } -ad_doc { - + List the folder tree of the current instance @param show_full_tree (default false) - @param context_tree_view (default false) + @param context_tree_view (default false) } @@ -519,7 +519,7 @@ } } } -ad_doc { - + Include the content of the current folder somewhat similar to explorer. @param show_types types of the pages to be included Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.284.2.28 -r1.284.2.29 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 17 Sep 2019 11:36:38 -0000 1.284.2.28 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 1 Oct 2019 19:54:08 -0000 1.284.2.29 @@ -1110,7 +1110,9 @@ # # Get the file object of the imported file to obtain is full name and path # - set file_id [::$package_id lookup -parent_id [${:object} item_id] -name [dict get $entry_info name]] + set file_id [::$package_id lookup \ + -parent_id [${:object} item_id] \ + -name [dict get $entry_info name]] ::xo::db::CrClass get_instance_from_db -item_id $file_id set full_file_name [::$file_id full_file_name] # @@ -1125,8 +1127,11 @@ # lead to maybe unexpected deletions of the form-page # if {[:cleanup]} { - set return_url [::$package_id query_parameter "return_url" [::$parent_id pretty_link]] - ::$package_id returnredirect [${:object} pretty_link -query [export_vars {m delete} return_url]] + set return_url [::$package_id query_parameter \ + "return_url:localurl" \ + [::$parent_id pretty_link]] + ::$package_id returnredirect [${:object} pretty_link \ + -query [export_vars {m delete} return_url]] } } } Index: openacs-4/packages/xowiki/tcl/includelet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/includelet-procs.tcl,v diff -u -r1.239.2.22 -r1.239.2.23 --- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 29 Sep 2019 17:27:53 -0000 1.239.2.22 +++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 1 Oct 2019 19:54:08 -0000 1.239.2.23 @@ -1605,7 +1605,7 @@ set notification_type [notification::type::get_type_id -short_name xowiki_notif] } if {[::$package_id exists_query_parameter return_url]} { - set return_url [::$package_id query_parameter return_url] + set return_url [::$package_id query_parameter return_url:localurl] } foreach cat_id [category::get_mapped_categories [${:__including_page} set item_id]] { lassign [category::get_data $cat_id] category_id category_name tree_id tree_name @@ -1888,7 +1888,7 @@ set entries_with_unresolved_items {} foreach tuple $unresolved_references { lassign $tuple page name - + set pageObject [::xo::db::CrClass get_instance_from_db -item_id $page] # @@ -1897,7 +1897,7 @@ if {[$page info class] eq "::xowiki::Object"} { continue } - + lappend entries_with_unresolved_items "[ns_quotehtml [$page name]] contains unresolved reference: $name" } if {[llength $entries_with_unresolved_items] > 0} { @@ -4522,7 +4522,7 @@ } } - set given_includelet_key [::xo::cc query_parameter includelet_key ""] + set given_includelet_key [::xo::cc query_parameter includelet_key:graph ""] if {$given_includelet_key ne ""} { if {$given_includelet_key eq $includelet_key && [info exists generate]} { if {$generate eq "csv"} { @@ -4562,7 +4562,13 @@ return $html } - form-usages instproc generate_voting_form {form_name form_form t1 field_names voting_form_anon_instances} { + form-usages instproc generate_voting_form { + form_name + form_form + t1 + field_names + voting_form_anon_instances + } { #:msg "generate_voting anon=$voting_form_anon_instances" set form "
How do you rate
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.332.2.35 -r1.332.2.36 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 19 Sep 2019 12:54:22 -0000 1.332.2.35 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 1 Oct 2019 19:54:08 -0000 1.332.2.36 @@ -591,7 +591,8 @@ {-check_query_parameter true} {-nocache:switch} {-type ""} - attribute {default ""} + attribute + {default ""} } { resolves configurable parameters according to the following precedence: (1) values specifically set per page {{set-parameter ...}} @@ -604,7 +605,9 @@ } else { set value [::xo::cc get_parameter $attribute] } - if {$check_query_parameter && $value eq ""} {set value [string trim [:query_parameter $attribute]]} + if {$check_query_parameter && $value eq ""} { + set value [string trim [:query_parameter $attribute]] + } if {$value eq "" && $attribute ne "parameter_page"} { # # Try to get the parameter from the parameter_page. We have to @@ -734,7 +737,10 @@ # # The method returns either the page object or empty (""). # - return [:get_page_from_item_ref -allow_cross_package_item_refs true -default_lang $default_lang $page_name] + return [:get_page_from_item_ref \ + -allow_cross_package_item_refs true \ + -default_lang $default_lang \ + $page_name] #array set "" [:get_package_id_from_page_name $page_name] } @@ -985,7 +991,7 @@ # set deref [[self class] exists delegate_link_to_target($method)] if {[:exists_query_parameter deref]} { - set deref [:query_parameter deref] + set deref [:query_parameter deref:boolean] } #:log "invoke on LINK <$method> default deref $deref" @@ -1055,7 +1061,7 @@ set title Error set header_stuff [::xo::Page header_stuff] set index_link [:make_link -privilege public -link "" ${:id} {} {}] - set link [:query_parameter "return_url" ""] + set link [:query_parameter "return_url:localurl" ""] if {$link ne ""} {set back_link $link} if {[util::external_url_p $link]} { ns_log warning "return_url is apparently an external URL: $link" @@ -1072,7 +1078,7 @@ } Package instproc get_page_from_item_or_revision_id {item_id} { - set revision_id [:query_parameter revision_id 0] + set revision_id [:query_parameter revision_id:integer 0] if {![string is integer -strict $revision_id]} { ad_return_complaint 1 "invalid revision_id" ad_script_abort @@ -1796,18 +1802,8 @@ # todo: missing: tag links to subdirectories, also on url generation set tag $stripped_url :validate_tag $tag - set summary [::xo::cc query_parameter summary 0] - set popular [::xo::cc query_parameter popular 0] - if {$summary eq ""} {set summary 0} - if {$popular eq ""} {set popular 0} - if {![string is boolean -strict $summary]} { - ad_return_complaint 1 "value of 'summary' must be boolean" - ad_script_abort - } - if {![string is boolean -strict $popular]} { - ad_return_complaint 1 "value of 'popular' must be boolean" - ad_script_abort - } + set summary [::xo::cc query_parameter summary:boolean 0] + set popular [::xo::cc query_parameter popular:boolean 0] set tag_kind [expr {$popular ? "ptag" :"tag"}] set weblog_page [:get_parameter weblog_page] :get_lang_and_name -default_lang $default_lang -name $weblog_page (lang) local_name @@ -2481,9 +2477,9 @@ Finally, it calls "www-edit" for the freshly created page. } { - set object_type [:query_parameter object_type "::xowiki::Page"] + set object_type [:query_parameter object_type:graph "::xowiki::Page"] set autoname [:get_parameter autoname 0] - set parent_id [${:id} query_parameter parent_id ""] + set parent_id [${:id} query_parameter parent_id:integer ""] if {$parent_id eq ""} {set parent_id [${:id} form_parameter folder_id ${:folder_id}]} if {![string is integer -strict $parent_id]} { ad_return_complaint 1 "invalid parent_id" @@ -2502,7 +2498,7 @@ $page set page_template [:form_parameter page_template] } - set source_item_id [${:id} query_parameter source_item_id ""] + set source_item_id [${:id} query_parameter source_item_id:integer ""] if {$source_item_id ne ""} { if {![string is integer -strict $source_item_id]} { ad_return_complaint 1 "invalid source_item_id" @@ -2532,18 +2528,15 @@ to be provided as a query parameter. } { - set object_id [:query_parameter object_id] - if {![string is integer -strict $object_id]} { - ad_return_complaint 1 "invalid object_id" - ad_script_abort - } + set object_id [:query_parameter object_id:integer] # flush could be made more precise in the future :flush_page_fragment_cache -scope agg - set href [export_vars -base [site_node::get_package_url -package_key categories]cadmin/object-map { - {ctx_id $object_id} {object_id} - }] + set href [export_vars \ + -base [site_node::get_package_url -package_key categories]cadmin/object-map { + {ctx_id $object_id} {object_id} + }] :returnredirect $href } @@ -2558,16 +2551,8 @@ "tree_id" have to be provided as a query parameter. } { - set object_id [:query_parameter object_id] - if {![string is integer -strict $object_id]} { - ad_return_complaint 1 "invalid object_id" - ad_script_abort - } - set tree_id [:query_parameter tree_id] - if {![string is integer -strict $tree_id]} { - ad_return_complaint 1 "invalid tree_id" - ad_script_abort - } + set object_id [:query_parameter object_id:integer] + set tree_id [:query_parameter tree_id:integer] # flush could be made more precise in the future :flush_page_fragment_cache -scope agg @@ -2628,11 +2613,7 @@ #:log "--D delete [self args]" if {![info exists item_id]} { - set item_id [:query_parameter item_id] - if {![string is integer $item_id]} { - ad_return_complaint 1 "invalid item_id" - ad_script_abort - } + set item_id [:query_parameter item_id:integer] #:log "--D item_id from query parameter $item_id" } # @@ -2643,13 +2624,13 @@ } if {$item_id eq ""} { - array set "" [:item_info_from_url -with_package_prefix false $name] - if {$(item_id) == 0} { + set item_info [:item_info_from_url -with_package_prefix false $name] + if {[dict get $item_info item_id] == 0} { :log "www-delete: url lookup of '$name' failed" } else { - set parent_id $(parent_id) - set item_id $(item_id) - set name $(name) + set parent_id [dict get $item_info parent_id] + set item_id [dict get $item_info item_id] + set name [dict get $item_info name] } } else { set name [::xo::db::CrClass get_name -item_id $item_id] @@ -2820,7 +2801,7 @@ # Package instproc condition=has_class {query_context value} { - return [expr {[$query_context query_parameter object_type ""] eq $value}] + return [expr {[$query_context query_parameter object_type:graph ""] eq $value}] } Package instproc condition=has_name {query_context value} { return [regexp $value [$query_context query_parameter name ""]] Index: openacs-4/packages/xowiki/tcl/weblog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/weblog-procs.tcl,v diff -u -r1.75.2.12 -r1.75.2.13 --- openacs-4/packages/xowiki/tcl/weblog-procs.tcl 23 Jul 2019 14:15:00 -0000 1.75.2.12 +++ openacs-4/packages/xowiki/tcl/weblog-procs.tcl 1 Oct 2019 19:54:08 -0000 1.75.2.13 @@ -1,6 +1,6 @@ namespace eval ::xowiki { # - # ::xowiki::Weblog + # ::xowiki::Weblog # Class create ::xowiki::Weblog -parameter { @@ -13,10 +13,10 @@ ptag category_id {entries_of ""} - {locale ""} + {locale:graph ""} filter_msg {sort_composite ""} - {no_footer false} + {no_footer:boolean false} {name_filter ""} {entry_label "Postings"} {exclude_item_ids:integer,0..n 0} @@ -28,9 +28,9 @@ } ::xowiki::Weblog proc instantiate_forms { - {-default_lang ""} - {-parent_id ""} - -forms:required + {-default_lang ""} + {-parent_id ""} + -forms:required -package_id:required } { set form_item_ids [list] @@ -58,13 +58,13 @@ } ::xowiki::Weblog instproc init {} { - + #:log "--W starting" set folder_id [::${:package_id} folder_id] set :filter_msg "" set query_parm "" set query [expr {[ns_conn isconnected] ? [ns_conn query] : ""}] - + # set up filters set extra_from_clause "" set extra_where_clause "" @@ -112,7 +112,7 @@ set tag ${:tag} append extra_from_clause " join xowiki_tags tags on (tags.item_id = bt.item_id) " append extra_where_clause "and tags.tag = :tag and \ - tags.user_id = [::xo::cc user_id]" + tags.user_id = [::xo::cc user_id]" set query_parm "&tag=[ad_urlencode ${:tag}]" } #:msg "ptag=${:ptag}" @@ -121,11 +121,11 @@ set :filter_msg "Filtered by popular tag ${:ptag}" set ptag ${:ptag} append extra_from_clause " join xowiki_tags tags on (tags.item_id = bt.item_id) " - append extra_where_clause "and tags.tag = :ptag " + append extra_where_clause "and tags.tag = :ptag " set query_parm "&ptag=[ad_urlencode ${:ptag}]" set query [::xo::update_query $query ptag ${:ptag}] } - #:msg filter_msg=${:filter_msg} + #:msg filter_msg=${:filter_msg} if {${:name_filter} ne ""} { append extra_where_clause "and ci.name ~ E'${:name_filter}' " } @@ -134,7 +134,7 @@ set attributes [list bt.revision_id bt.publish_date bt.title bt.creator bt.creation_user \ ci.parent_id bt.description s.body \ pi.instance_attributes pi.page_template fp.state] - + set class_clause \ " and ci.content_type not in ('::xowiki::PageTemplate','::xowiki::Object')" @@ -167,11 +167,14 @@ if {${:locale} ne ""} { #set :locale "default+system" - lassign [::xowiki::Includelet locale_clause -revisions bt -items ci ${:package_id} ${:locale}] :locale locale_clause + lassign [::xowiki::Includelet locale_clause \ + -revisions bt \ + -items ci ${:package_id} ${:locale}] \ + :locale locale_clause #:msg "--L locale_clause=$locale_clause" append extra_where_clause $locale_clause } - + # create an item container, which delegates rendering to its children set :items [::xo::OrderedComposite new -proc render {} { set content "" @@ -198,7 +201,7 @@ $class_clause \ and ci.publish_status <> 'production' \ $extra_where_clause"] - + if {${:page_number} ne ""} { lappend sqlParams -page_number ${:page_number} -page_size ${:page_size} } @@ -223,16 +226,16 @@ left outer join xowiki_form_page fp on (bt.revision_id = fp.xowiki_form_page_id) \ $extra_from_clause" \ {*}$sqlParams]] - + foreach c [$s children] { $c instvar revision_id publish_date title name item_id creator creation_user \ parent_id description body instance_attributes - + set time [::xo::db::tcl_date $publish_date tz] set pretty_date [util::age_pretty -timestamp_ansi $time \ -sysdate_ansi [clock_to_ansi [clock seconds]] \ -mode_3_fmt "%d %b %Y, at %X"] - + if {${:summary}} { # we need always: package_id item_id parent_id name title creator creation_user pretty_date set p [Page new \ @@ -272,28 +275,28 @@ ${:items} add $p } array set smsg {1 full 0 summary} - + set summary_href [::xo::cc url]?[::xo::update_query $query summary [expr {!${:summary}}]] #set flink "[ns_quotehtml $smsg(${:summary})]" set flink "[ns_quotehtml $smsg([string is true ${:summary}])]" - + if {${:page_number} ne ""} { - set nr [llength [${:items} children]] + set nr [llength [${:items} children]] set from [expr {(${:page_number} - 1) * ${:page_size} + 1}] set to [expr {(${:page_number} - 1) * ${:page_size} + $nr}] set range [expr {$nr > 1 ? "$from - $to" : $from}] - + if {${:filter_msg} ne ""} { set package ::${:package_id} set all_href [$package package_url][$package get_parameter weblog_page weblog-portlet] append :filter_msg ", $range of ${:nr_items} ${:entry_label} (all, $flink)" } else { append :filter_msg "Showing $range of ${:nr_items} ${:entry_label} ($flink)" } - + set next_p [expr {${:nr_items} > ${:page_number} * ${:page_size}}] set prev_p [expr {${:page_number} > 1}] - + if {$next_p} { set query [::xo::update_query $query page_number [expr {${:page_number} + 1}]] set :next_page_link [::xo::cc url]?$query @@ -303,7 +306,7 @@ } } #:proc destroy {} {:log "--W"; next} - + if {${:sort_composite} ne ""} { lassign [split ${:sort_composite} ,] kind att direction if {$kind eq "method"} {${:items} mixin add ::xo::OrderedComposite::MethodCompare} @@ -326,15 +329,15 @@ #:log "--W end" return $content } - + # default layout for weblog entries Class create ::xowiki::Weblog::EntryRenderer -instproc render {{-with_footer false}} { ${:__parent} instvar weblog_obj set link [:pretty_link] regsub -all & $link "&" link - set more [expr {[$weblog_obj summary] ? + set more [expr {[$weblog_obj summary] ? " \[#xowiki.weblog-more#\]" : ""}] #append more "

" @@ -353,10 +356,10 @@ set filter "" set prev "" set next "" - + if {[info exists :filter_msg]} { set filter "
${:filter_msg}
" - } + } if {[info exists :prev_page_link]} { set prev "\