]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Introduced translateTaskType()
[mailer.git] / inc / functions.php
index 4b5a7854cb2599f803b96b4338143a1369765860..7e6e5f8adb8056580c5f65314a41f357a9aa2b69 100644 (file)
@@ -2373,6 +2373,24 @@ function convertBooleanToYesNo ($boolean) {
        return $converted;
 }
 
+// Translates task type to a human-readable version
+function translateTaskType ($taskType) {
+       // Construct message id
+       $messageId = 'ADMIN_TASK_TYPE_' . strtoupper($taskType) . '';
+
+       // Is the message id there?
+       if (isMessageIdValid($messageId)) {
+               // Then construct message
+               $message = '{--' . $messageId . '--}';
+       } else {
+               // Else it is an unknown task type
+               $message = '{%message,ADMIN_TASK_TYPE_UNKNOWN=' . $taskType . '%}';
+       } // END - if
+
+       // Return message
+       return $message;
+}
+
 //-----------------------------------------------------------------------------
 // Automatically re-created functions, all taken from user comments on www.php.net
 //-----------------------------------------------------------------------------