Index: openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info,v
diff -u -r1.39.2.3 -r1.39.2.4
--- openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info 25 Aug 2015 17:16:35 -0000 1.39.2.3
+++ openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info 28 Aug 2015 09:06:01 -0000 1.39.2.4
@@ -9,7 +9,7 @@
f
t
-
+
Don Baccus
Bootstraps an OpenACS installation.
2015-08-17
@@ -18,8 +18,10 @@
GPL
3
-
+
+
+
Index: openacs-4/packages/acs-bootstrap-installer/installer/www/blank-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/installer/www/blank-master.tcl,v
diff -u -r1.2.2.2 -r1.2.2.3
--- openacs-4/packages/acs-bootstrap-installer/installer/www/blank-master.tcl 18 Aug 2015 11:17:15 -0000 1.2.2.2
+++ openacs-4/packages/acs-bootstrap-installer/installer/www/blank-master.tcl 28 Aug 2015 09:06:01 -0000 1.2.2.3
@@ -96,24 +96,43 @@
# Add css for the current subsite, defaulting to the old list/form css which was
# hard-wired in previous versions of OpenACS.
-set css [parameter::get -package_id [ad_conn subsite_id] -parameter ThemeCSS -default ""]
-if {$css ne "" } {
+set cssList [parameter::get -package_id [ad_conn subsite_id] -parameter ThemeCSS -default ""]
+if {![string is list $cssList]} {
+ ns_log error "ignore value in ThemeCSS, since it is not a valid list: $cssList"
+} elseif { [llength $cssList] > 0 } {
# DRB: Need to handle two cases, the lame first attempt and the more complete current
# attempt which allows you to specify all of the parameters to template::head::add_css
# (sigh, remove this kludge for 5.5.1). We need to handle the old case so upgrades
# to 5.5 for mgh and various of my sites work correctly.
+ #
+ # The following syntaxes are supported
+ #
+ # 1) pairs: {/resources/acs-templating/lists.css all} ...
+ # 2) nested list of pairs: {{href /resources/acs-templating/lists.css} {media all} ... } ...
+ # 3) flat list of -att val pairs: {-href /resources/acs-templating/lists.css -media all ... } ...
+ #
- foreach css $css {
- if { [llength $css] == 2 && [llength [lindex $css 0]] == 1 } {
- template::head::add_css -href [lindex $css 0] -media [lindex $css 1]
- } else {
+ foreach css $cssList {
+ set first [lindex $css 0]
+ if { [llength $css] == 2 && [llength $first] == 1 && [string range $first 0 0] ne "-"} {
+ template::head::add_css -href $first -media [lindex $css 1]
+ } elseif {[llength $first] == 2} {
set params [list]
foreach param $css {
lappend params -[lindex $param 0] [lindex $param 1]
}
- template::head::add_css {*}$params
- }
+ if {[catch {template::head::add_css {*}$params} errorMsg]} {
+ ns_log error $errorMsg
+ }
+ } else {
+ if {![string match -* [lindex $css 0]]} {
+ error "CSS specification '$css' is incorrect"
+ }
+ if {[catch {template::head::add_css {*}$css} errorMsg]} {
+ ns_log error $errorMsg
+ }
+ }
}
} else {
@@ -126,6 +145,22 @@
}
#
+# Add js files via ThemeJS for the current subsite, similar to
+# ThemeCSS. Syntax is the flat list syntax (3) from ThemeCSS, valid
+# parameters are determined by template::add_script. It is possible to
+# add head and body scripts.
+
+set jsSpecs [parameter::get -package_id [ad_conn subsite_id] -parameter ThemeJS -default ""]
+if {![string is list $jsSpecs]} {
+ ns_log error "ignore value in ThemeJS since it is not a valid list: $jsSpecs"
+} else {
+ foreach jsSpec $jsSpecs {
+ if {[catch {template::add_script {*}$jsSpec} errorMsg]} {
+ ns_log error $errorMsg
+ }
+ }
+}
+#
# Temporary (?) fix to get xinha working
#
if {[info exists ::acs_blank_master(xinha)]} {
@@ -221,7 +256,7 @@
ns_log warning "[ad_conn url] has no doc(title) set."
}
# AG: Markup in tags doesn't render well.
-set doc(title) [ns_striphtml $doc(title)]
+#set doc(title) [ns_striphtml $doc(title)]
if {![info exists doc(charset)]} {
set doc(charset) [ns_config ns/parameters OutputCharset [ad_conn charset]]
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.117.2.3 -r1.117.2.4
--- openacs-4/packages/acs-subsite/acs-subsite.info 27 Aug 2015 08:06:56 -0000 1.117.2.3
+++ openacs-4/packages/acs-subsite/acs-subsite.info 28 Aug 2015 09:06:01 -0000 1.117.2.4
@@ -9,7 +9,7 @@
t
t
-
+
OpenACS
Subsite
2015-06-16
@@ -18,7 +18,7 @@
GPL
3
-
+
@@ -128,9 +128,11 @@
-
+
+
Index: openacs-4/packages/acs-subsite/sql/oracle/themes-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/oracle/themes-create.sql,v
diff -u -r1.4.6.2 -r1.4.6.3
--- openacs-4/packages/acs-subsite/sql/oracle/themes-create.sql 27 Aug 2015 08:06:56 -0000 1.4.6.2
+++ openacs-4/packages/acs-subsite/sql/oracle/themes-create.sql 28 Aug 2015 09:06:01 -0000 1.4.6.3
@@ -19,6 +19,7 @@
constraint subsite_themes_template_nn
not null,
css varchar(2000),
+ js varchar(2000),
form_template varchar(200),
list_template varchar(200),
list_filter_template varchar(200),
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/sql/oracle/upgrade/upgrade-5.9.0d5-5.9.0d6.sql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/acs-subsite/sql/postgresql/themes-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/postgresql/themes-create.sql,v
diff -u -r1.3.6.2 -r1.3.6.3
--- openacs-4/packages/acs-subsite/sql/postgresql/themes-create.sql 27 Aug 2015 08:06:57 -0000 1.3.6.2
+++ openacs-4/packages/acs-subsite/sql/postgresql/themes-create.sql 28 Aug 2015 09:06:02 -0000 1.3.6.3
@@ -19,6 +19,7 @@
constraint subsite_themes_template_nn
not null,
css text,
+ js text,
form_template text,
list_template text,
list_filter_template text,
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/sql/postgresql/upgrade/upgrade-5.9.0d5-5.9.0d6.sql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/acs-subsite/tcl/subsite-navigation-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-navigation-procs.tcl,v
diff -u -r1.3 -r1.3.10.1
--- openacs-4/packages/acs-subsite/tcl/subsite-navigation-procs.tcl 11 Sep 2008 01:08:41 -0000 1.3
+++ openacs-4/packages/acs-subsite/tcl/subsite-navigation-procs.tcl 28 Aug 2015 09:06:02 -0000 1.3.10.1
@@ -55,7 +55,7 @@
if { ![template::multirow exists $navigation_multirow] } {
template::multirow create $navigation_multirow group label href target \
- title lang accesskey class id tabindex
+ title lang accesskey class id tabindex display_template
}
foreach { section_name section_spec } $pageflow {
@@ -67,6 +67,7 @@
folder {}
selected_patterns {}
accesskey {}
+ display_template {}
}
array set section_a $section_spec
@@ -88,6 +89,7 @@
url {}
selected_patterns {}
accesskey {}
+ display_template {}
}
array set subsection_a $subsection_spec
set subsection_a(name) $subsection_name
@@ -105,7 +107,7 @@
}
-ad_proc -public subsite_navigation::add_section_row {
+ad_proc -private subsite_navigation::add_section_row {
{-subsite_id ""}
{-array:required}
{-base_url:required}
@@ -119,8 +121,11 @@
} {
upvar $array info
# the folder index page is called .
- if { $info(url) eq "" || $info(url) eq "index" || \
- [string match "*/" $info(url)] || [string match "*/index" $info(url)] } {
+ if { $info(url) eq ""
+ || $info(url) eq "index"
+ || [string match "*/" $info(url)]
+ || [string match "*/index" $info(url)]
+ } {
set info(url) "[string range $info(url) 0 [string last / $info(url)]]."
}
@@ -165,8 +170,10 @@
set navigation_id ""
}
- template::multirow append $multirow $group $info(label) [file join $base_url $info(url)] \
- "" $info(title) "" $info(accesskey) "" $navigation_id [template::multirow size $multirow]
+ template::multirow append $multirow \
+ $group $info(label) [file join $base_url $info(url)] \
+ "" $info(title) "" $info(accesskey) "" $navigation_id [template::multirow size $multirow] \
+ $info(display_template)
return $selected_p
}
@@ -188,13 +195,29 @@
template::multirow foreach $navigation_multirow {
if { [template::util::is_true $selected_p] } {
- set row(label) $label
- set row(url) $url
+ array set row [list label $label url $url]
break
}
}
}
+ad_proc -private subsite_navigation::get_pageflow_from_parameter {
+ -parameter:required
+ -subsite_id:required
+} {
+ @param parameter subsite parameter name
+ @param subsite_id package_id of subsite
+ @return pageflow
+} {
+ set pageflow [parameter::get -package_id $subsite_id -parameter $parameter -default ""]
+ if { ![string is list $pageflow]} {
+ ns_log Warning "subsite_navigation: ignoring invalid $parameter: $pageflow"
+ set pageflow ""
+ }
+ return $pageflow
+}
+
+
ad_proc -public subsite_navigation::get_pageflow_struct {
{-subsite_id ""}
{-initial_pageflow ""}
@@ -210,6 +233,18 @@
@param no_tab_application_list A list of application package keys to ignore when
autogenerating tabs for applications
} {
+ if { ![string is list $initial_pageflow]} {
+ ns_log Warning "subsite_navigation: ignoring invalid initial_pageflow: $initial_pageflow"
+ set initial_pageflow ""
+ }
+ if { ![string is list $no_tab_application_list]} {
+ ns_log Warning "subsite_navigation: ignoring invalid no_tab_application_list: $no_tab_application_list"
+ set no_tab_application_list ""
+ }
+ if {$subsite_id eq ""} {
+ set subsite_id [ad_conn subsite_id]
+ }
+
set pageflow $initial_pageflow
set subsite_node_id [site_node::get_node_id_from_object_id -object_id $subsite_id]
set subsite_url [site_node::get_element -node_id $subsite_node_id -element url]
@@ -224,24 +259,29 @@
-party_id [ad_conn untrusted_user_id]]
set show_member_list_to [parameter::get -parameter "ShowMembersListTo" -package_id $subsite_id -default 2]
- if { $admin_p || ($user_id != 0 && $show_member_list_to == 1) || \
- $show_member_list_to == 0 } {
- set pageflow [concat $pageflow [parameter::get -package_id [ad_conn subsite_id] \
- -parameter MembersViewNavbarTabsList -default ""]]
+ if { $admin_p
+ || ($user_id != 0 && $show_member_list_to == 1)
+ || $show_member_list_to == 0
+ } {
+ lappend pageflow {*}[subsite_navigation::get_pageflow_from_parameter \
+ -subsite_id $subsite_id \
+ -parameter MembersViewNavbarTabsList]
}
- set index_redirect_url [parameter::get -parameter "IndexRedirectUrl" -package_id $subsite_id]
- set index_internal_redirect_url [parameter::get -parameter "IndexInternalRedirectUrl" -package_id $subsite_id]
- regsub {(.*)/packages} $index_internal_redirect_url "" index_internal_redirect_url
- regexp {(/[-[:alnum:]]+/)(.*)$} $index_internal_redirect_url dummy index_internal_redirect_url
- set child_urls [lsort -ascii [site_node::get_children -node_id $subsite_node_id -package_type apm_application]]
-
if { $show_applications_p } {
+
+ set index_redirect_url [parameter::get -parameter "IndexRedirectUrl" -package_id $subsite_id]
+ set index_internal_redirect_url [parameter::get -parameter "IndexInternalRedirectUrl" -package_id $subsite_id]
+ regsub {(.*)/packages} $index_internal_redirect_url "" index_internal_redirect_url
+ regexp {(/[-[:alnum:]]+/)(.*)$} $index_internal_redirect_url dummy index_internal_redirect_url
+ set child_urls [lsort -ascii [site_node::get_children -node_id $subsite_node_id -package_type apm_application]]
+
foreach child_url $child_urls {
array set child_node [site_node::get_from_url -exact -url $child_url]
if { $child_url ne $index_redirect_url &&
$child_url ne $index_internal_redirect_url &&
- [lsearch -exact $no_tab_application_list $child_node(package_key)] == -1 } {
+ $child_node(package_key) ni $no_tab_application_list
+ } {
lappend pageflow $child_node(name) [list \
label $child_node(instance_name) \
folder $child_node(name) \
@@ -252,8 +292,9 @@
}
if { $admin_p } {
- set pageflow [concat $pageflow [parameter::get -package_id [ad_conn subsite_id] \
- -parameter AdminNavbarTabsList -default ""]]
+ lappend pageflow {*}[subsite_navigation::get_pageflow_from_parameter \
+ -subsite_id $subsite_id \
+ -parameter AdminNavbarTabsList]
}
return $pageflow
Index: openacs-4/packages/acs-templating/acs-templating.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/acs-templating.info,v
diff -u -r1.56.2.2 -r1.56.2.3
--- openacs-4/packages/acs-templating/acs-templating.info 25 Aug 2015 17:16:36 -0000 1.56.2.2
+++ openacs-4/packages/acs-templating/acs-templating.info 28 Aug 2015 09:06:02 -0000 1.56.2.3
@@ -9,7 +9,7 @@
f
t
-
+
OpenACS
Templating library.
2013-09-24
@@ -27,7 +27,7 @@
GPL version 2
3
-
+
Index: openacs-4/packages/acs-templating/tcl/head-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/head-procs.tcl,v
diff -u -r1.20 -r1.20.2.1
--- openacs-4/packages/acs-templating/tcl/head-procs.tcl 27 Oct 2014 16:40:11 -0000 1.20
+++ openacs-4/packages/acs-templating/tcl/head-procs.tcl 28 Aug 2015 09:06:02 -0000 1.20.2.1
@@ -37,8 +37,47 @@
set ::template::footers [list]
}
+ad_proc -public template::add_script {
+ {-type "text/javascript"}
+ {-defer:boolean}
+ {-async:boolean}
+ {-src ""}
+ {-charset ""}
+ {-script ""}
+ {-order "0"}
+ {-section "head"}
+} {
+ @param type the type attribute of the script tag, eg. 'text/javascript'
+ @param defer whether execution of the script should be defered until after
+ the page has been loaded
+ @param async whether execution of the script should be executed asynchronously
+ as soon as it is available
+ @param src the src attribute of the script tag, ie. the source url of the
+ script
+ @param charset the charset attribute of the script tag, ie. the character
+ set of the script if it differs from the main document
+ @param script the inline script for the body of the script tag. This
+ parameter will be ignored if a value has been supplied for src
+ @param order specify inclusion order
+ @param section section, where script is added ("head" or "body")
+} {
+ if {$section eq "head"} {
+ #
+ # A head script
+ #
+ ::template::head::add_script -type $type -defer=$defer_p -async=$async_p \
+ -src $src -charset $charset -script $script -order $order
+ } else {
+ #
+ # A body script. The order is ignored.
+ #
+ ::template::add_body_script -type $type -defer=$defer_p -async=$async_p \
+ -src $src -charset $charset -script $script
+ }
+}
+
ad_proc -public template::head::add_script {
- {-type:required}
+ {-type "text/javascript"}
{-defer:boolean}
{-async:boolean}
{-src ""}
@@ -63,8 +102,9 @@
@param charset the charset attribute of the script tag, ie. the character
set of the script if it differs from the main document
@param script the inline script for the body of the script tag. This
- parameter will be ignored if a value has been supplied for
- src
+ parameter will be ignored if a value has been supplied for src
+ @param order specify inclusion order
+
} {
variable ::template::head::scripts
@@ -318,7 +358,7 @@
}
ad_proc -public template::add_body_script {
- {-type:required}
+ {-type "text/javascript"}
{-defer:boolean}
{-async:boolean}
{-src ""}
Index: openacs-4/packages/openacs-default-theme/lib/tabbed-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/openacs-default-theme/lib/tabbed-master.tcl,v
diff -u -r1.2 -r1.2.10.1
--- openacs-4/packages/openacs-default-theme/lib/tabbed-master.tcl 26 Aug 2008 01:15:33 -0000 1.2
+++ openacs-4/packages/openacs-default-theme/lib/tabbed-master.tcl 28 Aug 2015 09:06:02 -0000 1.2.10.1
@@ -1,6 +1,7 @@
# Set the tabs then use the plain master to render the page.
-subsite_navigation::define_pageflow -navigation_multirow navigation -group main -subgroup sub \
+subsite_navigation::define_pageflow \
+ -navigation_multirow navigation -group main -subgroup sub \
-show_applications_p [parameter::get -package_id [ad_conn subsite_id] \
-parameter ShowApplications -default 1] \
-no_tab_application_list [parameter::get -package_id [ad_conn subsite_id] \
Index: openacs-4/packages/openacs-default-theme/tcl/apm-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/openacs-default-theme/tcl/apm-callback-procs.tcl,v
diff -u -r1.3.10.2 -r1.3.10.3
--- openacs-4/packages/openacs-default-theme/tcl/apm-callback-procs.tcl 27 Aug 2015 08:06:59 -0000 1.3.10.2
+++ openacs-4/packages/openacs-default-theme/tcl/apm-callback-procs.tcl 28 Aug 2015 09:06:02 -0000 1.3.10.3
@@ -13,25 +13,29 @@
-key default_plain \
-name #openacs-default-theme.plain# \
-template /packages/openacs-default-theme/lib/plain-master \
- -css {{{href /resources/openacs-default-theme/styles/default-master.css} {media all}}
- {{href /resources/acs-templating/forms.css} {media all}}
- {{href /resources/acs-templating/lists.css} {media all}}} \
+ -css {
+ {-href /resources/openacs-default-theme/styles/default-master.css -media all}
+ {-href /resources/acs-templating/forms.css -media all}
+ {-href /resources/acs-templating/lists.css -media all}
+ } \
-form_template /packages/acs-templating/resources/forms/standard \
-list_template /packages/acs-templating/resources/lists/table \
-list_filter_template /packages/acs-templating/resources/lists/filters \
- -dimensional_template /packages/acs-templating/resources/dimensional/dimensional-table
+ -dimensional_template /packages/acs-templating/resources/dimensional/dimensional
subsite::new_subsite_theme \
-key default_tabbed \
-name #openacs-default-theme.tabbed# \
-template /packages/openacs-default-theme/lib/tabbed-master \
- -css {{{href /resources/openacs-default-theme/styles/default-master.css} {media all}}
- {{href /resources/acs-templating/forms.css} {media all}}
- {{href /resources/acs-templating/lists.css} {media all}}} \
+ -css {
+ {-href /resources/openacs-default-theme/styles/default-master.css -media all}
+ {-href /resources/acs-templating/forms.css -media all}
+ {-href /resources/acs-templating/lists.css -media all}
+ } \
-form_template /packages/acs-templating/resources/forms/standard \
-list_template /packages/acs-templating/resources/lists/table \
-list_filter_template /packages/acs-templating/resources/lists/filters \
- -dimensional_template /packages/acs-templating/resources/dimensional/dimensional-table
+ -dimensional_template /packages/acs-templating/resources/dimensional/dimensional
}
# Set the default value of the master template parameter, so all subsites will
@@ -50,9 +54,11 @@
-value /packages/openacs-default-theme/lib/plain-master
parameter::set_default -package_key acs-subsite -parameter ThemeCSS \
- -value {{{href /resources/openacs-default-theme/styles/default-master.css} {media all}}
- {{href /resources/acs-templating/forms.css} {media all}}
- {{href /resources/acs-templating/lists.css} {media all}}}
+ -value {
+ {-href /resources/openacs-default-theme/styles/default-master.css -media all}
+ {-href /resources/acs-templating/forms.css -media all}
+ {-href /resources/acs-templating/lists.css -media all}
+ }
parameter::set_default -package_key acs-subsite -parameter ThemeKey -value default_plain
}