-
+
-
+
Index: openacs-4/packages/new-portal/www/admin/portal-config.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/www/admin/portal-config.adp,v
diff -u -r1.6 -r1.6.2.1
--- openacs-4/packages/new-portal/www/admin/portal-config.adp 9 Aug 2002 20:56:30 -0000 1.6
+++ openacs-4/packages/new-portal/www/admin/portal-config.adp 17 Oct 2002 09:39:44 -0000 1.6.2.1
@@ -23,4 +23,12 @@
@referer@
@name@
+Manage Custom Portlets
+
@rendered_page@
+
+
+Custom Portlets - Note custom portlets for portal templates are very fragile right now. Only use this during system set up before any portlets have been created with this template. Better solution coming soon.
+
+
+
Index: openacs-4/packages/new-portal/www/admin/portal-config.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/www/admin/portal-config.tcl,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/new-portal/www/admin/portal-config.tcl 9 Aug 2002 20:56:30 -0000 1.9
+++ openacs-4/packages/new-portal/www/admin/portal-config.tcl 17 Oct 2002 09:39:44 -0000 1.9.2.1
@@ -23,14 +23,24 @@
@creation-date 10/20/2001
@cvs-id $Id$
} {
- {referer:notnull}
+ {referer:optional ""}
portal_id:naturalnum,notnull
}
+set page_url [ad_conn url]
set name ""
set rendered_page [portal::configure \
-referer $referer \
-template_p f \
$portal_id ""
]
set name [portal::get_name $portal_id]
+set return_url "$page_url?portal_id=$portal_id"
+
+
+
+
+
+
+
+
Index: openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl,v
diff -u -r1.13 -r1.13.2.1
--- openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 9 Aug 2002 18:39:33 -0000 1.13
+++ openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 17 Oct 2002 09:39:47 -0000 1.13.2.1
@@ -49,12 +49,14 @@
} {
Adds a static admin PE to the given portal
} {
+ ns_log notice "portal id is $portal_id. package id is $package_id. portlet name is [get_my_name]"
return [portal::add_element_parameters \
-portal_id $portal_id \
-portlet_name [get_my_name] \
-key package_id \
-value $package_id
]
+ ns_log notice "end of add_self_to_page"
}
ad_proc -public remove_self_from_page {
Index: openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl,v
diff -u -r1.14 -r1.14.2.1
--- openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 9 Aug 2002 18:39:33 -0000 1.14
+++ openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 17 Oct 2002 09:39:47 -0000 1.14.2.1
@@ -48,6 +48,7 @@
} {
This is a bit different from other add_self_to_page procs.
} {
+ ns_log notice "portal is is $portal_id. package_id is $package_id. content_id is $content_id. template_id = $template_id"
if {![empty_string_p $template_id]} {
# we got a template_id, so we know that (1) that we are
@@ -62,8 +63,10 @@
$template_id \
[static_portlet::get_my_name]
]
+ ns_log notice "old element id is $old_element_id"
set old_content_id [portal::get_element_param $old_element_id content_id]
+ ns_log notice "old content id is $old_content_id"
# clone the template's content
set new_content_id [static_portal_content::new \
-package_id $package_id \
@@ -76,6 +79,7 @@
$portal_id \
[static_portlet::get_my_name]
]
+ ns_log notice "new element id is $new_element_id"
portal::set_element_param $new_element_id "package_id" $package_id
portal::set_element_param $new_element_id "content_id" $new_content_id
@@ -89,6 +93,8 @@
# since it dosen't do the right thing for multiple elements with
# the same datasource on a page. so we just use the more low level
# portal::add_element
+ ns_log notice "before bad proc. portal id is $portal_id"
+ ns_log notice "before bad proc. content id $content_id"
set element_id [portal::add_element \
-portal_id $portal_id \
-portlet_name [static_portlet::get_my_name] \
Index: openacs-4/packages/static-portlet/www/element-new.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/Attic/element-new.adp,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/static-portlet/www/element-new.adp 9 Aug 2002 18:39:33 -0000 1.4
+++ openacs-4/packages/static-portlet/www/element-new.adp 17 Oct 2002 09:39:47 -0000 1.4.2.1
@@ -20,13 +20,18 @@
@title@
+@community_id@
+
+
+Use this form to create a new @element_pretty_name@. The @element_pretty_name@ will be created and automatically placed on the first page of @portal_name@ portal. Goto the @control_panel_text@ and select Customize Layout to move the this @element_pretty_name@.
-Create a new @element_pretty_name@:
-
-
Note: You can use plain text or HTML in the Content area.
-
+
+
+
+
+
Index: openacs-4/packages/static-portlet/www/element-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/Attic/element-new.tcl,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/static-portlet/www/element-new.tcl 9 Aug 2002 18:39:33 -0000 1.9
+++ openacs-4/packages/static-portlet/www/element-new.tcl 17 Oct 2002 09:39:47 -0000 1.9.2.1
@@ -32,6 +32,15 @@
set title "New $element_pretty_name"
+#these are set for display and instructions.
+set community_id $package_id
+
+set portal_name [portal::get_name $portal_id]
+
+if {![info exists control_panel_text]} {
+ set control_panel_text "Control Panel"
+}
+
form create new_static_element
element create new_static_element pretty_name \
@@ -85,3 +94,14 @@
ad_returnredirect $referer
ad_script_abort
}
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/static-portlet/www/element.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/element.tcl,v
diff -u -r1.7 -r1.7.2.1
--- openacs-4/packages/static-portlet/www/element.tcl 9 Aug 2002 18:39:33 -0000 1.7
+++ openacs-4/packages/static-portlet/www/element.tcl 17 Oct 2002 09:39:47 -0000 1.7.2.1
@@ -74,12 +74,18 @@
form get_values static_element \
pretty_name content content_id portal_id referer
- static_portal_content::update \
- -portal_id $portal_id \
- -content_id $content_id \
- -pretty_name $pretty_name \
- -content $content
-
+ db_transaction {
+ static_portal_content::update \
+ -portal_id $portal_id \
+ -content_id $content_id \
+ -pretty_name $pretty_name \
+ -content $content
+
+ # Must update portal element title
+ # db_dml update_element_pretty_name "update portal_element_map set pretty_name= :pretty_name where element_id= :element_id"
+ }
+
+ # redirect and abort
ad_returnredirect $referer
ad_script_abort
}
Index: openacs-4/packages/static-portlet/www/static-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-admin-portlet.tcl,v
diff -u -r1.12 -r1.12.2.1
--- openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 9 Aug 2002 18:39:33 -0000 1.12
+++ openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 17 Oct 2002 09:39:47 -0000 1.12.2.1
@@ -20,20 +20,43 @@
@author arjun (arjun@openforce)
@author Ben Adida (ben@openforce)
@cvs_id $Id$
-} -properties {
+} {
+ package_id:optional
+ template_portal_id:optional
+ referer:optional
+ return_url:optional
}
+if {![exists_and_not_null package_id]} {
+ set package_id [dotlrn_community::get_community_id]
+}
+
+if {![exists_and_not_null template_portal_id]} {
+ set template_portal_id [dotlrn_community::get_portal_id]
+}
+
+if {[exists_and_not_null return_url]} {
+ set referer $return_url
+}
+
+if {![exists_and_not_null referer]} {
+ set referer [ad_conn url]
+}
+
set element_pretty_name [ad_parameter static_admin_portlet_element_pretty_name static-portlet "Custom Portlet"]
set element_pretty_plural [ad_parameter static_admin_portlet_element_pretty_plural static-portlet "Custom Portlets"]
-set package_id [dotlrn_community::get_community_id]
+ns_log notice "package_id = $package_id"
db_multirow content select_content {
select content_id,
pretty_name
from static_portal_content
where package_id = :package_id
}
-set template_portal_id [dotlrn_community::get_portal_id]
+
set applet_url "[dotlrn_applet::get_url]/[static_portlet::my_package_key]"
-set referer [ad_conn url]
+
+
+
+
|