getSubtype() == "course" && $poster->canEdit()) { // Get owning user $owner_guid = $poster->getOwner(); // Delete it! $rowsaffected = $poster->delete(); if ($rowsaffected > 0) { delete_data("DELETE from {$CONFIG->dbprefix}koolielu_calendar_objects where guid=".$guid); /*translation:Course was successfully deleted.*/ system_message(elgg_echo('koolielu:course_deleted')); deleteKeObjectImages($guid, $owner_guid); } else { /*translation:Sorry; we could not delete this course.*/ register_error(elgg_echo('koolielu:course_not_deleted')); } forward("mod/poster"); } ?>