From b505b5ab65276e36053ef76c81eddc8bfaf61585 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 21 Apr 2003 13:56:09 +0000 Subject: [PATCH] - Committed Gordon's htmlarea patch. --- includes/theme.inc | 29 ++++++++++++++++++++++++++++- modules/admin.module | 4 +++- themes/marvin/marvin.theme | 3 ++- themes/unconed/unconed.theme | 3 ++- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/includes/theme.inc b/includes/theme.inc index f4ef6a08cb2..7013c965d5c 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -22,7 +22,7 @@ class BaseTheme { $output = "\n"; $output .= "". variable_get(site_name, "drupal") .""; $output .= theme_head($main); - $output .= "background\" text=\"$this->foreground\">"; + $output .= "background\" text=\"$this->foreground". theme_onload_attribute(). "\">"; $output .= "
"; print $output; @@ -77,6 +77,7 @@ class BaseTheme { function footer() { $output = "
"; + $output .= theme_footer(); $output .= ""; print $output; } @@ -141,6 +142,15 @@ function theme_head($main = 0) { return implode($head, "\n"); } +/* + * Execute hook _footer() which is run at the end of the page right before + * the tag + */ +function theme_footer($main = 0) { + $footer = module_invoke_all("footer", $main); + return implode($footer, "\n"); +} + function theme_init() { global $user; @@ -194,4 +204,21 @@ function theme() { } } +/* + * Call _onload hook in all modules to enable modules to insert javascript + * that will get run once the page has been loaded by the browser + */ +function theme_onload_attribute($theme_onloads = array()) { + if (!is_array($theme_onloads)) { + $theme_onloads = array($theme_onloads); + } + // Merge theme onloads (javascript rollovers, image preloads, etc.) + // with module onloads (htmlarea, etc.) + $onloads = array_merge(module_invoke_all("onload"), $theme_onloads); + if (count($onloads)) { + return " onload=\"" . implode("; ", $onloads) . "\""; + } + return; +} + ?> diff --git a/modules/admin.module b/modules/admin.module index e6b03e66d24..670c851229a 100644 --- a/modules/admin.module +++ b/modules/admin.module @@ -40,8 +40,9 @@ function admin_page() { + - + > ". variable_get("site_name", "drupal") .""; print menu_tree("admin") ; print ""; + print theme_footer(); ?> diff --git a/themes/marvin/marvin.theme b/themes/marvin/marvin.theme index f5be8c15a32..abc58227884 100644 --- a/themes/marvin/marvin.theme +++ b/themes/marvin/marvin.theme @@ -64,7 +64,7 @@ --> - + > @@ -195,6 +195,7 @@
+ - + >
@@ -218,6 +218,7 @@
+