getSubtype() == "tool" && $tool->canEdit()) { // Get owning user $owner = get_entity($tool->getOwner()); // Delete it! $rowsaffected = $tool->delete(); if ($rowsaffected > 0) { // Success message /*translation:Tool deleted.*/ system_message(elgg_echo("koolielu:message_tool_deleted")); // No need to tell about images being deleted deleteKeObjectImages($guid, $owner->getGUID()); } else { /*translation:Tool could not be deleted.*/ register_error(elgg_echo("koolielu:error_tool_not_deleted")); } // Forward to the main tools page forward("mod/tools/"); } ?>