Index: openacs-4/packages/new-portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.tcl,v diff -u -r1.34 -r1.35 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 25 Oct 2001 02:29:59 -0000 1.34 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 25 Oct 2001 16:09:55 -0000 1.35 @@ -422,7 +422,8 @@
-
@@ -489,21 +490,26 @@ return $output } -ad_proc -public configure_dispatch { portal_id op query } { +ad_proc -public configure_dispatch { portal_id query } { Dispatches the configuration operation. - This is ugly to make your page pretty. + We get the target region number from the op. @author Arjun Sanyal (arjun@openforce.net) @creation-date 9/28/2001 -} { +nope} { ad_require_permission $portal_id portal_read_portal ad_require_permission $portal_id portal_edit_portal - # remove the op and the portal_id from the query + # remove the portal_id from the query set query [string tolower $query] regsub {[&]*portal_id=\d+} $query "" query - regsub {[&]*op=\w+} $query "" query + # get then remove the op including an optional target_region + regexp {[&]*op([\d])?=([\w\+]+)} $query whole_op target_region op + regsub {[&]*op[\d]?=[\w\+]+} $query "" query + + # replace the "+"'s with spaces + regsub -all {\+} $op " " op set op [string tolower $op] switch $op { @@ -516,13 +522,18 @@ regexp {[&]*sort_key=(\d+)} $query "" sort_key regexp {[&]*region=(\d+)} $query "" region regexp {[&]*direction=(\w+)} $query "" direction - - ns_log notice "aks95 $portal_id $element_id $sort_key $region $direction" - portal::swap_element $portal_id $element_id $sort_key $region $direction + portal::swap_element \ + $portal_id $element_id $sort_key $region $direction } - "move" { - set region [lindex $args 0] + "move all checked elements here" { + set element_id_list [list] + + while {[regexp {[&]*element_ids=(\d+)} $query "" element_id]} { + lappend element_id_list $element_id + regsub {[&]*element_ids=\d+} $query "" query + } + if {! [empty_string_p $element_id_list] } { portal::move_elements $portal_id $element_id_list $region } else { @@ -540,7 +551,7 @@ default { ns_log Warning \ "portal::config_dispatch: op = $op, and that's not right!" - ad_return_complaint 1 "portal::config_dispatch: bad op = $op" + ad_return_complaint 1 "portal::config_dispatch: Bad Op! \n whole_op = $whole_op, tr = $target_region, op $op" } } }