summaryrefslogtreecommitdiff
path: root/includes/theme.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-04-21 13:56:09 +0000
committerDries Buytaert <dries@buytaert.net>2003-04-21 13:56:09 +0000
commitb505b5ab65276e36053ef76c81eddc8bfaf61585 (patch)
treebb9887ed777bdacbe73028c857600cf880887194 /includes/theme.inc
parentcfb4d31f65b39a51e61676662e2995037332b02c (diff)
downloadbrdo-b505b5ab65276e36053ef76c81eddc8bfaf61585.tar.gz
brdo-b505b5ab65276e36053ef76c81eddc8bfaf61585.tar.bz2
- Committed Gordon's htmlarea patch.
Diffstat (limited to 'includes/theme.inc')
-rw-r--r--includes/theme.inc29
1 files changed, 28 insertions, 1 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;
+}
+
?>