subsite::set_theme (public)

 subsite::set_theme [ -subsite_id subsite_id ] -theme theme

Defined in packages/acs-subsite/tcl/subsite-procs.tcl

Set the theme for the given or current subsite. This will change the subsite's ThemeKey, DefaultMaster, and ThemeCSS, DefaultFormStyle, DefaultListStyle, DefaultListFilterStyle, DefaultDimensionalStyle, and ResourceDir parameters.

Switches:
-subsite_id (optional)
Id of the subsite
-theme (required)
Name of the theme (theme key)

Partial Call Graph (max 5 caller/called nodes):
%3 test_subsite_api subsite_api (test acs-subsite) subsite::set_theme subsite::set_theme test_subsite_api->subsite::set_theme ad_conn ad_conn (public) subsite::set_theme->ad_conn db_1row db_1row (public) subsite::set_theme->db_1row parameter::set_value parameter::set_value (public) subsite::set_theme->parameter::set_value subsite::get_theme subsite::get_theme (public) subsite::set_theme->subsite::get_theme install::xml::action::set-theme install::xml::action::set-theme (public) install::xml::action::set-theme->subsite::set_theme openacs_bootstrap3_theme::apm::before_uninstall openacs_bootstrap3_theme::apm::before_uninstall (private) openacs_bootstrap3_theme::apm::before_uninstall->subsite::set_theme openacs_bootstrap5_theme::apm::before_uninstall openacs_bootstrap5_theme::apm::before_uninstall (private) openacs_bootstrap5_theme::apm::before_uninstall->subsite::set_theme packages/acs-subsite/www/admin/configure.tcl packages/acs-subsite/ www/admin/configure.tcl packages/acs-subsite/www/admin/configure.tcl->subsite::set_theme packages/acs-subsite/www/admin/subsite-add.tcl packages/acs-subsite/ www/admin/subsite-add.tcl packages/acs-subsite/www/admin/subsite-add.tcl->subsite::set_theme

Testcases:
subsite_api
Source code:
    if { ![info exists subsite_id] } {
        set subsite_id [ad_conn subsite_id]
    }

    set old_theme [subsite::get_theme -subsite_id $subsite_id]

    db_1row get_theme_paths {
      select *
      from subsite_themes
      where key = :theme
    }

    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 ThemeJS -package_id $subsite_id  -value $js
    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
    parameter::set_value -parameter DefaultDimensionalStyle -package_id $subsite_id  -value $dimensional_template
    parameter::set_value -parameter ResourceDir -package_id $subsite_id  -value $resource_dir
    parameter::set_value -parameter StreamingHead -package_id $subsite_id  -value $streaming_head

    ::callback subsite::theme_changed  -subsite_id $subsite_id  -old_theme $old_theme  -new_theme $theme
XQL Not present:
Generic
PostgreSQL XQL file:
packages/acs-subsite/tcl/subsite-procs-postgresql.xql

Oracle XQL file:
packages/acs-subsite/tcl/subsite-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: