Files
kupshop/admin/import.generic.php
2025-08-02 16:30:27 +02:00

44 lines
1.1 KiB
PHP

<?php
global $cfg;
require_once $cfg['Path']['shared_version'].'admin/import.xml_feed_new.php';
$main_class = 'Import_Generic';
class Import_Generic extends Import_XMLfeed_New
{
protected $template = 'window/import.generic.tpl';
public function getImportParams()
{
global $cfg;
$params = parent::getImportParams();
$params['transformation'] = file_get_contents($cfg['Path']['shared_version'].'admin/templates/import/generic.xslt');
$params['type'] = AutomaticImport::TYPE_XLS;
$params['add_new'] = getVal('import_type', null, 1);
return $params;
}
public function getFeedFile()
{
global $cfg;
$import_real = getVal('import_real');
$synchronize_try = getVal('synchronize_try');
if (empty($_FILES['file']['tmp_name']) && empty($import_real) && empty($synchronize_try)) {
return '';
}
$path = $cfg['Path']['data'].'tmp/generic_import.xsl';
if (!empty($import_real) || !empty($synchronize_try)) {
return $path;
}
move_uploaded_file($_FILES['file']['tmp_name'], $path);
return $path;
}
}