Last references to now replaced with mergeConfig()
[mailer.git] / inc / functions.php
index 6fc7d1bd973a8ba0d198ba0ee07953477b315bee..591a56c702a432cd908f76714cba97d5b76506a2 100644 (file)
@@ -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}");
 }
@@ -1599,7 +1601,7 @@ function SEND_ADMIN_EMAILS_PRO ($subj, $template, $content, $UID) {
                if ($aid == "-1") {
                        if (EXT_IS_ACTIVE("events")) {
                                // Add line to user events
-                               USERLOG_ADD_LINE($subj, $msg, $UID);
+                               EVENTS_ADD_LINE($subj, $msg, $UID);
                        } else {
                                // Log error for debug
                                DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Extension 'events' missing: tpl=%s,subj=%s,UID=%s",
@@ -2833,6 +2835,12 @@ function IF_APACHE_MODULE_LOADED ($apacheModule) {
        return (((function_exists('apache_get_modules')) && (in_array($apacheModule, apache_get_modules()))) || (!function_exists('apache_get_modules')));
 }
 
+// Merges $_CONFIG with data in given array
+function mergeConfig ($newConfig) {
+       global $_CONFIG;
+       $_CONFIG = merge_array($_CONFIG, $newConfig);
+}
+
 // Getter for $_CONFIG entries
 function getConfig ($entry) {
        global $_CONFIG;
@@ -3270,7 +3278,7 @@ function GENERATE_AID_LINK ($aid) {
                        }
                } else {
                        // Maybe deleted?
-                       $admin = "<div class=\"admin_note\">".ADMIN_ID_404_1.$aid.ADMIN_ID_404_2."</div>";
+                       $admin = "<div class=\"admin_note\">".sprintf(getMessage('ADMIN_ID_404'), $aid)."</div>";
                }
        } // END - if