X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=d157a7ed00344842431105feecb76d2b92f85811;hb=da7b89a86040b778274dd89201e2a339232276fb;hp=66614abbb7ad6e4637240e26f250ed785d8e29be;hpb=3afdce4fe00b4af570122ce7b8158ced44aec7d3;p=mailer.git diff --git a/inc/functions.php b/inc/functions.php index 66614abbb7..d157a7ed00 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -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 // //////////////////////////////////////////////////