git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13379
7612ce4b-ef26-0410-bec9-
ea0150e637f0
* Given a path to a SquirrelMail file, return a HTML link to it
*
* @param string path the SquirrelMail file to link to
* Given a path to a SquirrelMail file, return a HTML link to it
*
* @param string path the SquirrelMail file to link to
+ * (should start with something like "src/..." or
+ * "functions/..." or "plugins/..." etc.)
* @param string text the link text
* @param string target the target frame for this link
*/
* @param string text the link text
* @param string target the target frame for this link
*/
* @param array color the array of theme colors
* @param string mailbox the current mailbox name to display
* @param string sHeaderJs javascipt code to be inserted in a script block in the header
* @param array color the array of theme colors
* @param string mailbox the current mailbox name to display
* @param string sHeaderJs javascipt code to be inserted in a script block in the header
- * @param string sBodyTagJs js events to be inserted in the body tag
+ * @param string sOnload JavaScript code to be added inside the body's onload handler
+ * as of 1.5.2, this replaces $sBodyTagJs argument
-
-function displayPageHeader($color, $mailbox='', $sHeaderJs='', $sBodyTagJs = '') {
+function displayPageHeader($color, $mailbox='', $sHeaderJs='', $sOnload = '') {
global $reply_focus, $hide_sm_attributions, $frame_top,
$provider_name, $provider_uri, $startMessage,
$action, $oTemplate, $org_title, $base_uri,
$data_dir, $username;
global $reply_focus, $hide_sm_attributions, $frame_top,
$provider_name, $provider_uri, $startMessage,
$action, $oTemplate, $org_title, $base_uri,
$data_dir, $username;
-//FIXME: $sBodyTag should be turned into $sOnload and should only contain the contents of the onload attribute (not the attribute name nor any quotes).... only question is if anyone was using $sBodyTag for anything but onload event handlers? (see function compose_Header() below for how to fix it once we confirm it can be changed)
- if (empty($sBodyTagJs)) {
if (strpos($action, 'reply') !== FALSE && $reply_focus) {
if (strpos($action, 'reply') !== FALSE && $reply_focus) {
- if ($reply_focus == 'select')
- $sBodyTagJs = 'onload="checkForm(\'select\');"';
- else if ($reply_focus == 'focus')
- $sBodyTagJs = 'onload="checkForm(\'focus\');"';
- else if ($reply_focus != 'none')
- $sBodyTagJs = 'onload="checkForm();"';
+ if ($reply_focus == 'select')
+ $sOnload = 'checkForm(\'select\');';
+ else if ($reply_focus == 'focus')
+ $sOnload = 'checkForm(\'focus\');';
+ else if ($reply_focus != 'none')
+ $sOnload = 'checkForm();';
- $sBodyTagJs = 'onload="checkForm();"';
+ $sOnload = 'checkForm();';
}
$startMessage = (int)$startMessage;
}
$startMessage = (int)$startMessage;
-//FIXME: does checkForJavascript() make the 2nd part of the if() below unneccessary??
+//FIXME: does checkForJavascript() make the 2nd part of the if() below unneccessary?? (that is, I think checkForJavascript() might already look for new_js_autodetect_results...(?))
if( checkForJavascript() || strpos($sHeaderJs, 'new_js_autodetect_results.value') ) {
$js_includes = $oTemplate->get_javascript_includes(TRUE);
$sJsBlock = '';
if( checkForJavascript() || strpos($sHeaderJs, 'new_js_autodetect_results.value') ) {
$js_includes = $oTemplate->get_javascript_includes(TRUE);
$sJsBlock = '';
} else {
/* do not use JavaScript */
displayHtmlHeader ($org_title);
} else {
/* do not use JavaScript */
displayHtmlHeader ($org_title);
$provider_link = create_hyperlink($provider_uri, $provider_name, '_blank');
}
$provider_link = create_hyperlink($provider_uri, $provider_name, '_blank');
}
- $oTemplate->assign('body_tag_js', $sBodyTagJs);
+ $oTemplate->assign('onload', $sOnload);
$oTemplate->assign('shortBoxName', $shortBoxName);
$oTemplate->assign('provider_link', $provider_link);
$oTemplate->assign('frame_top', $frame_top);
$oTemplate->assign('shortBoxName', $shortBoxName);
$oTemplate->assign('provider_link', $provider_link);
$oTemplate->assign('frame_top', $frame_top);
$sOnload = 'checkForm();';
}
else
$sOnload = 'checkForm();';
}
else
- $sOnload = 'checkForm();';
+ $sOnload = 'checkForm();';
} else {
/* javascript off */
displayHtmlHeader(_("Compose"));
} else {
/* javascript off */
displayHtmlHeader(_("Compose"));
}
// FIXME: change the colorization attributes below to a CSS class!
}
// FIXME: change the colorization attributes below to a CSS class!
} else {
$sHeaderJs = (isset($sHeaderJs)) ? $sHeaderJs : '';
if (strpos($action, 'reply') !== false && $reply_focus) {
} else {
$sHeaderJs = (isset($sHeaderJs)) ? $sHeaderJs : '';
if (strpos($action, 'reply') !== false && $reply_focus) {
- $sBodyTagJs = 'onload="checkForm(\''.$replyfocus.'\');"';
+ $sOnload = 'checkForm(\''.$replyfocus.'\');';
- $sBodyTagJs = 'onload="checkForm();"';
+ $sOnload = 'checkForm();';
- displayPageHeader($color, $mailbox,$sHeaderJs,$sBodyTagJs);
+ displayPageHeader($color, $mailbox,$sHeaderJs,$sOnload);
}
showInputForm($session, false);
exit();
}
showInputForm($session, false);
exit();
$help_link = makeInternalLink ('src/help.php', $help_str);
?>
$help_link = makeInternalLink ('src/help.php', $help_str);
?>
-<body <?php echo $body_tag_js; ?>>
+<body <?php if (!empty($onload)) echo ' onload="' . $onload . '"'; ?>>
<div id="page_header">
<a name="pagetop"></a>
<?php if (!empty($plugin_output['page_header_top'])) echo $plugin_output['page_header_top']; ?>
<div id="page_header">
<a name="pagetop"></a>
<?php if (!empty($plugin_output['page_header_top'])) echo $plugin_output['page_header_top']; ?>
$help_link = makeInternalLink ('src/help.php', $help_str);
?>
$help_link = makeInternalLink ('src/help.php', $help_str);
?>
-<body <?php echo $body_tag_js; ?>>
+<body <?php if (!empty($onload)) echo ' onload="' . $onload . '"'; ?>>
<?php
/** if preview pane turned on, do not show menubar above message */
<?php
/** if preview pane turned on, do not show menubar above message */