Index: openacs-4/packages/acs-subsite/www/permissions/grant.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/grant.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/permissions/grant.adp 7 Oct 2003 16:55:37 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/permissions/grant.adp 12 Oct 2003 19:43:37 -0000 1.4 @@ -6,32 +6,15 @@ + - + Index: openacs-4/packages/acs-subsite/www/permissions/grant.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/grant.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-subsite/www/permissions/grant.tcl 10 Oct 2003 08:20:42 -0000 1.8 +++ openacs-4/packages/acs-subsite/www/permissions/grant.tcl 12 Oct 2003 19:43:37 -0000 1.9 @@ -98,39 +98,15 @@ incr maxlevel -# Now the $hierarchy datastructure is ready, use it to build the -# multirow that will be used for display. -multirow create mu_privileges privilege level inverted_level selected id standard_priv_p +# The $hierarchy datastructure is ready, fill a select widget options list with it. -foreach elm $hierarchy { - foreach { level privilege } $elm {} +foreach element $hierarchy { + set privilege [lindex $element 1] + set level [lindex $element 0] - # Preserve checked value of the privilege checkboxes for - # re-submitted form status. - if { [info exists privileges] && [lsearch $privileges $privilege]>-1 } { - set selected "CHECKED" - } else { - set selected "" - } - - # set standard_priv_p to emphasize standard privileges in the - # layout - if { [lsearch {admin create write delete read} $privilege] > -1 } { - set standard_priv_p 1 - } else { - set standard_priv_p 0 - } - - multirow append mu_privileges $privilege [expr $level+1] [expr $maxlevel - $level] $selected $privilege $standard_priv_p + lappend select_list [list "[string repeat "   " $level] $privilege" $privilege] } -# build an html tr line manually to layout the table -set first_tr "" -for { set i 0 } { $i < $maxlevel } { incr i } { - append first_tr "" -} -append first_tr "" - form create grant element create grant object_id \ @@ -147,7 +123,28 @@ -datatype party_search \ -optional +if { ![info exists privileges] } { + set privileges [list] +} +# limit the size of the select widget to a number that should fit on a +# 1024x768 screen +if { [llength $select_list] > 23 } { + set size 23 +} else { + set size [llength $select_list] +} + +element create grant privilege \ + -widget multiselect \ + -datatype text \ + -optional \ + -html [list size $size] \ + -options $select_list \ + -value $privileges + + + if { [form is_valid grant] } { # A valid submission, grant and revoke accordingly.
Grant:   - - - @first_tr;noquote@ - - - - - - -
    - - - - - - - -
- +