function filedepotAjaxServer_broadcastAlert in filedepot 7
Same name and namespace in other branches
- 6 lib-ajaxserver.php \filedepotAjaxServer_broadcastAlert()
1 call to filedepotAjaxServer_broadcastAlert()
File
- ./
lib-ajaxserver.php, line 1464 - lib-ajaxserver.php Library functions for the ajax_server
Code
function filedepotAjaxServer_broadcastAlert($fid, $comment) {
global $user;
$retval = '';
$target_users = filedepot_build_notification_distribution($fid, FILEDEPOT_BROADCAST_MESSAGE);
if (count($target_users) > 0) {
$values = array(
'fid' => $fid,
'comment' => filter_xss($comment),
'target_users' => $target_users,
);
$ret = drupal_mail('filedepot', FILEDEPOT_BROADCAST_MESSAGE, $user, language_default(), $values);
if ($ret) {
$filedepot = filedepot_filedepot();
$retval['retcode'] = 200;
$retval['count'] = $filedepot->message;
}
else {
$retval['retcode'] = 205;
}
}
else {
$retval['retcode'] = 205;
}
return $retval;
}