Rewrites/fixes for handling config entries in SQLs
[mailer.git] / inc / language-functions.php
index 21dc3ed7cbe9a1c2ff2c758d3fc62f19dd5566de..a12389d839bbd19ba0ff0980aa25051a87d11bf0 100644 (file)
@@ -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 *
@@ -110,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();
@@ -323,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]
 ?>