]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Rewrites/fixes for broken template cache, the actual value was rendered but instead...
[mailer.git] / inc / functions.php
index f85b4df13e107b501931b6c35c2555f4ac387ff1..0a38bdf44108522f4896ade1a1f49c3f22d1dc43 100644 (file)
@@ -49,10 +49,6 @@ function outputHtml ($htmlCode, $newLine = true) {
                $GLOBALS['output'] = '';
        } // END - if
 
-       // Transfer username
-       $username = getMessage('USERNAME_UNKNOWN');
-       if (isset($GLOBALS['username'])) $username = getUsername();
-
        // Do we have HTML-Code here?
        if (!empty($htmlCode)) {
                // Yes, so we handle it as you have configured
@@ -266,9 +262,6 @@ function loadTemplate ($template, $return = false, $content = array()) {
                // Evaluate the cache
                eval(readTemplateCache($template));
        } elseif (!isset($GLOBALS['template_eval'][$template])) {
-               // Add more variables which you want to use in your template files
-               $username = getUsername();
-
                // Make all template names lowercase
                $template = strtolower($template);
 
@@ -1000,6 +993,9 @@ function redirectToUrl ($URL, $allowSpider = true) {
                // Clear own output buffer
                $GLOBALS['output'] = '';
 
+               // Set header
+               setHttpStatus('302 Found');
+
                // Load URL when headers are not sent
                sendHeader('Location: '.str_replace('&', '&', $URL));
        } else {
@@ -1074,11 +1070,11 @@ function compileRawCode ($code, $simple = false, $constants = true, $full = true
        if ($constants === true) {
                // BEFORE 0.2.1 : Language and data constants
                // WITH 0.2.1+  : Only language constants
-               $code = str_replace('{--', "\" . getMessage('", str_replace('--}', "') . \"", $code));
+               $code = str_replace('{--', "{DQUOTE} . getMessage('", str_replace('--}', "') . {DQUOTE}", $code));
 
                // BEFORE 0.2.1 : Not used
                // WITH 0.2.1+  : Data constants
-               $code = str_replace('{!', "\" . constant('", str_replace('!}', "') . \"", $code));
+               $code = str_replace('{!', "{DQUOTE} . constant('", str_replace('!}', "') . {DQUOTE}", $code));
        } // END - if
 
        // Compile QUOT and other non-HTML codes
@@ -2423,7 +2419,7 @@ function displayParsingTime () {
        // Prepare output
        // @TODO This can be easily moved out after the merge from EL branch to this is complete
        $content = array(
-               'run_time' => translateComma($runTime),
+               'run_time' => $runTime,
                'sql_time' => translateComma(getConfig('sql_time') * 1000),
        );
 
@@ -2640,7 +2636,7 @@ function getMessageFromErrorCode ($code) {
                        if (isExtensionActive('mailid', true)) {
                                $message = getMessage('ERROR_CONFIRMING_MAIL');
                        } else {
-                               $message = getMaskedMessage('EXTENSION_PROBLEM_NOT_INSTALLED', 'mailid');
+                               $message = getMaskedMessage('EXTENSION_PROBLEM_EXTENSION_NOT_INSTALLED', 'mailid');
                        }
                        break;
 
@@ -3615,9 +3611,6 @@ function flushTemplateCache ($template, $eval) {
                // Generate FQFN
                $FQFN = generateCacheFqfn($template);
 
-               // Replace username with a call
-               $eval = str_replace('$username', '".getUsername()."', $eval);
-
                // And flush it
                writeToFile($FQFN, $eval, true);
        } // END - if