private function formatNotification($request, $notification, $notificationTemplate = 'notification/notification.tpl')
{
$templateMgr = TemplateManager::getManager($request);
// Set the date read if it isn't already set
if (!$notification->getDateRead()) {
$notificationDao = DAORegistry::getDAO('NotificationDAO');
$dateRead = $notificationDao->setDateRead($notification->getId(), Core::getCurrentDate());
$notification->setDateRead($dateRead);
}
$user = $request->getUser();
$templateMgr->assign(array('isUserLoggedIn' => $user, 'notificationDateCreated' => $notification->getDateCreated(), 'notificationId' => $notification->getId(), 'notificationContents' => $this->getNotificationContents($request, $notification), 'notificationTitle' => $this->getNotificationTitle($notification), 'notificationStyleClass' => $this->getStyleClass($notification), 'notificationIconClass' => $this->getIconClass($notification), 'notificationDateRead' => $notification->getDateRead()));
if ($notification->getLevel() != NOTIFICATION_LEVEL_TRIVIAL) {
$templateMgr->assign('notificationUrl', $this->getNotificationUrl($request, $notification));
}
return $templateMgr->fetch($notificationTemplate);
}