X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffunctions.php;h=ffdcd76a16eeb7907da966e0e3668550578750cd;hp=2ee2e1e2648972fae280c075f2c5f2596276302e;hb=1cf72a9c1a5e737509af79d49f0731da2eb6a218;hpb=a954ccdf4aba81ec0e75a1836aa4bc14cb245aba
diff --git a/inc/functions.php b/inc/functions.php
index 2ee2e1e264..ffdcd76a16 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -98,7 +98,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
default:
// Huh, something goes wrong or maybe you have edited config.php ???
DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid renderer %s detected.", constant('OUTPUT_MODE')));
- mxchange_die("{!FATAL_ERROR!}: {!LANG_NO_RENDER_DIRECT!}");
+ mxchange_die("{--FATAL_ERROR--}: {--LANG_NO_RENDER_DIRECT--}");
break;
}
} elseif ((constant('_OB_CACHING') == "on") && ($footer == 1)) {
@@ -145,7 +145,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
// Was that eval okay?
if (empty($newContent)) {
// Something went wrong!
- die("Evaluation error:
".htmlentities($eval)."
");
+ mxchange_die("Evaluation error:
".htmlentities($eval)."
");
} // END - if
$OUTPUT = $newContent;
} // END - while
@@ -185,15 +185,17 @@ function OUTPUT_RAW ($HTML) {
function addFatalMessage ($message, $extra="") {
global $FATAL;
- if (empty($extra)) {
- // Regular text message to add to $FATAL
- $FATAL[] = $message;
- } else {
+ if (is_array($extra)) {
+ // Multiple extras for a message with masks
+ $message = call_user_func_array('sprintf', $extra);
+ } elseif (!empty($extra)) {
// $message is text with a mask plus extras to insert into the text
$message = sprintf($message, $extra);
- $FATAL[] = $message;
}
+ // Add message to $FATAL
+ $FATAL[] = $message;
+
// Log fatal messages away
DEBUG_LOG(__FUNCTION__, __LINE__, " message={$message}");
}
@@ -853,22 +855,22 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") {
$tmpl_file = addslashes($tmpl_file);
// Run code
- $tmpl_file = "\$newContent=html_entity_decode(\"".COMPILE_CODE($tmpl_file)."\");";
+ $tmpl_file = "\$newContent = html_entity_decode(\"".COMPILE_CODE($tmpl_file)."\");";
@eval($tmpl_file);
} elseif (!empty($template)) {
// Template file not found!
- $newContent = TEMPLATE_404.": ".$template."
-".TEMPLATE_CONTENT."
+ $newContent = "{--TEMPLATE_404--}: ".$template."
+{--TEMPLATE_CONTENT--}
".print_r($content, true)."
-".TEMPLATE_DATA."
+{--TEMPLATE_DATA--}
".print_r($DATA, true)."
";
// Debug mode not active? Then remove the HTML tags
- if (!DEBUG_MODE) $newContent = strip_tags($newContent);
+ if (!isBooleanConstantAndTrue('DEBUG_MODE')) $newContent = strip_tags($newContent);
} else {
// No template name supplied!
- $newContent = NO_TEMPLATE_SUPPLIED;
+ $newContent = getMessage('NO_TEMPLATE_SUPPLIED');
}
// Is there some content?
@@ -1197,9 +1199,9 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0") {
case "yn":
$OUT .= "