You are here

function oa_notifications_remove_callback in Open Atrium Notifications 7.2

Remove notification callback.

1 string reference to 'oa_notifications_remove_callback'
oa_notifications_menu in ./oa_notifications.module
Implements hook_menu().

File

./oa_notifications.module, line 928

Code

function oa_notifications_remove_callback($js = FALSE, $node, $type, $id) {
  oa_notifications_delete_specific($node->nid, $id, $type);
  if ($js) {
    $commands = array();
    $data = oa_notifications_render_view($node, true);
    $commands[] = ajax_command_replace('#notify-data', drupal_render($data));
    ajax_deliver(array(
      '#type' => 'ajax',
      '#commands' => $commands,
    ));
  }
  else {
    drupal_set_message(t('Removed notification'));
    drupal_goto();
  }
}