]> git.mxchange.org Git - mailer.git/blobdiff - inc/template-functions.php
Even more language strings renamed
[mailer.git] / inc / template-functions.php
index aea217a7fa08e9253dee6faa4c6086b48658f6af..77fb6bf78bc63c109768aa342147cb5d52b8df1c 100644 (file)
@@ -155,7 +155,7 @@ function outputHtml ($htmlCode, $newLine = true) {
 
                        default:
                                // Huh, something goes wrong or maybe you have edited config.php ???
-                               debug_report_bug(__FUNCTION__, __LINE__, '<strong>{--FATAL_ERROR--}:</strong> {--LANG_NO_RENDER_DIRECT--}');
+                               debug_report_bug(__FUNCTION__, __LINE__, '<strong>{--FATAL_ERROR--}:</strong> {--NO_RENDER_DIRECT--}');
                                break;
                } // END - switch
        } elseif ((getPhpCaching() == 'on') && ((!isset($GLOBALS['header'])) || (count($GLOBALS['header']) == 0))) {
@@ -226,7 +226,7 @@ function compileFinalOutput () {
 }
 
 // Main compilation loop
-function doFinalCompilation ($code, $insertComments = true) {
+function doFinalCompilation ($code, $insertComments = true, $enableCodes = true) {
        // Insert comments? (Only valid with HTML templates, of course)
        enableTemplateHtml($insertComments);
 
@@ -240,8 +240,8 @@ function doFinalCompilation ($code, $insertComments = true) {
                $newContent = '';
 
                // Compile it
-               //* DEBUG: */ debugOutput('<pre>'.encodeEntities($code).'</pre>');
-               $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code))) . '";';
+               //* DEBUG: */ debugOutput('<pre>'.linenumberCode($code).'</pre>');
+               $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code), false, true, $enableCodes)) . '";';
                //* DEBUG: */ if (!$insertComments) print('<pre>'.linenumberCode($eval).'</pre>');
                eval($eval);
                //* DEBUG: */ die('<pre>'.encodeEntities($newContent).'</pre>');
@@ -444,12 +444,12 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0') {
        // Is content an array?
        if (is_array($content)) {
                // Add expiration to array
-               if ((isConfigEntrySet('auto_purge')) && (getConfig('auto_purge') == '0')) {
+               if ((isConfigEntrySet('auto_purge')) && (getAutoPurge() == '0')) {
                        // Will never expire!
                        $content['expiration'] = '{--MAIL_WILL_NEVER_EXPIRE--}';
                } elseif (isConfigEntrySet('auto_purge')) {
                        // Create nice date string
-                       $content['expiration'] = createFancyTime(getConfig('auto_purge'));
+                       $content['expiration'] = createFancyTime(getAutoPurge());
                } else {
                        // Missing entry
                        $content['expiration'] = '{--MAIL_NO_CONFIG_AUTO_PURGE--}';
@@ -458,7 +458,7 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0') {
 
        // Load user's data
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UID={$userid},template={$template},content[]=".gettype($content));
-       if (($userid > 0) && (is_array($content))) {
+       if ((isValidUserId($userid)) && (is_array($content))) {
                // If nickname extension is installed, fetch nickname as well
                if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) {
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NICKNAME!<br />");
@@ -1165,7 +1165,7 @@ function debug_report_bug ($F, $L, $message = '', $sendEmail = true) {
        // Is this already called?
        if (isset($GLOBALS[__FUNCTION__])) {
                // Other backtrace
-               print 'Message:'.$message.'<br />Backtrace:<pre>';
+               print 'Message:' . $message . '<br />Backtrace:<pre>';
                debug_print_backtrace();
                die('</pre>');
        } // END - if
@@ -1191,8 +1191,8 @@ function debug_report_bug ($F, $L, $message = '', $sendEmail = true) {
        $debug .= 'Please report this bug at <a title="Direct link to the bug-tracker" href="http://bugs.mxchange.org" rel="external" target="_blank">http://bugs.mxchange.org</a> and include the logfile from <strong>' . str_replace(getPath(), '', getCachePath()) . 'debug.log</strong> in your report (you can now attach files):<pre>';
        $debug .= debug_get_printable_backtrace();
        $debug .= '</pre>';
-       $debug .= '<div>Request-URI: ' . getRequestUri() . '</div>';
-       $debug .= '<div>Thank you for finding bugs.</div>';
+       $debug .= '<div class="para">Request-URI: ' . getRequestUri() . '</div>';
+       $debug .= '<div class="para">Thank you for finding bugs.</div>';
 
        // Send an email? (e.g. not wanted for evaluation errors)
        if (($sendEmail === true) && (!isInstallationPhase())) {
@@ -1360,7 +1360,7 @@ function determinePageTitle () {
 
                // Add title of module? (middle decoration will also be added!)
                if ((isModuleTitleEnabled()) || ((!isWhatSet()) && (!isActionSet())) || (getModule() == 'admin')) {
-                       $TITLE .= ' ' . trim(getConfig('title_middle')) . ' ' . getModuleTitle(getModule());
+                       $TITLE .= ' ' . trim(getConfig('title_middle')) . ' {DQUOTE} . getModuleTitle(getModule()) . {DQUOTE}';
                } // END - if
 
                // Add title from what file
@@ -1379,10 +1379,10 @@ function determinePageTitle () {
                $pageTitle = '[-- ' . getMainTitle() . ' - ' . getModuleTitle(getModule()) . ' --]';
        } elseif ((isInstalled()) && (!isAdminRegistered())) {
                // Installed but no admin registered
-               $pageTitle = '{--SETUP_OF_MAILER--}';
+               $pageTitle = '{--INSTALLER_OF_MAILER_NO_ADMIN--}';
        } elseif ((!isInstalled()) || (!isAdminRegistered())) {
                // Installation mode
-               $pageTitle = '{--INSTALLATION_OF_MAILER--}';
+               $pageTitle = '{--INSTALLER_OF_MAILER--}';
        } else {
                // Configuration not found!
                $pageTitle = '{--NO_CONFIG_FOUND_TITLE--}';
@@ -1536,7 +1536,7 @@ function sendModeMails ($mod, $modes) {
                                        $sub_mem = '{--MEMBER_CHANGED_DATA--}';
 
                                        // Output success message
-                                       $content = '<span class="member_done">{--MYDATA_MAIL_SENT--}</span>';
+                                       $content = '<span class="member_done">{--MEMBER_MYDATA_MAIL_SENT--}</span>';
                                        break;
 
                                default: // Unsupported module!
@@ -1569,7 +1569,7 @@ function sendModeMails ($mod, $modes) {
                        $content = '{--CANNOT_SEND_ADMIN_MAILS--}';
                } else {
                        // No mail to admin
-                       $content = '<span class="member_done">{--MYDATA_MAIL_SENT--}</span>';
+                       $content = '<span class="member_done">{--MEMBER_MYDATA_MAIL_SENT--}</span>';
                }
        } // END - if