//output error and return if ($field_set == false) { $warning = 'Please set a field mapping!'; } else { $labelMap = array(); foreach (array_keys($data) as $label) { $mapName = 'LabelMap_' . $label; if ($http->hasPostVariable($mapName)) { if ($http->postVariable($mapName) != '0') { $labelMap[$http->postVariable($mapName)] = $label; } } } if ($http->hasPostVariable('RowNum')) { //call import function in class eZRobinsonListEntry::importData($data, $labelMap, $http->postVariable('RowNum'), $http->postVariable('import_list'), $http->postVariable('import_datatype'), $http->postVariable('import_options')); } $http->removeSessionVariable('CSVData'); return $Module->redirectToView('robinson_show', array()); } } } // options not set } } $data = array(); if (eZHTTPFile::canFetch('UploadCSVFile')) { $binaryFile = eZHTTPFile::fetch('UploadCSVFile'); $parser = new eZCSVParser($binaryFile->attribute('filename'), $http->hasPostVariable('FirstRowLabel') ? true : false); $data = $parser->data(); $http->setSessionVariable('CSVData', $data);