Beispiel #1
0
            echo CUtil::PhpToJsObject(array('ERROR' => 'NO_ELEMENT'));
            die;
        }
        if (!isset($_REQUEST["post_id"]) || intval($_REQUEST["post_id"]) <= 0) {
            if ($storage && $folder) {
                $securityContext = $storage->getCurrentUserSecurityContext();
                $children = $folder->getChildren($securityContext, array('filter' => array("ID" => $element_id)));
                foreach ($children as $oDiskFile) {
                    $res = $oDiskFile->delete($GLOBALS["USER"]->GetId());
                    if (!$res) {
                        echo CUtil::PhpToJsObject(array('ERROR' => 'ERROR_DISK_FILE_DELETE'));
                        die;
                    }
                }
            } elseif ($ob) {
                $res = $ob->delete(array('element_id' => $element_id));
                if (intval($res) != 204) {
                    echo CUtil::PhpToJsObject(array('ERROR' => $ob->LAST_ERROR));
                    die;
                }
            }
        }
        foreach ($_SESSION[$varKey] as $key => $session_element_id) {
            if ($session_element_id == $element_id) {
                unset($_SESSION[$varKey][$key]);
                break;
            }
        }
        echo CUtil::PhpToJsObject(array('SUCCESS' => 'Y', "ELEMENT_ID" => $element_id));
    }
} else {