Fixes for broken order page and themes
[mailer.git] / inc / footer.php
index 69b37d9c7f3c8e2be93a65836171d469639a1a33..9c97434af5092f2a7b4a73b4ecf7266927e698b8 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Den Fuss des HTML-Codes hinzufuegen              *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * MA  02110-1301  USA                                                  *
  ************************************************************************/
 
-// Global variable stuff
-global $link, $frame, $CSS, $header;
-
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-}
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
 
-if (($footer != "1") && ($footer != "2") && ($CSS != "1")) {
-       // Output the generated HTML code or do nothing in direct-mode
-       if (!empty($FATAL[0])) {
-               // Output fatal error messages
-               require_once(PATH."inc/fatal_errors.php");
-       }
+// Footer disabled or already sent?
+// 1234      5                       54    45                              5    5                              543    3                              321
+if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != '1') && ($GLOBALS['footer_sent'] != '2'))) && (getOutputMode() != '1'))) {
+       // @TODO Rewrite these all into filters
+       // Handle fatal errors
+       handleFatalErrors();
 
        // Shall we display the copyright notice?
-       if ((empty($frame)) && (empty($_GET['frame'])) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && (isBooleanConstantAndTrue('WRITE_FOOTER'))) {
-               LOAD_TEMPLATE("copyright");
-       }
+       if ((!isGetRequestElementSet('frame')) && (basename($_SERVER['PHP_SELF']) != 'mailid_top.php') && ((getConfig('WRITE_FOOTER') == 'Y') || (isInstalling())) && ($GLOBALS['header_sent'] == '2')) {
+               // Backlink enabled?
+               if ((getConfig('ENABLE_BACKLINK') == 'Y') || (isInstalling())) {
+                       // Copyright with backlink, thanks! :-)
+                       loadTemplate('copyright_backlink');
+               } else {
+                       // No backlink in Copyright note
+                       loadTemplate('copyright');
+               }
+       } // END - if
 
        // Shall we display the parsing time and number of queries?
-       if ((isset($_CONFIG['show_timings'])) && ($_CONFIG['show_timings'] == "Y") && (empty($_GET['frame']))) {
+       if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestElementSet('frame'))) || (isInstallationPhase())) && ($GLOBALS['header_sent'] == '2')) {
                // Then display it here
-               DISPLAY_PARSING_TIME_FOOTER();
-       }
+               displayParsingTime();
+       } // END - if
 
-       // Load page footer
-       LOAD_TEMPLATE("page_footer");
+       // Shall we display SQL queries?
+       if ((isAdmin()) && (isExtensionInstalledAndNewer('other', '0.2.2')) && (getConfig('display_debug_sqls') == 'Y') && (!isGetRequestElementSet('frame')) && ($GLOBALS['header_sent'] == '2')) {
+               // Then display it here
+               displayDebugSqls();
+       } // END - if
 
-       // And the last closing HTML tag
-       OUTPUT_HTML("</HTML>");
+       // Shall we include the uberwach snippet?
+       if ((!isGetRequestElementSet('frame')) && (isExtensionActive('uberwach')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == '2')) {
+               // Then display it here
+               loadUberwachSnippet();
+       } // END - if
 
-       // Footer has been reached
-       $footer = 1;
+       // Load page footer
+       loadTemplate('page_footer');
 
-       // Output HTML code
-       OUTPUT_HTML("");
+       // And the last closing HTML tag
+       outputHtml('</html>');
+} // END - if
 
-       if (is_resource($link)) {
-               // Close link
-               SQL_CLOSE($link, __FILE__, __LINE__);
-       } else {
-               // No database link
-               ADD_FATAL(NO_DB_LINK);
-       }
-} elseif ($CSS == "1") {
-       // Footer has been reached
-       $footer = 1;
+// Footer has been reached
+$GLOBALS['footer_sent'] = 1;
 
-       // Output CSS content
-       OUTPUT_HTML("");
-}
+// Shutdown
+shutdown();
 
-//
+// [EOF]
 ?>