X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fheader.php;h=7dbc6b3e324e7825e7828fd7c5285a4f985ab5a1;hb=5c0d2c01826cb3802aed682513b7f98454394867;hp=015b9e43b358b39e8f48b630b5189013185a5dd6;hpb=5ef6ed7373ae85e5635e39e2a0adf9496a8add05;p=mailer.git
diff --git a/inc/header.php b/inc/header.php
index 015b9e43b3..7dbc6b3e32 100644
--- a/inc/header.php
+++ b/inc/header.php
@@ -1,7 +1,7 @@
\n");
- $header = 1;
- }
-
- // Set unsetted variables
- if (empty($_GET['frame'])) $_GET['frame'] = "";
-
- // Load body or not
- if (((!frameset_active) && ($GLOBALS['module'] != "frametester")) || (($header == "1") && ($GLOBALS['module'] == "frametester") && (!empty($_GET['frame']))) && ($CSS != "1")) {
- // Is the header sent and the script is not the mail confirmation script and not a CSS?
- if (($header == "1") && (basename($_SERVER['PHP_SELF']) != "mailid.php") && ($CSS != "1")) {
- // Add BODY tag
- LOAD_TEMPLATE("page_body");
- $header = 2;
- }
- }
-} else {
- // Something is missing
- die ("Fatal error: You have to define frameset_active!");
-}
-//
+if (!defined('__SECURITY')) {
+ die();
+} // END - if
+
+// Init header
+$GLOBALS['__page_header'] = '';
+
+// Is the header already sent?
+if (($GLOBALS['__header_sent'] != 1) && ($GLOBALS['__header_sent'] != 2)) {
+ // Set default HTTP status to "200 OK"
+ setHttpStatus('200 OK');
+
+ // If not in CSS mode generate the header
+ if ((!isCssOutputMode()) && (!isAjaxOutputMode()) && (!isImageOutputMode())) {
+ // Prepare the header for HTML output
+ loadHtmlHeader();
+ } // END - if
+
+ // Closing HEAD tag
+ if ($GLOBALS['__header_sent'] == '0') {
+ $GLOBALS['__header_sent'] = 1;
+ } // END - if
+} // END - if
+
+// Add BODY tag or not?
+// @TODO Find a way to not use direct module comparison
+if ((!isCssOutputMode()) && (!isRawOutputMode()) && ($GLOBALS['__header_sent'] == 1) && (getModule() != 'frametester') && (!isFramesetModeEnabled())) {
+ loadTemplate('page_body');
+ $GLOBALS['__header_sent'] = 2;
+} // END - if
+
+// [EOF]
?>