/** * Delete a child of media tree * @param int mep_item id */ function deleteChild($obj_id) { $fid = ilMediaPoolItem::lookupForeignId($obj_id); $type = ilMediaPoolItem::lookupType($obj_id); $title = ilMediaPoolItem::lookupTitle($obj_id); $node_data = $this->tree->getNodeData($obj_id); $subtree = $this->tree->getSubtree($node_data); // delete tree if ($this->tree->isInTree($obj_id)) { $this->tree->deleteTree($node_data); } // delete objects foreach ($subtree as $node) { $fid = ilMediaPoolItem::lookupForeignId($node["child"]); if ($node["type"] == "mob") { if (ilObject::_lookupType($fid) == "mob") { $obj =& new ilObjMediaObject($fid); $obj->delete(); } } if ($node["type"] == "fold") { if ($fid > 0 && ilObject::_lookupType($fid) == "fold") { $obj = new ilObjFolder($fid, false); $obj->delete(); } } if ($node["type"] == "pg") { include_once "./Modules/MediaPool/classes/class.ilMediaPoolPage.php"; if (ilMediaPoolPage::_exists($node["child"])) { $pg = new ilMediaPoolPage($node["child"]); $pg->delete(); } } include_once "./Modules/MediaPool/classes/class.ilMediaPoolItem.php"; $item = new ilMediaPoolItem($node["child"]); $item->delete(); } }