Example #1
0
include_once '../../config/symbini.php';
include_once $serverRoot . '/classes/ImageImport.php';
header("Content-Type: text/html; charset=" . $charset);
$action = array_key_exists("action", $_POST) ? $_POST["action"] : "";
$ulFileName = array_key_exists("ulfilename", $_POST) ? $_POST["ulfilename"] : "";
$isEditor = false;
if ($IS_ADMIN) {
    $isEditor = true;
}
$importManager = new ImageImport();
$fieldMap = array();
//array(sourceField => symbIndex)
if ($isEditor) {
    if ($action) {
        $importManager->setUploadFile($ulFileName);
    }
    if (array_key_exists("sf", $_POST)) {
        //Grab field mapping, if mapping form was submitted
        $targetFields = $_POST["tf"];
        $sourceFields = $_POST["sf"];
        for ($x = 0; $x < count($targetFields); $x++) {
            if ($targetFields[$x] !== "" && $sourceFields[$x]) {
                $fieldMap[$sourceFields[$x]] = $targetFields[$x];
            }
        }
    }
}
?>
<html>
<head>