]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Convention applied
[mailer.git] / inc / functions.php
index 66614abbb7ad6e4637240e26f250ed785d8e29be..d157a7ed00344842431105feecb76d2b92f85811 100644 (file)
@@ -1216,7 +1216,7 @@ function ADD_SELECTION ($type, $default, $prefix = '', $id = '0') {
 // Deprecated : $length
 // Optional   : $DATA
 //
-function generateRandomCodde ($length, $code, $uid, $DATA = '') {
+function generateRandomCode ($length, $code, $uid, $DATA = '') {
        // Fix missing _MAX constant
        // @TODO Rewrite this unnice code
        if (!defined('_MAX')) define('_MAX', 15235);
@@ -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 //
 //////////////////////////////////////////////////