getSubtype() == "news" && $news->canEdit()) {
// Get owning user
$owner = get_entity($news->getOwner());
// Make review!
if ($approve) {
// Prepare message content
/*translation:News approved notification*/
$mess_title = elgg_echo("koolielu:news_approved_notification_title");
/*translation:Your news %s has has been approved.*/
$mess_description = sprintf(elgg_echo('koolielu:news_approved_notification_body'), $news->getURL(), $news->title);
if ($reviewtext) {
/*translation:Message from moderator: %s*/
$mess_description .= sprintf(elgg_echo('koolielu:review_messgae_from_moderator'), $reviewtext);
}
$messages = array('title' => $mess_title, 'description' => $mess_description);
// Send message
accept_object_review($news, $messages, $owner->getGUID());
// river
add_to_river('river/object/news/create','create',$news->getOwner(),$news->guid);
}
if ($disapprove) {
// Prepare message content
/*translation:News disapproved notification*/
$mess_title = elgg_echo('koolielu:news_disapproved_notification_title');
/*translation:Your news %s has been disapproved.*/
$mess_description = sprintf(elgg_echo('koolielu:news_disapproved_notification_body'), $news->title);
if ($reviewtext) {
/*translation:Message from moderator: %s*/
$mess_description .= sprintf(elgg_echo('koolielu:review_messgae_from_moderator'), $reviewtext);
}
/*translation:News item has been deleted.*/
$mess_description .= elgg_echo('koolielu:news_review_object_deleted');
$messages = array('title' => $mess_title, 'description' => $mess_description);
reject_object_review($news, $messages, $owner->getGUID());
deleteKeObjectImages($guid,$owner->getGUID());
}
forward($CONFIG->wwwroot . "pg/info/unapproved");
}
?>