public static function deleteContent($gameId, $intContentID, $editorId, $editorToken) { if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) { return new returnData(6, NULL, "Failed Authentication"); } //Lookup the object $query = "SELECT content_type,content_id FROM folder_contents WHERE object_content_id = {$intContentID} AND game_id = '{$gameId}' LIMIT 1"; $contentQueryResult = Module::query($query); $content = @mysql_fetch_object($contentQueryResult); if (mysql_error()) { return new returnData(3, NULL, "SQL Error"); } Spawnables::deleteSpawnablesOfObject($gameId, $content->content_type, $content->content_id, $editorId, $editorToken); //Delete the content record $query = "DELETE FROM folder_contents WHERE object_content_id = {$intContentID} AND game_id = '{$gameId}'"; Module::query($query); if (mysql_error()) { return new returnData(3, NULL, "SQL Error"); } //Delete the object if ($content->content_type == "Node") { Nodes::deleteNode($gameId, $content->content_id, $editorId, $editorToken); } else { if ($content->content_type == "Item") { Items::deleteItem($gameId, $content->content_id, $editorId, $editorToken); } else { if ($content->content_type == "Npc") { Npcs::deleteNpc($gameId, $content->content_id, $editorId, $editorToken); } else { if ($content->content_type == "WebPage") { WebPages::deleteWebPage($gameId, $content->content_id, $editorId, $editorToken); } else { if ($content->content_type == "AugBubble") { AugBubbles::deleteAugBubble($gameId, $content->content_id, $editorId, $editorToken); } else { if ($content->content_type == "PlayerNote") { Notes::deleteNote($content->content_id, $editorId, $editorToken); } } } } } } if (mysql_affected_rows()) { return new returnData(0); } else { return new returnData(2, 'invalid folder id'); } }