X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=functions%2Fpage_header.php;h=501d9745ef3f51e57e2065f22217a786c0607473;hb=e9e5a32294550b0f6c46d4c3f7f0945ab1bd0c55;hp=095638f07572b255a92d07d5d0950aff89cc570d;hpb=6182ab4dbd078c7b6855c6a25d7cd0b5d3f4258b;p=squirrelmail.git diff --git a/functions/page_header.php b/functions/page_header.php index 095638f0..501d9745 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -32,8 +32,9 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE if ( !sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) { global $base_uri; } - global $theme_css, $custom_css, $pageheader_sent, $theme, $theme_default, $text_direction, - $default_fontset, $chosen_fontset, $default_fontsize, $chosen_fontsize, $chosen_theme; + global $custom_css, $pageheader_sent, $theme, $theme_default, $text_direction, + $default_fontset, $chosen_fontset, $default_fontsize, $chosen_fontsize, + $chosen_theme, $chosen_theme_path, $user_themes, $user_theme_default; /* add no cache headers here */ //FIXME: should change all header() calls in SM core to use $oTemplate->header()!! @@ -49,26 +50,46 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE $used_fontset = (!empty($chosen_fontset) ? $chosen_fontset : $default_fontset); $used_fontsize = (!empty($chosen_fontsize) ? $chosen_fontsize : $default_fontsize); - $used_theme = basename((!empty($chosen_theme) ? $chosen_theme : $theme[$theme_default]['PATH']),'.php'); + $used_theme = !isset($chosen_theme) && $user_theme_default != 'none' && is_dir($chosen_theme) && is_readable($chosen_theme)? $user_themes[$user_theme_default]['PATH'].'/default.css' : $chosen_theme_path; + + /** + * Stylesheets are loaded in the following order: + * 1) All stylesheets provided by the template. Normally, these are + * stylsheets in templates/