<?php include "../header.php"; // Setup revision control $revisions = new revisionControlSystem('objects', 'revisions', 'ID', 'modifiedTime'); $selectedProjects = NULL; $parentObject = NULL; $permissions = TRUE; try { $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) {
private static function genLinkURLs($type, $objectID) { switch (trim(strtolower($type))) { case 'view': return sprintf('<a href="%sdataView/object.php?objectID=%s">View</a>', localvars::get("siteRoot"), $objectID); break; case 'edit': return sprintf('<a href="%sdataEntry/object.php?objectID=%s">Edit</a>', localvars::get("siteRoot"), $objectID); break; case 'revisions': $revisions = new revisionControlSystem('objects', 'revisions', 'ID', 'modifiedTime'); return $revisions->hasRevisions($objectID) ? sprintf('<a href="%sdataEntry/revisions/index.php?objectID=%s">View</a>', localvars::get("siteRoot"), $objectID) : '<span style="font-style:italic; color:#ccc;">View</span>'; break; default: errorHandle::newError(__METHOD__ . "() - Invalid type passed!", errorHandle::LOW); return ''; break; } }