first commit
This commit is contained in:
43
admin/import.generic.php
Normal file
43
admin/import.generic.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user