summaryrefslogtreecommitdiffstats
path: root/template/en/default/global/header.html.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'template/en/default/global/header.html.tmpl')
-rw-r--r--template/en/default/global/header.html.tmpl21
1 files changed, 15 insertions, 6 deletions
diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl
index 3d7fc2e68..75fa71825 100644
--- a/template/en/default/global/header.html.tmpl
+++ b/template/en/default/global/header.html.tmpl
@@ -52,6 +52,7 @@
[% SET yui_css = {
autocomplete => 1,
calendar => 1,
+ datatable => 1,
} %]
[%# Note: This is simple dependency resolution--you can't have dependencies
@@ -60,6 +61,7 @@
#%]
[% SET yui_deps = {
autocomplete => ['json', 'connection', 'datasource'],
+ datatable => ['json', 'connection', 'datasource', 'element'],
} %]
@@ -99,7 +101,20 @@
[% END %]
[% style_urls.unshift('skins/standard/global.css') %]
+ [%# YUI dependency resolution %]
+ [%# We have to do this in a separate array, because modifying the
+ # existing array by unshift'ing dependencies confuses FOREACH.
+ #%]
+ [% SET yui_resolved = [] %]
+ [% FOREACH yui_name = yui %]
+ [% FOREACH yui_dep = yui_deps.${yui_name}.reverse %]
+ [% yui_resolved.push(yui_dep) IF NOT yui_resolved.contains(yui_dep) %]
+ [% END %]
+ [% yui_resolved.push(yui_name) IF NOT yui_resolved.contains(yui_name) %]
+ [% END %]
+ [% SET yui = yui_resolved %]
+ [%# YUI CSS %]
[% FOREACH yui_name = yui %]
[% IF yui_css.$yui_name %]
<link rel="stylesheet" type="text/css"
@@ -218,12 +233,6 @@
<script src="js/yui/yahoo-dom-event/yahoo-dom-event.js"
type="text/javascript"></script>
<script src="js/yui/cookie/cookie-min.js" type="text/javascript"></script>
- [%# Resolve YUI dependencies. Note that CSS was already done above. %]
- [% FOREACH yui_name = yui %]
- [% IF yui_deps.$yui_name %]
- [% yui = yui_deps.${yui_name}.merge(yui) %]
- [% END %]
- [% END %]
[% FOREACH yui_name = yui %]
<script type="text/javascript"
src="js/yui/[% yui_name FILTER html %]/