getSubtype() == "infopage" && $page->canEdit()) { // Get owning user $owner = get_entity($page->getOwner()); // Delete it! $rowsaffected = $page->delete(); if ($rowsaffected > 0) { // Success message /*translation:Page deleted.*/ system_message(elgg_echo("koolielu:message_page_deleted")); } else { /*translation:Page could not be deleted.*/ register_error(elgg_echo("koolielu:error_page_not_deleted")); } // Forward to the main page forward("pg/info/pages"); } ?>