Index: openacs-4/packages/dotlrn/dotlrn.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v
diff -u -r1.123.2.4 -r1.123.2.5
--- openacs-4/packages/dotlrn/dotlrn.info 3 Nov 2005 14:47:35 -0000 1.123.2.4
+++ openacs-4/packages/dotlrn/dotlrn.info 13 Dec 2005 15:32:34 -0000 1.123.2.5
@@ -22,12 +22,13 @@
-
-
+
+
+
@@ -46,30 +47,38 @@
+
+
+
+
+
+
+
+
+
-
Index: openacs-4/packages/dotlrn/catalog/dotlrn.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/catalog/dotlrn.en_US.ISO-8859-1.xml,v
diff -u -r1.43.2.6 -r1.43.2.7
--- openacs-4/packages/dotlrn/catalog/dotlrn.en_US.ISO-8859-1.xml 12 Dec 2005 16:53:31 -0000 1.43.2.6
+++ openacs-4/packages/dotlrn/catalog/dotlrn.en_US.ISO-8859-1.xml 13 Dec 2005 15:32:35 -0000 1.43.2.7
@@ -1,5 +1,5 @@
-
+
A copy of
Access
@@ -536,6 +536,25 @@
.LRN Toolbar anzeigen
silver
Site-wide Admin?
+ Add New Site Template
+ Add Site Template
+ Admin Parameters for Site Templating
+ Can community administrators change the Community's Site Template?
+ Default Site Tamplate for communities
+ Edit Site Template
+ Site Template ID
+ Site Template Name
+ Provide a pretty name for this Site Template
+ Master Tempalate used for not registered visitors.
+ Associated Portal Theme
+ Select a portal theme. This portal theme is going to be used for the Site Template.
+ Master Template
+ Provide the entire path for the master template (i.e. /packages/dotlrn/www/dotlrn-master )
+ Can users change their Site Template?
+ Defautl Site Template for users
+ Site Templates
+ Site Templates
+ Parameters Administration
Small
Sorry!
Spam ...
Index: openacs-4/packages/dotlrn/sql/postgresql/communities-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/communities-create.sql,v
diff -u -r1.4.8.1 -r1.4.8.2
--- openacs-4/packages/dotlrn/sql/postgresql/communities-create.sql 31 May 2005 23:13:04 -0000 1.4.8.1
+++ openacs-4/packages/dotlrn/sql/postgresql/communities-create.sql 13 Dec 2005 15:32:35 -0000 1.4.8.2
@@ -91,7 +91,10 @@
header_img varchar(100)
default '',
tree_sortkey varbit,
- max_child_sortkey varbit
+ max_child_sortkey varbit,
+ site_template_id integer
+ constraint dotlrn_c_site_template_id_fk
+ references dotlrn_site_templates(site_template_id)
);
create index dtlrn_com_all_com_par_id_idx on dotlrn_communities_all (community_id, parent_community_id);
Index: openacs-4/packages/dotlrn/sql/postgresql/dotlrn-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/dotlrn-create.sql,v
diff -u -r1.11 -r1.11.2.1
--- openacs-4/packages/dotlrn/sql/postgresql/dotlrn-create.sql 20 Apr 2004 21:13:17 -0000 1.11
+++ openacs-4/packages/dotlrn/sql/postgresql/dotlrn-create.sql 13 Dec 2005 15:32:35 -0000 1.11.2.1
@@ -21,6 +21,7 @@
-- started August 18th, 2001
--
+\i site-templates-create.sql
\i users-create.sql
\i portal-types-create.sql
\i communities-create.sql
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/postgresql/site-templates-create.sql'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/postgresql/site-templates-drop.sql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/dotlrn/sql/postgresql/users-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/users-create.sql,v
diff -u -r1.4.12.1 -r1.4.12.2
--- openacs-4/packages/dotlrn/sql/postgresql/users-create.sql 31 May 2005 23:13:05 -0000 1.4.12.1
+++ openacs-4/packages/dotlrn/sql/postgresql/users-create.sql 13 Dec 2005 15:32:35 -0000 1.4.12.2
@@ -35,7 +35,10 @@
theme_id integer
constraint dotlrn_user_p_rels_theme_id_fk
references portal_element_themes (theme_id),
- id varchar(100)
+ id varchar(100),
+ site_template_id integer
+ constraint dotlrn_user_p_rels_site_template_id_fk
+ references dotlrn_site_templates(site_template_id)
);
create table dotlrn_user_types (
@@ -66,6 +69,7 @@
dotlrn_user_profile_rels.portal_id,
dotlrn_user_profile_rels.theme_id,
dotlrn_user_profile_rels.id,
+ dotlrn_user_profile_rels.site_template_id,
users.user_id,
persons.first_names,
persons.last_name,
@@ -102,3 +106,4 @@
-- create external users
\i externals-create.sql
+
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.1.3-2.2.0a1.sql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/dotlrn/tcl/apm-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/apm-callback-procs.tcl,v
diff -u -r1.3.2.1 -r1.3.2.2
--- openacs-4/packages/dotlrn/tcl/apm-callback-procs.tcl 31 May 2005 23:13:05 -0000 1.3.2.1
+++ openacs-4/packages/dotlrn/tcl/apm-callback-procs.tcl 13 Dec 2005 15:32:35 -0000 1.3.2.2
@@ -51,6 +51,23 @@
-privilege "admin"
}
+ #Setting the default Site Template
+ set site_template_id [db_string select_st_id "select site_template_id from dotlrn_site_templates where pretty_name = '#new-portal.sloan_theme_name#'"]
+
+ #for communities
+ parameter::set_value -package_id $package_id \
+ -parameter "CommDefaultSiteTemplate_p" \
+ -value $site_template_id
+
+ #for users
+ parameter::set_value -package_id $package_id \
+ -parameter "UserDefaultSiteTemplate_p" \
+ -value $site_template_id
+
+ parameter::set_from_package_key -package_key "acs-subsite" \
+ -parameter "DefaultMaster" \
+ -value "/packages/dotlrn/www/dotlrn-master-custom"
+
}
@@ -102,7 +119,6 @@
ns_log notice "dotlrn upgrade: dotlrn permission granted..."
-
#grant dotlrn-portlet admin permission
permission::grant \
-party_id $dotlrn_admins_group \
@@ -120,25 +136,45 @@
ns_log notice "dotlrn upgrade: new-portal permission granted..."
}
-
+
db_transaction {
-
+
#grant admin permission on old communities
db_foreach community_group "select community_id from dotlrn_communities" {
-
permission::grant \
-party_id $dotlrn_admins_group \
-object_id $community_id \
-privilege "admin"
-
+
ns_log notice "dotlrn upgrade: community $community_id permission granted to dotlrn-admin ..."
-
-
+
}
- }
- }
+ }
}
+ 2.1.3 2.2.0a1 {
+ ns_log Warning "vguerra doing upgrade from 2.1.3 to 2.2.0a1"
+ #Setting the default Site Template
+ set site_template_id [db_string select_st_id "select site_template_id from dotlrn_site_templates where pretty_name = '#new-portal.sloan_theme_name#'"]
+
+ set package_id [dotlrn::get_package_id]
+ #for communities
+ parameter::set_value -package_id $package_id \
+ -parameter "CommDefaultSiteTemplate_p" \
+ -value $site_template_id
+
+ #for users
+ parameter::set_value -package_id $package_id \
+ -parameter "UserDefaultSiteTemplate_p" \
+ -value $site_template_id
+
+ parameter::set_from_package_key -package_key "acs-subsite" \
+ -parameter "DefaultMaster" \
+ -value "/packages/dotlrn/www/dotlrn-master-custom"
+
+
+ }
+ }
}
+
+
-
-
Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v
diff -u -r1.191.2.17 -r1.191.2.18
--- openacs-4/packages/dotlrn/tcl/community-procs.tcl 26 Sep 2005 09:07:00 -0000 1.191.2.17
+++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 13 Dec 2005 15:32:35 -0000 1.191.2.18
@@ -307,6 +307,10 @@
}
}
+ # Assign default community site template
+ dotlrn_community::set_site_template_id -community_id $community_id \
+ -site_template_id [parameter::get -package_id [dotlrn::get_package_id] -parameter "CommDefaultSiteTemplate_p"]
+
# This new community should _not_ inherit it's permissions
# from the root dotlrn instance. Why? All dotlrn users
# can read the root dotlrn instance, but only members of
@@ -2319,5 +2323,59 @@
return $return_val
}
+ ad_proc -public set_site_template_id {
+ {-community_id:required}
+ {-site_template_id:required}
+ } {
+ set the site_template_id for a given community_id
+ } {
+ db_dml update_site_template {}
+ set new_theme_id [db_string select_portal_theme {}]
+ set portal_id [get_portal_id -community_id $community_id]
+ db_dml update_portal_theme {}
+ set portal_id [get_admin_portal_id -community_id $community_id]
+ db_dml update_portal_theme {}
+ util_memoize_flush [list dotlrn_community::get_site_template_id_not_cached -community_id $community_id]
+ util_memoize_flush [list dotlrn_community::get_dotlrn_master_not_cached -community_id $community_id]
+ }
+
+ ad_proc -public get_dotlrn_master {
+ {-community_id:required}
+ } {
+ Returns the master configured for the user_id
+ } {
+ set site_template_id [get_site_template_id -community_id $community_id]
+ return [dotlrn::get_master_from_site_template_id -site_template_id $site_template_id]
+ }
+
+ ad_proc -public get_site_template_id {
+ {-community_id:required}
+ } {
+ get the id of the comm's site template
+ } {
+ return [util_memoize [list dotlrn_community::get_site_template_id_not_cached -community_id $community_id]]
+ }
+
+ ad_proc -private get_site_template_id_not_cached {
+ {-community_id:required}
+ } {
+ } {
+ ns_log Warning "vguerra obteniendo template de commr $community_id proc cached"
+ set dotlrn_package_id [dotlrn::get_package_id]
+ set comm_site_template_id [db_string select_site_template_id {} -default "0"]
+ if {[parameter::get -package_id $dotlrn_package_id -parameter AdminChangeSiteTemplate_p]} {
+ ns_log Warning "vguerra cached 1"
+ set site_template_id [get_site_template_id -community_id $community_id]
+ } else {
+ ns_log Warning "vguerra cached 2"
+ set site_template_id [parameter::get -package_id $dotlrn_package_id -parameter CommDefaultSiteTemplate_p]
+ if {$site_template_id != $comm_site_template_id} {
+ set_site_template_id -community_id $community_id -site_template_id $site_template_id
+ }
+ }
+ ns_log Warning "vguerra retornando del proc cacheado"
+ return $site_template_id
+ }
}
+
Index: openacs-4/packages/dotlrn/tcl/community-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.xql,v
diff -u -r1.87.2.1 -r1.87.2.2
--- openacs-4/packages/dotlrn/tcl/community-procs.xql 31 May 2005 23:13:05 -0000 1.87.2.1
+++ openacs-4/packages/dotlrn/tcl/community-procs.xql 13 Dec 2005 15:32:35 -0000 1.87.2.2
@@ -609,4 +609,45 @@
+
+
+ update dotlrn_communities_all
+ set site_template_id = :site_template_id
+ where community_id = :community_id
+
+
+
+
+
+ select portal_theme_id
+ from dotlrn_site_templates
+ where site_template_id = :site_template_id
+
+
+
+
+
+ update portals
+ set theme_id = :new_theme_id
+ where portal_id = :portal_id
+
+
+
+
+
+ select site_template_id
+ from dotlrn_communities_all
+ where community_id = :community_id
+
+
+
+
+
+ select dst.site_master
+ from dotlrn_site_templates dst, dotlrn_communities_all dca
+ where dca.community_id = :community_id
+ and dca.site_template_id = dst.site_template_id
+
+
+
Index: openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl,v
diff -u -r1.74.8.3 -r1.74.8.4
--- openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 19 Jul 2005 22:20:26 -0000 1.74.8.3
+++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 13 Dec 2005 15:32:35 -0000 1.74.8.4
@@ -410,4 +410,75 @@
}
}
+ ad_proc -public set_site_template_id {
+ {-user_id:required}
+ {-site_template_id:required}
+ } {
+ Sets the site_template_id for a given user
+ } {
+ set portal_id [dotlrn::get_portal_id -user_id $user_id]
+ ns_log Warning "tratando con vguerra $site_template_id"
+ set new_theme_id [db_string select_portal_theme {}]
+ db_dml update_portal_theme {}
+ db_dml update_user_site_template {}
+ util_memoize_flush [list dotlrn::get_site_template_id_not_cached -user_id $user_id]
+ util_memoize_flush [list dotlrn::get_dotlrn_master_not_cached -user_id $user_id]
+ }
+
+ ad_proc -public get_dotlrn_master {
+ {-user_id:required}
+ } {
+ Returns the master configured for the user_id
+ } {
+ set site_template_id [get_site_template_id -user_id $user_id]
+ ns_log Warning "vguerra obteniendo template de user $user_id"
+ return [get_master_from_site_template_id -site_template_id $site_template_id]
+ }
+
+ ad_proc -public get_site_template_id {
+ {-user_id:required}
+ } {
+ Get the site_template_id from a particular user
+ } {
+ return [util_memoize [list dotlrn::get_site_template_id_not_cached -user_id $user_id] ]
+ }
+
+ ad_proc -private get_site_template_id_not_cached {
+ {-user_id:required}
+ } {
+ } {
+ ns_log Warning "vguerra obteniendo template de user $user_id proc cached"
+ set dotlrn_package_id [dotlrn::get_package_id]
+ set user_site_template_id [db_string select_site_template_id {} -default "0"]
+ if {[parameter::get -package_id $dotlrn_package_id -parameter UserChangeSiteTemplate_p]} {
+ ns_log Warning "vguerra cached 1"
+ set site_template_id $user_site_template_id
+ } else {
+ ns_log Warning "vguerra cached 2"
+ set site_template_id [parameter::get -package_id $dotlrn_package_id -parameter UserDefaultSiteTemplate_p]
+ if {$site_template_id != $user_site_template_id} {
+ set_site_template_id -user_id $user_id -site_template_id $site_template_id
+ }
+ }
+ ns_log Warning "vguerra retornando del proc cacheado"
+ return $site_template_id
+ }
+
+
+ ad_proc -public get_master_from_site_template_id {
+ {-site_template_id:required}
+ } {
+ } {
+ return [util_memoize [list dotlrn::get_master_from_site_template_id_not_cached -site_template_id $site_template_id]]
+ }
+
+ ad_proc -private get_master_from_site_template_id_not_cached {
+ {-site_template_id:required}
+ } {
+ } {
+ return [db_string select_site_template_master {} \
+ -default [parameter::get -package_id [dotlrn::get_package_id] \
+ -parameter DefaultMaster_p]]
+ }
+
}
Index: openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql,v
diff -u -r1.17.8.2 -r1.17.8.3
--- openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql 19 Jul 2005 22:20:26 -0000 1.17.8.2
+++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql 13 Dec 2005 15:32:35 -0000 1.17.8.3
@@ -65,4 +65,46 @@
+
+
+ select portal_theme_id
+ from dotlrn_site_templates
+ where site_template_id = :site_template_id
+
+
+
+
+
+ update portals
+ set theme_id = :new_theme_id
+ where portal_id = :portal_id
+
+
+
+
+
+ update dotlrn_user_profile_rels
+ set site_template_id = :site_template_id
+ where rel_id = (select rel_id
+ from dotlrn_users
+ where user_id = :user_id)
+
+
+
+
+
+ select site_template_id
+ from dotlrn_users
+ where user_id = :user_id
+
+
+
+
+
+ select site_master
+ from dotlrn_site_templates
+ where site_template_id = :site_template_id
+
+
+
Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v
diff -u -r1.58.2.1 -r1.58.2.2
--- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 31 May 2005 23:13:05 -0000 1.58.2.1
+++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 13 Dec 2005 15:32:35 -0000 1.58.2.2
@@ -162,6 +162,10 @@
# always flush when creating a new user
util_memoize_flush "dotlrn::get_portal_id_not_cached -user_id $user_id"
+ #Site Template Customization
+ dotlrn::set_site_template_id -user_id $user_id \
+ -site_template_id [parameter::get -package_id [dotlrn::get_package_id] -parameter "UserDefaultSiteTemplate_p"]
+
return $rel_id
}
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/change-site-template.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/change-site-template.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/change-site-template.xql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/dotlrn/www/control-panel.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/control-panel.adp,v
diff -u -r1.15.2.2 -r1.15.2.3
--- openacs-4/packages/dotlrn/www/control-panel.adp 26 Sep 2005 09:07:00 -0000 1.15.2.2
+++ openacs-4/packages/dotlrn/www/control-panel.adp 13 Dec 2005 15:32:35 -0000 1.15.2.3
@@ -46,6 +46,7 @@
#dotlrn.pvt_home_name#
#dotlrn.Customize_Layout#
+ #dotlrn.Customize_Template#
@admin_pretty_name@ (#dotlrn.Cockpit#)
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/dotlrn-master-custom.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/dotlrn-master-custom.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/add-edit-site-template.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/add-edit-site-template.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/add-edit-site-template.xql'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/admin-params-site-templates.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/admin-params-site-templates.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/dotlrn/www/admin/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/index.adp,v
diff -u -r1.27.2.1 -r1.27.2.2
--- openacs-4/packages/dotlrn/www/admin/index.adp 31 May 2005 23:13:07 -0000 1.27.2.1
+++ openacs-4/packages/dotlrn/www/admin/index.adp 13 Dec 2005 15:32:36 -0000 1.27.2.2
@@ -37,6 +37,7 @@
<%= [parameter::get -localize -parameter class_instances_pretty_plural] %>
<%= [parameter::get -localize -parameter clubs_pretty_plural] %>
#dotlrn.portal_templates#
+ #dotlrn.site_templates#
#dotlrn.archived_classes_and_communities#
#dotlrn.edit_approved_email_servers#
#dotlrn.edit_parameters#
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/site-templates.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/site-templates.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/site-templates.xql'.
Fisheye: No comparison available. Pass `N' to diff?