summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/theme.inc29
-rw-r--r--modules/admin.module4
-rw-r--r--themes/marvin/marvin.theme3
-rw-r--r--themes/unconed/unconed.theme3
4 files changed, 35 insertions, 4 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index f4ef6a08c..7013c965d 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -22,7 +22,7 @@ class BaseTheme {
$output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n";
$output .= "<html><head><title>". variable_get(site_name, "drupal") ."</title>";
$output .= theme_head($main);
- $output .= "</head><body bgcolor=\"$this->background\" text=\"$this->foreground\">";
+ $output .= "</head><body bgcolor=\"$this->background\" text=\"$this->foreground". theme_onload_attribute(). "\">";
$output .= "<table border=\"0\" cellspacing=\"4\" cellpadding=\"4\"><tr><td valign=\"top\" width=\"170\">";
print $output;
@@ -77,6 +77,7 @@ class BaseTheme {
function footer() {
$output = "</td></tr></table>";
+ $output .= theme_footer();
$output .= "</body></html>";
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 </body> 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 e6b03e66d..670c85122 100644
--- a/modules/admin.module
+++ b/modules/admin.module
@@ -40,8 +40,9 @@ function admin_page() {
<style type="text/css" title="layout" media="Screen">
@import url("misc/admin.css");
</style>
+ <?php print theme_head(); ?>
</head>
- <body>
+ <body<?php print theme_onload_attribute(); ?>>
<?php
// NOTE: we include a dummy "print.css" to remove the "flash of unstyled content" (FUOC) problems in IE.
@@ -87,6 +88,7 @@ function admin_page() {
echo "<h1><a href=\"index.php\">". variable_get("site_name", "drupal") ."</a></h1>";
print menu_tree("admin") ;
print "</div>";
+ print theme_footer();
?>
</body>
</html>
diff --git a/themes/marvin/marvin.theme b/themes/marvin/marvin.theme
index f5be8c15a..abc582278 100644
--- a/themes/marvin/marvin.theme
+++ b/themes/marvin/marvin.theme
@@ -64,7 +64,7 @@
-->
</style>
</head>
- <body text="#000000" bgcolor="#ffffff" alink="#cccccc" link="#665566" vlink="#665566">
+ <body text="#000000" bgcolor="#ffffff" alink="#cccccc" link="#665566" vlink="#665566"<?php print theme_onload_attribute(); ?>>
<table border="0" cellpadding="8" cellspacing="0">
<tr>
<td><a href="index.php"><img src="<?php print $this->path; ?>/images/logo.png" alt="" border="0" /></a></td>
@@ -195,6 +195,7 @@
</td>
</tr>
</table>
+ <?php print theme_footer(); ?>
</body>
</html>
<?php
diff --git a/themes/unconed/unconed.theme b/themes/unconed/unconed.theme
index 7fddff88f..41ad41dfc 100644
--- a/themes/unconed/unconed.theme
+++ b/themes/unconed/unconed.theme
@@ -65,7 +65,7 @@
-->
</STYLE>
</HEAD>
- <BODY TEXT="#000000" BGCOLOR="<?php print $this->clc0; ?>" ALINK="#000000" LINK="#404040" VLINK="#404040" MARGINHEIGHT="10" MARGINWIDTH="10">
+ <BODY TEXT="#000000" BGCOLOR="<?php print $this->clc0; ?>" ALINK="#000000" LINK="#404040" VLINK="#404040" MARGINHEIGHT="10" MARGINWIDTH="10"<?php print theme_onload_attribute(); ?>>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" ALIGN="CENTER" WIDTH="100%">
<TR><TD BGCOLOR="<?php print $this->cl00; ?>"><IMG SRC="<?php print $this->path; ?>/images/null.gif" WIDTH="10"></TD><TD BGCOLOR="<?php print $this->clc0; ?>"><IMG SRC="<?php print $this->path; ?>/images/null.gif" WIDTH="4"></TD>
<TD BGCOLOR="<?php print $this->cl80; ?>">
@@ -218,6 +218,7 @@
</TABLE>
</TD><TD BGCOLOR="<?php print $this->clc0; ?>"><IMG SRC="<?php print $this->path; ?>/images/null.gif" WIDTH="4"></TD><TD BGCOLOR="<?php print $this->cl00; ?>"><IMG SRC="<?php print $this->path; ?>/images/null.gif" WIDTH="10"></TD></TR>
</TABLE>
+ <?php print theme_footer(); ?>
</BODY>
</HTML>
<?php