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.41 -r1.42 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 1 Nov 2001 15:42:41 -0000 1.41 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 1 Nov 2001 23:09:40 -0000 1.42 @@ -48,15 +48,15 @@ @author Arjun Sanyal (arjun@openforce.net) @creation-date 10/30/2001 } { - ad_require_permission $portal_id portal_admin_portal +# ad_require_permission $portal_id portal_admin_portal set new_p_ds_id [db_nextval acs_object_id_seq] db_dml insert_into_portal_datasource_avail_map " insert into portal_datasource_avail_map (portal_datasource_id, portal_id, datasource_id) values - (:new_element_id, :portal_id, :ds_id)" + (:new_p_ds_id, :portal_id, :ds_id)" } ad_proc -public make_datasource_unavailable {portal_id ds_id} { @@ -68,12 +68,12 @@ @creation-date 10/30/2001 } { - ad_require_permission $portal_id portal_admin_portal +# ad_require_permission $portal_id portal_admin_portal db_dml delete_from_portal_datasource_avail_map " delete from portal_datasource_avail_map where portal_id = :portal_id - and datasource_id = :datasource_id" + and datasource_id = :ds_id" } ad_proc -public toggle_datasource_availability {portal_id ds_id} { @@ -491,35 +491,37 @@ set element_list [array get fake_element_ids] set element_src "[portal::www_path]/place-element" - + # the sources /www/place-element.tcl set template "
- Change Name: + Change Your Portal's Name:

-

-

- + + + Configure The Portal's Elements:

<%= [export_form_vars portal_id] %> +
+ +
-
+ Undo Your Changes:
<%= [export_form_vars portal_id ] %>
-
" # @@ -611,7 +613,7 @@ portal::swap_element \ $portal_id $element_id $sort_key $region $direction } - "move all checked elements here" { + "move all checked here" { set element_id_list [list] @@ -628,10 +630,28 @@ } } "add a new element here" { + + ad_return_complaint 1 "Not implimented yet: op = $op, target_region = $target_region" } - "remove all checked elements" { - ad_return_complaint 1 "Not implimented yet: op = $op, target_region = $target_region" + "remove all checked" { + + 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] } { + + foreach element_id $element_id_list { + # XXX fixme + remove_element $element_id + } + } else { + ns_returnredirect "portal-config.tcl?[export_url_vars portal_id]" + } } "revert to default" { ad_return_complaint 1 "Not implimented yet: op = $op, target_region = $target_region" @@ -673,30 +693,30 @@ set element_list [array get element_ids] if { [empty_string_p $element_list] } { - ad_return_complaint 1 \ - "This portal has no elements. - You might want to edit it." - ad_script_abort - } - set element_src "[www_path]/render-element" + # The portal has no elements, show anyway (they can configure) + set template " + @portal.name@" + } else { + set element_src "[www_path]/render-element" - set template " -@portal.name@ -" + set template " + @portal.name@ + " + } + + db_0or1row select_portal_and_layout " + select + p.portal_id, + p.name, + p.owner_id, + t.filename as layout_template, + 't' as portal_read_p, + 't' as layout_read_p + from portals p, portal_layouts t + where p.layout_id = t.layout_id + and p.portal_id = :portal_id" -column_array portal - db_0or1row select_portal_and_layout " - select - p.portal_id, - p.name, - p.owner_id, - t.filename as layout_template, - 't' as portal_read_p, - 't' as layout_read_p - from portals p, portal_layouts t - where p.layout_id = t.layout_id - and p.portal_id = :portal_id" -column_array portal - if { ! [exists_p $portal_id] } { ad_return_complaint 1 "That portal (portal_id $portal_id) doesn't exist in this instance. Perhaps it's been deleted?" ad_script_abort