Referal system refactured (and some parts fixed), wrapper function introduced:
[mailer.git] / inc / functions.php
index c85d6fde9ab3ecafe1d007323eb746dac57a7dd4..08fa13dc1783c29bcdaf8fe0502ea790e97c86d1 100644 (file)
@@ -2410,6 +2410,24 @@ function translateTaskType ($taskType) {
        return $message;
 }
 
+// Translates points subject to human-readable
+function translatePointsSubject ($subject) {
+       // Construct message id
+       $messageId = 'POINTS_SUBJECT_' . strtoupper($subject) . '';
+
+       // Is the message id there?
+       if (isMessageIdValid($messageId)) {
+               // Then construct message
+               $message = '{--' . $messageId . '--}';
+       } else {
+               // Else it is an unknown task type
+               $message = '{%message,POINTS_SUBJECT_UNKNOWN=' . $subject . '%}';
+       } // END - if
+
+       // Return message
+       return $message;
+}
+
 // "Translates" 'true' to true and 'false' to false
 function convertStringToBoolean ($str) {
        // Trim it lower-case for validation