$includeImgs = 1; $redactLocalities = 1; if ($action) { if (!array_key_exists('dets', $_POST)) { $includeDets = 0; $dwcaManager->setIncludeDets(0); } if (!array_key_exists('imgs', $_POST)) { $includeImgs = 0; $dwcaManager->setIncludeImgs(0); } if (!array_key_exists('redact', $_POST)) { $redactLocalities = 0; $dwcaManager->setRedactLocalities(0); } $dwcaManager->setTargetPath($serverRoot . (substr($serverRoot, -1) == '/' ? '' : '/') . 'collections/datasets/dwc/'); } $isEditor = 0; if ($isAdmin || array_key_exists("CollAdmin", $userRights) && in_array($collId, $userRights["CollAdmin"])) { $isEditor = 1; } $collArr = array(); if ($collId) { $dwcaManager->setCollArr($collId); $collArr = $dwcaManager->getCollArr(); } if ($isEditor) { if (array_key_exists('colliddel', $_POST)) { $dwcaManager->deleteArchive($_POST['colliddel']); } }
if ($customField1) { $dwcaHandler->addCondition($customField1, $_POST['ct1'], $_POST['cv1']); } if ($customField2) { $dwcaHandler->addCondition($customField2, $_POST['ct2'], $_POST['cv2']); } //Set GeoLocate CoGe variables $dwcaHandler->setGeolocateVariables(array('cogecomm' => $_POST['cogecomm'], 'cogename' => $_POST['cogename'], 'cogedescr' => $_POST['cogedescr'])); //Set direct path to file $tPath = $SERVER_ROOT; if (substr($tPath, -1) != '/' && substr($tPath, -1) != '\\') { $tPath .= '/'; } $pathFrag = 'temp/data/geolocate/'; $tPath .= $pathFrag; $dwcaHandler->setTargetPath($tPath); $cnt = $dwcaHandler->getOccurrenceCnt(); $fileName = 'CoGe' . '_' . time(); $path = $dwcaHandler->createDwcArchive($fileName); //Set URL path to file $urlPrefix = "http://"; if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { $urlPrefix = "https://"; } $urlPrefix .= $_SERVER["SERVER_NAME"]; if ($_SERVER["SERVER_PORT"] && $_SERVER["SERVER_PORT"] != 80) { $urlPrefix .= ':' . $_SERVER["SERVER_PORT"]; } $urlPath = $urlPrefix . $CLIENT_ROOT; if (substr($urlPath, -1) != '/' && substr($urlPath, -1) != '\\') { $urlPath .= '/';