+ @page_title;literal@
+ @context;literal@
+
+Available Themes
+The following themes are available in your installation:
+
+
+
+To perform customizations, one can modify the theme
+parameters of the currently selected theme and save it under a new
+name.
+
+When a theme originating from a theming package is deleted, it might
+ne recreated via the after_install callback of that package.
Index: openacs-4/packages/acs-subsite/www/admin/themes/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/themes/index.tcl,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-subsite/www/admin/themes/index.tcl 23 Jan 2017 13:16:26 -0000 1.1.2.1
@@ -0,0 +1,107 @@
+ad_page_contract {
+ Themes
+
+ @author Gustaf Neumann
+ @creation-date 2017-01-20
+} {
+ {rename_theme ""}
+}
+
+set page_title [_ acs-subsite.Themes]
+set context [list $page_title]
+
+set subsite_node_id [ad_conn subsite_node_id]
+
+list::create \
+ -name themes \
+ -multirow themes \
+ -key key \
+ -pass_properties rename_theme \
+ -page_query_name select_themes \
+ -elements {
+
+ key {
+ label "[_ acs-subsite.Key]"
+ }
+ name {
+ label "[_ acs-subsite.Name]"
+ }
+ active_p {
+ label "[_ acs-subsite.Active_theme]"
+ display_template {
+
+
+
+
+
+
+
+
+ }
+ }
+ modified_p {
+ label "[_ acs-subsite.Modified_theme]"
+ display_template {
+
+
+
+
+
+
+ Save new
+
+
+ }
+ }
+ delete {
+ sub_class narrow
+ display_template {
+
+
+
+ }
+ link_url_eval {[export_vars -base delete { {theme $key} }]}
+ link_html { title "#acs-subsite.Delete_this_theme#" }
+ }
+ }
+
+set subsite_id [ad_conn subsite_id]
+set currentThemeKey [parameter::get -parameter ThemeKey -package_id $subsite_id]
+set settings {
+ template DefaultMaster
+ css ThemeCSS
+ js ThemeJS
+ form_template DefaultFormStyle
+ list_template DefaultListStyle
+ list_filter_template DefaultListFilterStyle
+ dimensional_template DefaultDimensionalStyle
+ resource_dir ResourceDir
+ streaming_head StreamingHead
+}
+
+db_multirow -extend {active_p modified_p} themes select_themes {} {
+ set active_p [expr {$currentThemeKey eq $key}]
+ set modified_p 0
+ if {$active_p} {
+ foreach {var param} $settings {
+ set modified_p [expr {[set $var] ne [parameter::get -parameter $param -package_id $subsite_id]}]
+ if {$modified_p} {
+ break
+ }
+ }
+ }
+}
+
+
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/acs-subsite/www/admin/themes/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/themes/index.xql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-subsite/www/admin/themes/index.xql 23 Jan 2017 13:16:26 -0000 1.1.2.1
@@ -0,0 +1,12 @@
+
+
+
+ postgresql7.1
+
+
+
+ select * from subsite_themes
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/acs-subsite/www/admin/themes/save-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/themes/save-new.tcl,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-subsite/www/admin/themes/save-new.tcl 23 Jan 2017 13:16:26 -0000 1.1.2.1
@@ -0,0 +1,31 @@
+ad_page_contract {
+ Save current settings as a theme with a new key and name
+
+ @author Gustaf Neumann
+ @creation-date 2017-01-20
+} {
+ new_theme:word,trim
+ new_name:trim
+} -validate {
+ new_theme_valid -requires new_theme {
+ if {[db_string check_exists_theme {
+ select 1 from subsite_themes where key = :new_theme
+ } -default 0]} {
+ ad_complain "Theme with key '$new_theme' exists already"
+ }
+ }
+}
+
+#
+# Save the current setting under a new name
+#
+subsite::save_theme_parameters_as \
+ -theme $new_theme \
+ -pretty_name $new_name
+
+#
+# ... and actiate the new theme automatically
+#
+subsite::set_theme -theme $new_theme
+
+ns_returnredirect "."
Index: openacs-4/packages/acs-subsite/www/admin/themes/set.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/themes/set.tcl,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-subsite/www/admin/themes/set.tcl 23 Jan 2017 13:16:26 -0000 1.1.2.1
@@ -0,0 +1,20 @@
+ad_page_contract {
+ Set the theme to the specified key
+
+ @author Gustaf Neumann
+ @creation-date 2017-01-20
+} {
+ theme:trim
+} -validate {
+ new_key_valid -requires new_key {
+ if {![db_string check_exists_theme {
+ select 1 from subsite_themes where key = :theme
+ } -default 0]} {
+ ad_complain "Theme with key '$theme' does not exist"
+ }
+ }
+}
+
+subsite::set_theme -theme $theme
+
+ns_returnredirect "."