function com_uninstall()
{
    global $_DOCMAN;
    // remove modules
    if (defined('_DM_J15')) {
        DMInstallHelper::moduleFilesJ15('delete');
    } else {
        DMInstallHelper::moduleFiles('delete');
    }
    DMInstallHelper::pluginFiles('delete');
    DMInstallHelper::pluginDb('delete');
    // if there's no more data, we remove the tables
    if (DMInstallHelper::cntDbRecords() == 0) {
        DMInstallHelper::removeTables();
    }
    // delete the data folder if it's empty
    if (DMInstallHelper::cntFiles() == 0) {
        DMInstallHelper::removeDmdocuments();
    }
}