function deleteNotification($NID, $OID)
{
    dbDeleteNotification($NID);
    drupal_set_message('Notification has been deleted.');
    if (isset($_SERVER['HTTP_REFERER'])) {
        drupal_goto($_SERVER['HTTP_REFERER']);
    } else {
        drupal_goto('manageNotifications', array('query' => array('OID' => $OID)));
    }
}
Example #2
0
function dismissAllNotifications()
{
    global $user;
    if (!empty($_SESSION['notificationNIDsShown'])) {
        foreach ($_SESSION['notificationNIDsShown'] as $NID) {
            // used to ensure no undisplayed notifications are deleted
            dbDeleteNotification($NID);
        }
        drupal_set_message('All notifications have been dismissed!');
    } else {
        drupal_set_message('No notifications to dismiss.');
    }
    if (isset($_SERVER['HTTP_REFERER'])) {
        drupal_goto($_SERVER['HTTP_REFERER']);
    } else {
        drupal_goto('myDashboard');
    }
}