X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flanguage-functions.php;h=a12389d839bbd19ba0ff0980aa25051a87d11bf0;hb=8cd3d68a23aa285f2fe149698a46cf8b4e3ac0ca;hp=0de23e3d2dbc86bc7b4da838ec8760302300aef3;hpb=adb34cea9c14bcac14030f8eb1e6ae2c3231c962;p=mailer.git diff --git a/inc/language-functions.php b/inc/language-functions.php index 0de23e3d2d..a12389d839 100644 --- a/inc/language-functions.php +++ b/inc/language-functions.php @@ -18,6 +18,7 @@ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * + * Copyright (c) 2009, 2010 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -60,6 +61,11 @@ function getMessage ($messageId) { return $return; } +// Getter for message string as a mask +function getMaskedMessage ($messageId, $data) { + return sprintf(getMessage($messageId), $data); +} + // Init messages function initMessages () { $GLOBALS['messages'][getLanguage()] = array(); @@ -105,9 +111,9 @@ function getLanguage () { if (isConfigEntrySet('DEFAULT_LANG')) $ret = getConfig('DEFAULT_LANG'); // Is the variable set - if (isGetRequestElementSet('mx_lang')) { + if (isGetRequestParameterSet('mx_lang')) { // Accept only first 2 chars - $ret = substr(getRequestElement('mx_lang'), 0, 2); + $ret = substr(getRequestParameter('mx_lang'), 0, 2); } elseif (isset($GLOBALS['language'])) { // Use cached $ret = getCurrentLanguage(); @@ -318,5 +324,20 @@ function getLanguageComparisonDifference ($target) { return $GLOBALS['lang_diff_count'][$target]; } +// Checks wether the given message is masked +function isMessageMasked ($messageId) { + // Is the message id valid? + if (!isMessageIdValid($messageId)) { + // No, then abort here + debug_report_bug(__FUNCTION__ . ': Invalid message id ' . $messageId . ' detected.'); + } // END - if + + // Now simply check it + $masked = (strpos($GLOBALS['messages'][getCurrentLanguage()][$messageId], '%') !== false); + + // Return result + return $masked; +} + // [EOF] ?>