New method generateExtensionInactiveMessage() introduced
[mailer.git] / inc / functions.php
index d16ffb7cfa72908a893362723b5561760d2f26ad..d157a7ed00344842431105feecb76d2b92f85811 100644 (file)
@@ -2655,7 +2655,7 @@ function convertCodeToMessage ($code) {
 
                case getCode('EXTENSION_PROBLEM'):
                        if (REQUEST_ISSET_GET('ext')) {
-                               $msg = sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), REQUEST_GET('ext'));
+                               $msg = generateExtensionInactiveMessage(REQUEST_GET('ext'));
                        } else {
                                $msg = getMessage('EXTENSION_PROBLEM_UNSET_EXT');
                        }
@@ -3295,6 +3295,27 @@ function isExtraTitleSet () {
        return ((isset($GLOBALS['extra_title'])) && (!empty($GLOBALS['extra_title'])));
 }
 
+// Generates a 'extension foo inactive' message
+function generateExtensionInactiveMessage ($ext) {
+       // Is the extension empty?
+       if (empty($ext)) {
+               // This should not happen
+               trigger_error(__FUNCTION__ . ': Parameter ext is empty. This should not happen.');
+       } // END - if
+
+       // Default message
+       $msg = sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), $ext);
+
+       // Is an admin logged in?
+       if (IS_ADMIN()) {
+               // Then output admin message
+               $msg = sprintf(getMessage('ADMIN_EXTENSION_PROBLEM_EXT_INACTIVE'), $ext);
+       } // END - if
+
+       // Return prepared message
+       return $msg;
+}
+
 //////////////////////////////////////////////////
 // AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
 //////////////////////////////////////////////////