getSubtype() == "disctopic" && $dt->canEdit()) { // Get owning user $owner = get_entity($dt->getOwner()); // Delete it! $rowsaffected = $dt->delete(); if ($rowsaffected > 0) { // Success message /*translation:Discussion deleted.*/ system_message(elgg_echo("koolielu:message_discussion_deleted")); } else { /*translation:Discussion not deleted.*/ register_error(elgg_echo("koolielu:error_discussion_not_deleted")); } // Forward to the main tools page forward("pg/discussions"); } ?>