if ($action == "Submit Changes") {
     $editArr = array();
     $defaultViewArr = array();
     $defaultViewArr["ddetails"] = array_key_exists("ddetails", $_REQUEST) ? 1 : 0;
     $defaultViewArr["dcommon"] = array_key_exists("dcommon", $_REQUEST) ? 1 : 0;
     $defaultViewArr["dimages"] = array_key_exists("dimages", $_REQUEST) ? 1 : 0;
     $defaultViewArr["dvouchers"] = array_key_exists("dvouchers", $_REQUEST) ? 1 : 0;
     $defaultViewArr["dauthors"] = array_key_exists("dauthors", $_REQUEST) ? 1 : 0;
     $defaultView = json_encode($defaultViewArr);
     foreach ($_REQUEST as $k => $v) {
         if (substr($k, 0, 3) == "ecl") {
             $editArr[substr($k, 3)] = $_REQUEST[$k];
         }
     }
     $editArr["defaultSettings"] = $defaultView;
     $clManager->editMetaData($editArr);
     header('Location: checklist.php?cl=' . $clid . '&pid=' . $pid);
 } elseif ($action == 'Delete Checklist') {
     $statusStr = $clManager->deleteChecklist($_POST['delclid']);
     if ($statusStr === true) {
         header('Location: ../index.php');
     }
 } elseif ($action == 'Add Editor') {
     $statusStr = $clManager->addEditor($_POST['editoruid']);
 } elseif (array_key_exists('deleteuid', $_REQUEST)) {
     $statusStr = $clManager->deleteEditor($_REQUEST['deleteuid']);
 } elseif ($action == 'Add Point') {
     $statusStr = $clManager->addPoint($_POST['pointtid'], $_POST['pointlat'], $_POST['pointlng'], $_POST['notes']);
 } elseif ($action && array_key_exists('clidadd', $_POST)) {
     $statusStr = $clManager->addChildChecklist($_POST['clidadd']);
 } elseif ($action && array_key_exists('cliddel', $_GET)) {
$pid = array_key_exists("pid", $_REQUEST) ? $_REQUEST["pid"] : "";
$startPos = array_key_exists('start', $_REQUEST) ? (int) $_REQUEST['start'] : 0;
$tabIndex = array_key_exists("tabindex", $_REQUEST) ? $_REQUEST["tabindex"] : 0;
$action = array_key_exists("submitaction", $_REQUEST) ? $_REQUEST["submitaction"] : "";
$clManager = new ChecklistAdmin();
if (!$clid && isset($_POST['delclid'])) {
    $clid = $_POST['delclid'];
}
$clManager->setClid($clid);
$statusStr = "";
$isEditor = 0;
if ($IS_ADMIN || array_key_exists("ClAdmin", $USER_RIGHTS) && in_array($clid, $USER_RIGHTS["ClAdmin"])) {
    $isEditor = 1;
    //Submit checklist MetaData edits
    if ($action == "Submit Changes") {
        $clManager->editMetaData($_POST);
        header('Location: checklist.php?cl=' . $clid . '&pid=' . $pid);
    } elseif ($action == 'Delete Checklist') {
        $statusStr = $clManager->deleteChecklist($_POST['delclid']);
        if ($statusStr === true) {
            header('Location: ../index.php');
        }
    } elseif ($action == 'Add Editor') {
        $statusStr = $clManager->addEditor($_POST['editoruid']);
    } elseif (array_key_exists('deleteuid', $_REQUEST)) {
        $statusStr = $clManager->deleteEditor($_REQUEST['deleteuid']);
    } elseif ($action == 'Add Point') {
        $statusStr = $clManager->addPoint($_POST['pointtid'], $_POST['pointlat'], $_POST['pointlng'], $_POST['notes']);
    } elseif ($action && array_key_exists('clidadd', $_POST)) {
        $statusStr = $clManager->addChildChecklist($_POST['clidadd']);
    } elseif ($action && array_key_exists('cliddel', $_GET)) {