Example #1
0
 $error = FALSE;
 if (objects::validID() === FALSE) {
     throw new Exception("ObjectID Provided is invalid.");
 }
 if (forms::validID() === FALSE) {
     throw new Exception("No Form ID Provided.");
 }
 if (mfcsPerms::isEditor($engine->cleanGet['MYSQL']['formID']) === FALSE) {
     $permissions = FALSE;
     throw new Exception("Permission Denied to view objects created with this form.");
 }
 if (isset($engine->cleanGet['MYSQL']['parentID']) && objects::validID(TRUE, $engine->cleanGet['MYSQL']['parentID']) === FALSE) {
     throw new Exception("ParentID Provided is invalid.");
 }
 // if an object ID is provided make sure the object is from this form
 if (!isnull($engine->cleanGet['MYSQL']['objectID']) && !objects::checkObjectInForm($engine->cleanGet['MYSQL']['formID'], $engine->cleanGet['MYSQL']['objectID'])) {
     throw new Exception("Object not from this form.");
 }
 if (($form = forms::get($engine->cleanGet['MYSQL']['formID'])) === FALSE) {
     throw new Exception("Error retrieving form.");
 }
 if (forms::isProductionReady($engine->cleanGet['MYSQL']['formID']) === FALSE) {
     $permissions = FALSE;
     throw new Exception("Form is not production ready.");
 }
 if (forms::isMetadataForm($engine->cleanGet['MYSQL']['formID'])) {
     throw new Exception("Metadata form provided (Object forms only).");
 }
 /* Parent Object 'Stuff' */
 if (isset($engine->cleanGet['MYSQL']['parentID']) && ($parentObject = objects::get($engine->cleanGet['MYSQL']['parentID'])) === FALSE) {
     throw new Exception("Unable to retrieve parent object");