Index: openacs-4/packages/acs-subsite/acs-subsite.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/acs-subsite.info,v diff -u -r1.95 -r1.96 --- openacs-4/packages/acs-subsite/acs-subsite.info 13 Dec 2007 17:22:59 -0000 1.95 +++ openacs-4/packages/acs-subsite/acs-subsite.info 8 May 2008 01:35:57 -0000 1.96 @@ -7,16 +7,16 @@ t f - + OpenACS Subsite - 2007-07-18 + 2008-02-03 OpenACS Provides for creating subsites within the OpenACS Community System. Aware of parties, groups, users, portraits. Can be themed via a per subsite master template. GPL 3 - + @@ -34,9 +34,12 @@ - - - + + + + + + @@ -76,6 +79,57 @@ + + + + Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml,v diff -u -r1.81 -r1.82 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml 21 Jan 2008 15:12:26 -0000 1.81 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml 8 May 2008 01:35:57 -0000 1.82 @@ -7,10 +7,6 @@ About you Your account at %system_name% has been closed. No, take me back to %pvt_home_name% - Description please - does this refer to 'Close account' on the 'Your(/My) Account' page? Where ist the user taken if he doesn't confirm? On the 'MySpace' page? (pvt=private?) - ---Anja Wicht - Yes, please close my account <p>Your account is currently closed.</p> @@ -37,8 +33,10 @@ Add users Control Panel Admin + Administration Administer %subsite_name% Administrative options for this user + Advanced Alert Type another picture. Answer @@ -86,6 +84,7 @@ Communities communities community + Configuration Confirm You have successfully chosen a new password. Continue @@ -326,6 +325,7 @@ Name new application New Password + New Subsite No applications No assessment available No ISO Codes @@ -428,6 +428,7 @@ subcommunities subcommunity subsite + %subsite_name% Home Subsites subsites You have successfully authenticated, but you do not have an account on %system_name% yet. Index: openacs-4/packages/acs-subsite/sql/oracle/acs-subsite-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/oracle/acs-subsite-create.sql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/sql/oracle/acs-subsite-create.sql 8 Feb 2005 17:24:45 -0000 1.6 +++ openacs-4/packages/acs-subsite/sql/oracle/acs-subsite-create.sql 8 May 2008 01:35:58 -0000 1.7 @@ -21,6 +21,7 @@ @@ host-node-map-create @@ user-sc-create @@ site-node-selection +@@ themes-create -- This view lets us avoid using acs_object.name to get party_names. -- Index: openacs-4/packages/acs-subsite/sql/postgresql/acs-subsite-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/postgresql/acs-subsite-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-subsite/sql/postgresql/acs-subsite-create.sql 22 Jan 2005 18:02:00 -0000 1.7 +++ openacs-4/packages/acs-subsite/sql/postgresql/acs-subsite-create.sql 8 May 2008 01:35:58 -0000 1.8 @@ -15,6 +15,7 @@ \i host-node-map-create.sql \i user-sc-create.sql \i site-node-selection.sql +\i themes-create.sql -- DRB: user profiles are fundamentally broken, which is probably why they -- weren't created in the original ACS 4.2 Oracle sources. Index: openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl,v diff -u -r1.40 -r1.41 --- openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 16 May 2007 23:30:16 -0000 1.40 +++ openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 8 May 2008 01:35:58 -0000 1.41 @@ -787,27 +787,65 @@ return $main_node(object_id) } +ad_proc -public subsite::get_theme_options {} { + Gets options for subsite themes for use with a form builder select widget. +} { + db_foreach get_subsite_themes {} { + lappend master_theme_options [list [lang::util::localize $name] $key] + } -ad_proc -public subsite::get_template_options {} { - Gets options for subsite master template for use with a form builder select widget. + return $master_theme_options +} + +ad_proc -public subsite::set_theme { + -subsite_id + {-theme:required} } { - set master_template_options [list] - lappend master_template_options [list "Plain" "/www/default-master"] - lappend master_template_options [list "Tabbed" "/packages/acs-subsite/www/group-master"] - set current_master [parameter::get -parameter DefaultMaster -package_id [ad_conn subsite_id]] - set found_p 0 - foreach elm $master_template_options { - if {$current_master eq [lindex $elm 1]} { - set found_p 1 - break - } + Set the theme for the given subsite. This will change the subsite's ThemeKey, + DefaultMaster, and ThemeCSS parameters. +} { + if { ![info exists subsite_id] } { + set subsite_id [ad_conn subsite_id] } - if { !$found_p } { - lappend master_template_options [list $current_master $current_master] - } - return $master_template_options + + db_1row get_theme_paths {} + + parameter::set_value -parameter ThemeKey -package_id $subsite_id \ + -value $theme + parameter::set_value -parameter DefaultMaster -package_id $subsite_id \ + -value $template + parameter::set_value -parameter ThemeCSS -package_id $subsite_id \ + -value $css + parameter::set_value -parameter DefaultFormStyle -package_id $subsite_id \ + -value $form_template + parameter::set_value -parameter DefaultListStyle -package_id $subsite_id \ + -value $list_template + parameter::set_value -parameter DefaultListFilterStyle -package_id $subsite_id \ + -value $list_filter_template } +ad_proc -public subsite::new_subsite_theme { + -key:required + -name:required + -template:required + {-css ""} + {-form_template ""} + {-list_template ""} + {-list_filter_template ""} +} { + Add a new subsite theme, making it available to the theme configuration code. +} { + db_dml insert_subsite_theme {} +} + +ad_proc -public subsite::delete_subsite_theme { + -key:required +} { + Delete a subsite theme, making it unavailable to the theme configuration code. +} { + db_dml delete_subsite_theme {} +} + ad_proc -public subsite::get_application_options {} { Gets options list for applications to install } { Index: openacs-4/packages/acs-subsite/tcl/subsite-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/Attic/subsite-procs.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-subsite/tcl/subsite-procs.xql 7 Mar 2005 23:48:28 -0000 1.8 +++ openacs-4/packages/acs-subsite/tcl/subsite-procs.xql 8 May 2008 01:35:58 -0000 1.9 @@ -83,5 +83,36 @@ and host = :search_vhost + + + + select name, key + from subsite_themes + + + + + + insert into subsite_themes + (key, name, template, css, form_template, list_template, list_filter_template) + values + (:key, :name, :template, :css, :form_template, :list_template, :list_filter_template) + + + + + + delete from subsite_themes + where key = :key + + + + + + select * + from subsite_themes + where key = :theme + + Index: openacs-4/packages/acs-subsite/www/admin/configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/configure.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-subsite/www/admin/configure.tcl 11 Dec 2003 21:39:55 -0000 1.8 +++ openacs-4/packages/acs-subsite/www/admin/configure.tcl 8 May 2008 01:35:58 -0000 1.9 @@ -16,10 +16,10 @@ {label "Subsite name"} {html {size 50}} } - {master_template:text(select) - {label "Template"} - {help_text "Choose the layout and navigation you want for your subsite."} - {options [subsite::get_template_options]} + {theme:text(select) + {label "Theme"} + {help_text "Choose the layout and navigation theme you want for your subsite."} + {options [subsite::get_theme_options]} } {visibility:text(select) {label "Visible to"} @@ -31,7 +31,7 @@ } } -on_request { set instance_name [ad_conn instance_name] - set master_template [parameter::get -parameter DefaultMaster -package_id [ad_conn package_id]] + set theme [parameter::get -parameter ThemeKey -package_id [ad_conn package_id]] if { [permission::inherit_p -object_id [ad_conn package_id]] } { set visibility "any" @@ -43,7 +43,7 @@ } -on_submit { apm_package_rename -instance_name $instance_name - parameter::set_value -parameter DefaultMaster -package_id [ad_conn package_id] -value $master_template + subsite::set_theme -theme $theme set group(join_policy) $join_policy group::update -group_id [application_group::group_id_from_package_id] -array group Index: openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl 10 Jan 2007 21:22:06 -0000 1.10 +++ openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl 8 May 2008 01:35:58 -0000 1.11 @@ -27,10 +27,10 @@ {help_text "This should be a short string, all lowercase, with hyphens instead of spaces, whicn will be used in the URL of the new application. If you leave this blank, we will generate one for you from name of the application."} {html {size 30}} } - {master_template:text(select) - {label "Template"} - {help_text "Choose the layout and navigation you want for your subsite."} - {options [subsite::get_template_options]} + {theme:text(select) + {label "Theme"} + {help_text "Choose the layout and navigation theme you want for your subsite."} + {options [subsite::get_theme_options]} } {visibility:text(select) {label "Visible to"} @@ -61,7 +61,7 @@ -package_key acs-subsite] # Set template - parameter::set_value -parameter DefaultMaster -package_id $new_package_id -value $master_template + subsite::set_theme -subsite_id $new_package_id -theme $theme # Set join policy set group(join_policy) $join_policy Index: openacs-4/packages/openacs-default-theme/openacs-default-theme.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/openacs-default-theme/openacs-default-theme.info,v diff -u -r1.1 -r1.2 --- openacs-4/packages/openacs-default-theme/openacs-default-theme.info 8 May 2008 01:34:03 -0000 1.1 +++ openacs-4/packages/openacs-default-theme/openacs-default-theme.info 8 May 2008 01:35:58 -0000 1.2 @@ -16,7 +16,7 @@ 0 - + Index: openacs-4/www/blank-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/blank-master.tcl,v diff -u -r1.43 -r1.44 --- openacs-4/www/blank-master.tcl 25 Jan 2008 21:43:50 -0000 1.43 +++ openacs-4/www/blank-master.tcl 8 May 2008 01:35:58 -0000 1.44 @@ -79,15 +79,22 @@ # be done in acs-templating. # -# Add standard css -# -template::head::add_css \ - -href "/resources/acs-templating/lists.css" \ - -media "all" +# Add css for the current subsite, defaulting to the old list/form css which was +# hard-wired in previous versions of OpenACS. -template::head::add_css \ - -href "/resources/acs-templating/forms.css" \ - -media "all" +set css [parameter::get -package_id [ad_conn subsite_id] -parameter ThemeCSS -default ""] +if { $css ne "" } { + foreach css $css { + template::head::add_css -href [lindex $css 0] -media [lindex $css 1] + } +} else { + template::head::add_css \ + -href "/resources/acs-templating/lists.css" \ + -media "all" + template::head::add_css \ + -href "/resources/acs-templating/forms.css" \ + -media "all" +} # # Temporary (?) fix to get xinha working