X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fpage_header.php;h=199a80f0085d610ef7d45c2c882cbc0e8b0a582f;hb=292a9c3288eedd9e5eb89b053b24385b5473b311;hp=93b7d8b3af2a26820d845fb9bf9d2f9bbfbc2d1c;hpb=81de00c0eba6c2f4aebcfdd24124be99a3996871;p=squirrelmail.git diff --git a/functions/page_header.php b/functions/page_header.php index 93b7d8b3..199a80f0 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -11,15 +11,8 @@ * @package squirrelmail */ -/** @ignore */ -if (! defined('SM_PATH')) define('SM_PATH','../'); - /** Include required files from SM */ -require_once(SM_PATH . 'functions/strings.php'); -require_once(SM_PATH . 'functions/html.php'); -require_once(SM_PATH . 'functions/imap_mailbox.php'); -require_once(SM_PATH . 'functions/global.php'); -include_once(SM_PATH . 'class/template/template.class.php'); +include_once(SM_PATH . 'functions/imap_mailbox.php'); /** * Output a SquirrelMail page header, from to @@ -34,12 +27,12 @@ include_once(SM_PATH . 'class/template/template.class.php'); * @return void */ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE, $frames = FALSE ) { - global $squirrelmail_language, $sTplDir, $oErroHandler; + global $squirrelmail_language, $sTplDir, $oErrorHandler; if ( !sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) { global $base_uri; } - global $theme_css, $custom_css, $pageheader_sent, $theme, $theme_default, + global $theme_css, $custom_css, $pageheader_sent, $theme, $theme_default, $text_direction, $default_fontset, $chosen_fontset, $default_fontsize, $chosen_fontsize, $chosen_theme; /* add no cache headers here */ @@ -68,8 +61,8 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE .'?themeid='.$used_theme .'&templateid='.basename($sTplDir) .(!empty($used_fontset) ? '&fontset='.$used_fontset : '') - .(!empty($used_fontsize) ? '&fontsize='.$used_fontsize : '')."\">\n"; - + .(!empty($used_fontsize) ? '&fontsize='.$used_fontsize : '') + .(!empty($text_direction) ? '&dir='.$text_direction : '')."\">\n"; // load custom style sheet (deprecated) if ( ! empty($theme_css) ) { @@ -95,16 +88,14 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE /* work around IE6's scrollbar bug */ echo << + ECHO; @@ -113,7 +104,7 @@ ECHO; /* this is used to check elsewhere whether we should call this function */ $pageheader_sent = TRUE; if (isset($oErrorHandler)) { - $oErrorHander->HeaderSent(); + $oErrorHandler->HeaderSent(); } } @@ -125,7 +116,8 @@ ECHO; * @param string target the target frame for this link */ function makeInternalLink($path, $text, $target='') { - sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION); + global $base_uri; +// sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION); if ($target != '') { $target = " target=\"$target\""; } @@ -194,7 +186,11 @@ function displayPageHeader($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') { } if( $javascript_on || strpos($sHeaderJs, 'new_js_autodetect_results.value') ) { - $sJsBlock = '' ."\n"; + $js_includes = $oTemplate->getJavascriptIncludes(); + $sJsBlock = ''; + foreach ($js_includes as $js_file) { + $sJsBlock .= '' ."\n"; + } if ($sHeaderJs) { $sJsBlock .= "\n