, Jam Warehouse (Pty) Ltd, South Africa
*
* @package lib.subscriptions
*/
class AlertContent {
/**
* Returns the appropriate alert content for the subscriptionAlertType
* after appropriately substituting the values in the array into the text.
*
* @param int the type of subscription alert, see SubscriptionConstants.inc
* @param array contains the dynamic values that need to be substituted into the
* alert notification text
* @return string the alert content
*/
function get($iSubscriptionAlertType, $aValues) {
$aAlertContent = (SubscriptionConstants::subscriptionAlertType("AddFolder") =>
"A new folder '" . $aValues["newFolderName"] . "' has been added to folder '" . $aValues["parentFolderName"] . "'.
" .
"Please clear this subscription alert by clicking on the following link: " . $aValues["viewAlertLink"],
SubscriptionConstants::subscriptionAlertType("RemoveFolder") =>
"The folder '" . $aValues["removedFolderName"] . "' has been removed from folder '" . $aValues["parentFolderName"] . "'.
" .
"Please clear this subscription alert by clicking on the following link: " . $aValues["viewAlertLink"],
SubscriptionConstants::subscriptionAlertType("AddDocument") =>
"A new document '" . $aValues["newDocumentName"] . "' has been added to folder '" . $aValues["folderName"] . "'.
" .
"Please clear this subscription alert by clicking on the following link: " . $aValues["viewAlertLink"],
SubscriptionConstants::subscriptionAlertType("RemoveDocument") =>
"The document '" . $aValues["removedDocumentName"] . "' has been removed from folder '" . $aValues["folderName"] . "'.
" .
"Please clear this subscription alert by clicking on the following link: " . $aValues["viewAlertLink"],.
SubscriptionConstants::subscriptionAlertType("ModifyDocument") =>
"The document '" . $aValues["modifiedDocumentName"] . "' has been modified.
" .
"Please clear this subscription alert by clicking on the following link: " . $aValues["viewAlertLink"]);
return "Hello " . $aValues["subscriberName"] . "
" . $aAlertContent[$iSubscriptionAlertType];
}
}