Example #1
0
/**
 * delete folders and documents
 * created by carlos pacha carlos@colosa.com, pckrlos@gmail.com
 * @param void
 * @return true
**/
function delete()
{
    include_once "classes/model/AppDocument.php";
    include_once "classes/model/AppFolder.php";
    switch ($_REQUEST['option']) {
        case 'documents':
            deleteDocuments($_REQUEST['selitems'], $_REQUEST['option']);
            break;
        case 'directory':
            $oAppFoder = new AppFolder();
            $oAppDocument = new AppDocument();
            $aDocuments = $oAppDocument->getDocumentsinFolders($_REQUEST['item']);
            if (count($aDocuments) > 0) {
                deleteDocuments($aDocuments, $_REQUEST['option']);
            }
            $oAppFoder->remove($_REQUEST['item'], '');
            break;
    }
    $msgLabel = G::LoadTranslation('ID_DELETED_SUCCESSFULLY');
    echo "{action: '', error:'error',message: '{$msgLabel}', success: 'success',folderUID: 'root'}";
}