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.33 -r1.34
--- openacs-4/packages/new-portal/tcl/portal-procs.tcl 24 Oct 2001 18:51:31 -0000 1.33
+++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 25 Oct 2001 02:29:59 -0000 1.34
@@ -65,8 +65,30 @@
}]
}
+ad_proc -public get_name { portal_id } {
+ Get the name of this portal
+
+ @param portal_id
+ @return the name of the portal or null
+ @author Arjun Sanyal (arjun@openforce.net)
+ @creation-date 9/28/2001
+} {
+ # check permissions
+ ad_require_permission $portal_id portal_read_portal
+
+ if {[portal::exists_p $portal_id]} {
+ db_1row get_name \
+ "select name from portals where portal_id = :portal_id"
+ } else {
+ set name ""
+ }
+
+ return $name
+}
+
ad_proc -public update_name { portal_id new_name } {
- Update the name of this portal
+ Update the name of this
+ portal
@param portal_id
@param new_name
@@ -78,8 +100,7 @@
ad_require_permission $portal_id portal_read_portal
ad_require_permission $portal_id portal_edit_portal
- # remove permissions (this sucks - ben)
- db_dml remove_permissions "update portals set name = :new_name where portal_id = :portal_id"
+ db_dml update_name "update portals set name = :new_name where portal_id = :portal_id"
}
@@ -216,7 +237,7 @@
}
} else {
ad_return_complaint 1 \
- "portal::move_element: Bad direction: $direction"
+ "portal::swap_element: Bad direction: $direction"
ad_script_abort
}
@@ -325,11 +346,212 @@
}
+ad_proc -public configure { portal_id } {
+ Return a portal configuration page. All form targets point to
+ file_stub-2.
+
+ @return A portal configuration page
+
+ @author Arjun Sanyal (arjun@openforce.net)
+ @creation-date 9/28/2001
+} {
+ ad_require_permission $portal_id portal_read_portal
+ ad_require_permission $portal_id portal_edit_portal
+
+ # Set up some template vars
+ set master_template [ad_parameter master_template]
+
+ # Set up the form target
+ set target_stub [lindex [ns_conn urlv] [expr [ns_conn urlc] - 1]]
+
+ # AKS XXX layout change
+ # get the layouts
+ set layout_count 0
+ template::multirow create layouts layout_id name \
+ description filename resource_dir checked
+
+ db_foreach get_layouts "
+ select
+ layout_id,
+ name,
+ description,
+ filename,
+ resource_dir,
+ ' ' as checked
+ from portal_layouts
+ order by name " {
+ set resource_dir "$resource_dir"
+ template::multirow append layouts $layout_id $name \
+ $description $filename $resource_dir $checked
+ incr layout_count
+ }
+
+ # get the portal.
+ db_1row select_portal "
+ select
+ p.portal_id,
+ p.name,
+ t.filename as template,
+ t.layout_id
+ from portals p, portal_layouts t
+ where p.layout_id = t.layout_id and p.portal_id = :portal_id
+ " -column_array portal
+
+ # fake some elements so that the
+
+ in the template has
+ # something to do.
+ foreach region [ portal::get_regions $portal(layout_id) ] {
+ # pass the portal_id along here instead of the element_id.
+ lappend fake_element_ids($region) $portal_id
+ }
+
+ set element_list [array get fake_element_ids]
+ set element_src "[portal::www_path]/place-element"
+
+
+ set template "
+