Commit 56d0d76f authored by Dries's avatar Dries

- Patch #27884 by gordon: js addLoadEvent not working.

parent 10d7f773
......@@ -395,7 +395,7 @@ function theme_page($content) {
$output .= theme_get_styles();
$output .= ' </head>';
$output .= ' <body style="background-color: #fff; color: #000;"'. theme('onload_attribute'). '">';
$output .= ' <body style="background-color: #fff; color: #000;">';
$output .= '<table border="0" cellspacing="4" cellpadding="4"><tr><td style="vertical-align: top; width: 170px;">';
$output .= theme('blocks', 'all');
......@@ -909,28 +909,6 @@ function theme_closure($main = 0) {
return implode("\n", $footer);
}
/**
* Call hook_onload() in all modules to enable modules to insert JavaScript that
* will get run once the page has been loaded by the browser.
*
* @param $theme_onloads
* Additional onload directives.
* @return
* A string containing the onload attributes.
*/
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 '';
}
/**
* Return a set of blocks available for the current user.
*
......
......@@ -8,7 +8,7 @@
<script type="text/javascript"><?php /* Needed to avoid Flash of Unstyle Content in IE */ ?> </script>
</head>
<body<?php print $onload_attributes ?>>
<body>
<table border="0" cellpadding="0" cellspacing="0" id="header">
<tr>
......
......@@ -38,7 +38,7 @@ function chameleon_page($content) {
$output .= " <link rel=\"stylesheet\" type=\"text/css\" href=\"themes/chameleon/common.css\" />\n";
$output .= theme_get_styles();
$output .= "</head>";
$output .= "<body". theme_onload_attribute() .">\n";
$output .= "<body>\n";
$output .= " <div id=\"header\">";
if ($logo = theme_get_setting('logo')) {
......
......@@ -197,7 +197,6 @@ function phptemplate_page($content) {
'logo' => theme_get_setting('logo'),
'messages' => theme('status_messages'),
'mission' => isset($mission) ? $mission : '',
'onload_attributes' => theme('onload_attribute'),
'primary_links' => menu_primary_links(),
'search_box' => (theme_get_setting('toggle_search') ? search_box() : ''),
'secondary_links' => menu_secondary_links(),
......
......@@ -7,7 +7,7 @@
<?php print $styles ?>
</head>
<body bgcolor="#ffffff" <?php print theme("onload_attribute"); ?>>
<body bgcolor="#ffffff">
<div class="hide"><a href="#content" title="Skip navigation." accesskey="2">Skip navigation</a>.</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment