Index: openacs-4/packages/xowiki/tcl/bootstrap-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/bootstrap-procs.tcl,v diff -u -N -r1.3 -r1.3.2.1 --- openacs-4/packages/xowiki/tcl/bootstrap-procs.tcl 27 Apr 2015 15:28:22 -0000 1.3 +++ openacs-4/packages/xowiki/tcl/bootstrap-procs.tcl 9 Feb 2016 11:06:34 -0000 1.3.2.1 @@ -199,6 +199,30 @@ } } + BootstrapTableRenderer instproc render-bulkactions {} { + set bulkactions [[self]::__bulkactions children] + html::div -class "btn-group" -role group -aria-label "Bulk actions" { + html::t "Bulk-Actions:" + set bulkaction_container [[lindex $bulkactions 0] set __parent] + set name [$bulkaction_container set __identifier] + + foreach ba $bulkactions { + html::ul -class compact { + html::li { + # For some reason, btn-secondary seems not to be available + # for the "a" tag, so we set the border-color manually. + html::a -class "btn btn-secondary" -rule button \ + -title [$ba tooltip] -href # \ + -style "border-color: #ccc;" \ + -onclick "acs_ListBulkActionClick('$name','[$ba url]'); return false;" { + html::t [$ba label] + } + } + } + } + } + } + BootstrapTableRenderer instproc render {} { ::xo::Page requireCSS "//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" if {![my isobject [self]::__actions]} {my actions {}} 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 -N -r1.33.2.2 -r1.33.2.3 --- openacs-4/packages/xowiki/tcl/folder-procs.tcl 31 Oct 2015 14:29:59 -0000 1.33.2.2 +++ openacs-4/packages/xowiki/tcl/folder-procs.tcl 9 Feb 2016 11:06:34 -0000 1.33.2.3 @@ -534,36 +534,41 @@ # # We have to use the global variable for the time being due to # scoping in "-columns" - set ::with_publish_status [expr {$publish_status ne "ready"}] - + set ::__xowiki_with_publish_status [expr {$publish_status ne "ready"}] + set ::__xowiki_folder_link [$package_id make_link $current_folder bulk-delete] + switch [$package_id get_parameter PreferredCSSToolkit yui] { bootstrap {set tableWidgetClass ::xowiki::BootstrapTable} default {set tableWidgetClass ::xowiki::YUIDataTable} } + set t [$tableWidgetClass new -volatile -skin $skin \ -columns { - BulkAction objects -id ID -hide $::hidden(objects) -actions { - Action new -label select -tooltip select -url admin/select + BulkAction create objects -id ID -hide $::hidden(objects) -actions { + if {$::__xowiki_folder_link ne ""} { + Action bulk-delete -label Delete -tooltip "Delete selected" \ + -url $::__xowiki_folder_link + } } # The "-html" options are currenty ignored in the YUI # DataTable. Not sure, it can be integrated in the traditional way. # - HiddenField ID - AnchorField edit -CSSclass edit-item-button -label "" \ + HiddenField create ID + AnchorField create edit -CSSclass edit-item-button -label "" \ -hide $::hidden(edit) - if {$::with_publish_status} { - ImageAnchorField publish_status -orderby publish_status.src -src "" \ + if {$::__xowiki_with_publish_status} { + ImageAnchorField create publish_status -orderby publish_status.src -src "" \ -width 8 -height 8 -border 0 -title "Toggle Publish Status" \ -alt "publish status" -label [_ xowiki.publish_status] } - Field object_type -label [_ xowiki.page_kind] -orderby object_type -richtext false \ + Field create object_type -label [_ xowiki.page_kind] -orderby object_type -richtext false \ -hide $::hidden(object_type) - AnchorField name -label [_ xowiki.Page-name] -orderby name \ + AnchorField create name -label [_ xowiki.Page-name] -orderby name \ -hide $::hidden(name) - Field last_modified -label [_ xowiki.Page-last_modified] -orderby last_modified \ + Field create last_modified -label [_ xowiki.Page-last_modified] -orderby last_modified \ -hide $::hidden(last_modified) - Field mod_user -label [_ xowiki.By_user] -orderby mod_user -hide $::hidden(mod_user) - AnchorField delete -CSSclass delete-item-button \ + Field create mod_user -label [_ xowiki.By_user] -orderby mod_user -hide $::hidden(mod_user) + AnchorField create delete -CSSclass delete-item-button \ -hide $::hidden(delete) \ -label "" ;#-html {onClick "return(confirm('Confirm delete?'));"} @@ -623,7 +628,7 @@ -delete.href $delete_link \ -delete.title #xowiki.delete# - if {$::with_publish_status} { + if {$::__xowiki_with_publish_status} { # TODO: this should get some architectural support if {[$c set publish_status] eq "ready"} { set image active.png Index: openacs-4/packages/xowiki/tcl/menu-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/menu-procs.tcl,v diff -u -N -r1.8 -r1.8.2.1 --- openacs-4/packages/xowiki/tcl/menu-procs.tcl 27 Oct 2014 16:42:05 -0000 1.8 +++ openacs-4/packages/xowiki/tcl/menu-procs.tcl 9 Feb 2016 11:06:35 -0000 1.8.2.1 @@ -262,7 +262,7 @@ -parent_id $parent_id \ -nls_language $nls_language -return_url $return_url] } elseif {[dict exists $properties -object_type]} { - set link [$package_id make_link -with_entities 0 \ + set link [$package_id make_link \ $package_id edit-new \ [list object_type [dict get $properties -object_type]] \ parent_id return_url autoname template_file] 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 -N -r1.291.2.14 -r1.291.2.15 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 28 Jan 2016 12:38:58 -0000 1.291.2.14 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 9 Feb 2016 11:06:35 -0000 1.291.2.15 @@ -2304,7 +2304,7 @@ if {$item_id eq ""} { array set "" [my item_info_from_url -with_package_prefix false $name] if {$(item_id) == 0} { - ns_log notice "lookup of '$name' with parent_id $parent_id failed" + ns_log notice "url lookup of '$name' failed" } else { set parent_id $(parent_id) set item_id $(item_id) @@ -2513,6 +2513,7 @@ make-live-revision {{package_id write}} delete-revision {{package_id admin}} delete {{package_id admin}} + bulk-delete {{package_id admin}} save-tags login popular-tags login create-new {{parent_id create}} @@ -2572,6 +2573,7 @@ make-live-revision {{package_id write}} delete-revision swa delete swa + bulk-delete swa save-tags login popular-tags login create-new {{parent_id create}} @@ -2624,6 +2626,7 @@ save-attributes {{package_id write}} delete-revision swa delete swa + bulk-delete swa save-tags login popular-tags login create-new {{parent_id create}} @@ -2689,6 +2692,7 @@ make-live-revision {{item_id write}} delete-revision swa delete swa + bulk-delete swa save-tags login popular-tags login create-new {{parent_id create}} 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 -N -r1.327.2.10 -r1.327.2.11 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 23 Dec 2015 18:21:56 -0000 1.327.2.10 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 9 Feb 2016 11:06:35 -0000 1.327.2.11 @@ -14,7 +14,29 @@ # This block contains the externally callable methods. We use as # naming convention dashes as separators. # + # + # externally callable method: bulk-delete + # + Page instproc www-bulk-delete {} { + my instvar package_id + if {![my exists_form_parameter "objects"]} { + my msg "nothing to delete" + } + if {[my parent_id] == [$package_id folder_id]} { + # from root index page + set parent_id [my parent_id] + } else { + set parent_id [my item_id] + } + foreach page_name [my form_parameter objects] { + set item_id [::xo::db::CrClass lookup -name $page_name -parent_id $parent_id] + ns_log notice "bulk-delete: DELETE $page_name in folder [my name]-> $item_id" + $package_id www-delete -item_id $item_id + } + $package_id returnredirect . + } + # # externally callable method: clipboard-add #