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 @@ <initial-install-p>t</initial-install-p> <singleton-p>f</singleton-p> - <version name="5.4.0d8" url="http://openacs.org/repository/download/apm/acs-subsite-5.4.0d8.apm"> + <version name="5.5.0d3" url="http://openacs.org/repository/download/apm/acs-subsite-5.5.0d3.apm"> <owner url="http://openacs.org">OpenACS</owner> <summary>Subsite</summary> - <release-date>2007-07-18</release-date> + <release-date>2008-02-03</release-date> <vendor url="http://openacs.org">OpenACS</vendor> <description format="text/html">Provides for creating subsites within the OpenACS Community System. Aware of parties, groups, users, portraits. Can be themed via a per subsite master template.</description> <license>GPL</license> <maturity>3</maturity> - <provides url="acs-subsite" version="5.4.0d8"/> + <provides url="acs-subsite" version="5.5.0d3"/> <requires url="acs-authentication" version="5.3.2"/> <requires url="acs-content-repository" version="5.3.2"/> <requires url="acs-kernel" version="5.3.2"/> @@ -34,9 +34,12 @@ <parameter datatype="string" min_n_values="1" max_n_values="1" name="AcceptablePortraitMIMETypes" default="image/gif image/jpeg image/png" description="Enter a set of acceptable MIME types for portrait submissions." section_name="user-info"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="AllowPersistentLoginP" default="1" description="do we allow persistent logins?" section_name="user-login"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="AsmForRegisterId" default="1" description="Assessment used in the registration process." section_name="user-login"/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultFormStyle" description="The default form template to use if a particular form doesn't have something more specific defined already."/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultListStyle" description="The default list template to use if a particular list does not explicitly specify the list style to use."/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultMaster" default="/www/default-master" description="Path to the default master page (skin) for acs-templating. Extensions .adp/.tcl are implied."/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultFormStyle" description="The default form template to use if a particular form doesn't have something more specific defined already." section_name="theming"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultListStyle" description="The default list template to use if a particular list does not explicitly specify the list style to use." section_name="theming"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultListFilterStyle" description="The default list filter template to use if a particular listfilter tag does not explicitly specify the list filter style to use." section_name="theming"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="ThemeKey" default="" description="Key of the acs-templating theme for this subsite. Set by the admin theme-switching UI." section_name="theming"/> + <parameter datatype="text" min_n_values="1" max_n_values="1" name="ThemeCSS" default="" description="A list of lists of CSS/media pairs to use with this theme. Set by the admin theme-switching UI. If non defined, the default list and form CSS files are used, and the subsite master is expected to provide any CSS it needs itself." section_name="theming"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultMaster" default="" description="Path to the default master page (skin) for acs-templating. Set by the admin theme-switching UI." section_name="theming"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="EmailChangedPasswordP" default="0" description="if the admin changes the password, should it be mailed to the user" section_name="user-login"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="EmailConfirmTemplate" default="/packages/acs-subsite/lib/email-confirm" description="Template to use for the page the user comes to for verification of the email. Can be used to trigger additional events."/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="EmailForgottenPasswordP" default="1" description="Email users forgotten passwords" section_name="user-login"/> @@ -76,6 +79,57 @@ <parameter datatype="string" min_n_values="1" max_n_values="1" name="UserNewTemplate" default="/packages/acs-subsite/lib/user-new" description="Name of the template used for creation of a new user" section_name="Templates"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="application" default="default" description="Name of the ETP application to use (default, faq, wiki, or create your own with the etp::define_applicaton procedure)" section_name="EditThisPage"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="subtopic_application" default="default" description="Name of the ETP application to use when creating a subtopic" section_name="EditThisPage"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="ShowApplications" default="1" section_name="Navigation Tabs" description="Show individual tabs for mounted applications within this subsite"/> + <parameter datatype="text" min_n_values="1" max_n_values="1" name="UserNavbarTabsList" default="home {label #acs-subsite.Subsite_Home#}" description "Navigation tabs to show to users" section_name="Navigation Tabs"/> + <parameter datatype="text" min_n_values="1" max_n_values="1" name="MembersViewNavbarTabsList" default="members {label #acs-subsite.Members# folder members selected_patterns {*}}" description "Navigation tabs to show to those allowed to see subsite members" section_name="Navigation Tabs"/> + <parameter datatype="text" min_n_values="1" max_n_values="1" name="AdminNavbarTabsList" default=" +admin { + label #acs-subsite.Administration# + url admin/configure + selected_patterns { + admin/* + shared/parameters + } + subsections { + configuration { + label #acs-subsite.Configuration# + url admin/configure + } + applications { + label #acs-subsite.Applications# + folder admin/applications + selected_patterns { + * + } + } + subsite_add { + label #acs-subsite.New_Subsite# + url admin/subsite-add + } + permissions { + label #acs-subsite.Permissions# + url admin/permissions + } + parameters { + label #acs-subsite.Parameters# + url shared/parameters + } + advanced { + label #acs-subsite.Advanced# + folder admin + selected_patterns { + site-map/* + groups/* + group-types/* + rel-segments/* + rel-types/* + host-node-map/* + object-types/* + } + } + } +} +" section_name="Navigation Tabs" description="Navigation tabs to show administrators"/> </parameters> </version> 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 @@ <msg key="About_You">About you</msg> <msg key="Account_at_system_closed">Your account at %system_name% has been closed.</msg> <msg key="Account_close_confirm_no_label">No, take me back to %pvt_home_name%</msg> - <description key="Account_close_confirm_no_label">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</description> - <msg key="Account_close_confirm_yes_label">Yes, please close my account</msg> <msg key="Account_closed"> <p>Your account is currently closed.</p> @@ -37,8 +33,10 @@ <msg key="Add_users">Add users</msg> <msg key="Admin">Control Panel</msg> <msg key="admin">Admin</msg> + <msg key="Administration">Administration</msg> <msg key="Administer_subsite">Administer %subsite_name%</msg> <msg key="Administrative_options">Administrative options for this user</msg> + <msg key="Advanced">Advanced</msg> <msg key="Alert_Type">Alert Type</msg> <msg key="another_picture">another picture.</msg> <msg key="Answer">Answer</msg> @@ -86,6 +84,7 @@ <msg key="Communities">Communities</msg> <msg key="communities">communities</msg> <msg key="community">community</msg> + <msg key="Configuration">Configuration</msg> <msg key="Confirm">Confirm</msg> <msg key="confirmation_password_changed">You have successfully chosen a new password.</msg> <msg key="Continue">Continue</msg> @@ -326,6 +325,7 @@ <msg key="Name">Name</msg> <msg key="new_application">new application</msg> <msg key="New_Password">New Password</msg> + <msg key="New_Subsite">New Subsite</msg> <msg key="No_applications">No applications</msg> <msg key="no_assessment">No assessment available</msg> <msg key="No_ISO_Codes">No ISO Codes</msg> @@ -428,6 +428,7 @@ <msg key="subcommunities">subcommunities</msg> <msg key="subcommunity">subcommunity</msg> <msg key="subsite">subsite</msg> + <msg key="Subsite_Home">%subsite_name% Home</msg> <msg key="Subsites">Subsites</msg> <msg key="subsites">subsites</msg> <msg key="Success_but_no_account_yet">You have successfully authenticated, but you do not have an account on %system_name% yet.</msg> 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 </querytext> </partialquery> + + <fullquery name="subsite::get_theme_options.get_subsite_themes"> + <querytext> + select name, key + from subsite_themes + </querytext> + </fullquery> + + <fullquery name="subsite::new_subsite_theme.insert_subsite_theme"> + <querytext> + 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) + </querytext> + </fullquery> + + <fullquery name="subsite::delete_subsite_theme.delete_subsite_theme"> + <querytext> + delete from subsite_themes + where key = :key + </querytext> + </fullquery> + + <fullquery name="subsite::set_theme.get_theme_paths"> + <querytext> + select * + from subsite_themes + where key = :theme + </querytext> + </fullquery> </queryset> 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 @@ <maturity>0</maturity> <provides url="openacs-default-theme" version="5.5.0d1"/> - <requires url="acs-subsite" version="5.5.0d2"/> + <requires url="acs-subsite" version="5.5.0d3"/> <callbacks> <callback type="after-install" proc="openacs_default_theme::install::after_install"/> 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