- Go back + $return_text
" + if {$element_count == 0} { append template " -
$portal(page_name) has no Elements" + $page_name_chunk + No Elements +
" } else { append template " - $portal(page_name) Page
- "
@@ -514,9 +545,17 @@
@param formdata an ns_set with all the formdata
} {
- ad_require_permission $portal_id portal_read_portal
- ad_require_permission $portal_id portal_edit_portal
+ set edit_p \
+ [permission::permission_p \
+ -object_id $portal_id \
+ -privilege portal_edit_portal
+ ]
+ if {!$edit_p} {
+ ad_require_permission $portal_id portal_admin_portal
+ set edit_p 1
+ }
+
set op [ns_set get $form op]
switch $op {
@@ -603,6 +642,20 @@
}
page_create -pretty_name $pretty_name -portal_id $portal_id
}
+ "Remove Empty Page" {
+ set page_id [ns_set get $form page_id]
+ page_delete -page_id $page_id
+ }
+ "Rename Page" {
+ set pretty_name [ns_set get $form pretty_name]
+ set page_id [ns_set get $form page_id]
+
+ if {[empty_string_p $pretty_name]} {
+ ad_return_complaint 1 "You must enter new name for the page."
+ }
+ set_page_pretty_name \
+ -pretty_name $pretty_name -page_id $page_id
+ }
"toggle_pinned" {
set element_id [ns_set get $form element_id]
@@ -670,19 +723,11 @@
portal_id
return_url
} {
- Just a wrapper for the configure proc
+ Just a wrapper for the configure proc.
@param portal_id
@return A portal configuration page
} {
- if { ! [template_p $portal_id] } {
- ns_log error "portal::template_configure called with portal_id
- $portal_id!"
- ad_return_complaint 1 "There is an error in our code.
- Please inform your system administrator of the following error:
- portal::template_configure called with portal_id $portal_id"
- }
-
portal::configure -template_p "t" $portal_id $return_url
}
@@ -719,7 +764,7 @@
if {![empty_string_p $page_name]} {
return [db_string get_page_id_from_name {} -default ""]
} else {
- return [db_string get_page_id_select {}]
+ return [db_string get_page_id_select {}]
}
}
@@ -742,6 +787,23 @@
return [db_string get_page_pretty_name_select {}]
}
+ ad_proc -public set_page_pretty_name {
+ {-page_id:required}
+ {-pretty_name:required}
+ } {
+ Updates the pn
+ } {
+ return [db_dml set_page_pretty_name_update {}]
+ }
+
+ ad_proc -public page_delete {
+ {-page_id:required}
+ } {
+ deletes the page
+ } {
+ return [db_dml page_delete {}]
+ }
+
ad_proc -public page_create {
{-layout_name ""}
{-pretty_name:required}
@@ -835,6 +897,8 @@
@param page_num the number of the portal page to add to, def 0
@param ds_name
} {
+ ns_log notice "aks6: portal_id $portal_id"
+
if {[empty_string_p $pretty_name]} {
set pretty_name $ds_name
}
@@ -939,12 +1003,15 @@
# so, copy stuff. If not, just insert normally.
if { [db_0or1row get_template_info_select {}] == 1 } {
- db_transaction {
set new_element_id [db_nextval acs_object_id_seq]
db_1row get_target_page_id {}
+
+ set bar [db_string foobar { select name from portal_element_map pem where pem.page_id = :target_page_id and pem.sort_key = :template_element_sk and pem.region = 1} -default NONE ]
+
+ ns_log notice "aks5 $template_page_sort_key / $template_element_region / $template_element_name / $template_element_sk / $bar"
+
db_dml template_insert {}
db_dml template_params_insert {}
- }
} else {
# no template, or the template dosen't have this DS,
Index: openacs-4/packages/new-portal/tcl/portal-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.xql,v
diff -u -r1.24 -r1.25
--- openacs-4/packages/new-portal/tcl/portal-procs.xql 11 Apr 2002 20:14:43 -0000 1.24
+++ openacs-4/packages/new-portal/tcl/portal-procs.xql 16 Apr 2002 13:55:44 -0000 1.25
@@ -199,14 +199,27 @@