예제 #1
0
파일: index.php 프로젝트: PseudoAj/mfcs
        $engine->openDB->transEnd();
    }
}
if (isset($engine->cleanPost['MYSQL']['projectForm']) && forms::isMetadataForm($formID) === FALSE) {
    $engine->openDB->transBegin();
    if (!isset($engine->cleanPost['MYSQL']['projects'])) {
        // If no projects are set, we are deleting all the projects
        if (forms::deleteAllProjects($engine->cleanGet['MYSQL']['id']) === FALSE) {
            $engine->openDB->transRollback();
            $engine->openDB->transEnd();
            throw new Exception("Error removing all projects from Object.");
        }
    } else {
        // There are changes.
        // Delete all the old ones
        if (forms::deleteAllProjects($engine->cleanGet['MYSQL']['id']) === FALSE) {
            $engine->openDB->transRollback();
            $engine->openDB->transEnd();
            throw new Exception("Error removing all projects from Object.");
        }
        // Add All the new ones
        if (forms::addProjects($engine->cleanGet['MYSQL']['id'], $engine->cleanPost['MYSQL']['projects']) === FALSE) {
            $engine->openDB->transRollback();
            $engine->openDB->transEnd();
            throw new Exception("Error adding projects to Object.");
        }
        $engine->openDB->transCommit();
        $engine->openDB->transEnd();
    }
}
try {