|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* AVE.cms - Модуль Импорта
|
|
|
|
*
|
|
|
|
* @package AVE.cms
|
|
|
|
* @subpackage module_import
|
|
|
|
* @filesource
|
|
|
|
*/
|
|
|
|
|
|
|
|
if(!defined('BASE_DIR')) exit;
|
|
|
|
|
|
|
|
if (defined('ACP'))
|
|
|
|
{
|
|
|
|
$modul =
|
|
|
|
[
|
|
|
|
'ModuleName' => "Импорт (Облегченная версия)",
|
|
|
|
'ModuleSysName' => "import",
|
|
|
|
'ModuleVersion' => "2.1",
|
|
|
|
'ModuleDescription' => "Осуществляет импорт документов из файлов различных типов",
|
|
|
|
'ModuleAutor' => "AVE.cms Team",
|
|
|
|
'ModuleCopyright' => "© AVE.cms Team 2017",
|
|
|
|
'ModuleStatus' => 1,
|
|
|
|
'ModuleIsFunction' => 0,
|
|
|
|
'ModuleTemplate' => 0,
|
|
|
|
'ModuleAdminEdit' => 1,
|
|
|
|
'ModuleFunction' => 'import',
|
|
|
|
'ModuleTag' => null,
|
|
|
|
'ModuleTagLink' => null,
|
|
|
|
'ModuleAveTag' => null,
|
|
|
|
'ModulePHPTag' => null
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Админка
|
|
|
|
*/
|
|
|
|
if (defined('ACP') && (isset($_REQUEST['moduleaction'])))
|
|
|
|
{
|
|
|
|
// класс
|
|
|
|
require_once(BASE_DIR . '/modules/import/class.import.php');
|
|
|
|
|
|
|
|
$import = new ModuleImport;
|
|
|
|
|
|
|
|
// папка с шаблонами
|
|
|
|
$import->tpl_dir = BASE_DIR . '/modules/import/templates/';
|
|
|
|
|
|
|
|
// ланги
|
|
|
|
$AVE_Template->config_load(BASE_DIR . '/modules/import/lang/' . $_SESSION['admin_language'] . '.txt', 'admin');
|
|
|
|
$AVE_Template->assign('config_vars', $AVE_Template->get_config_vars());
|
|
|
|
|
|
|
|
$header_list = 'Location:index.php?do=modules&action=modedit&mod=import&moduleaction=1&cp=' . SESSION . '&page=' . $_REQUEST['page'];
|
|
|
|
|
|
|
|
switch($_REQUEST['moduleaction'])
|
|
|
|
{
|
|
|
|
case '1':
|
|
|
|
$import->importsList();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'edit':
|
|
|
|
$import->importEdit((int)$_REQUEST['import_id']);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'copy':
|
|
|
|
$import_id = $import->importCopy((int)$_REQUEST['import_id']);
|
|
|
|
header('Location:index.php?do=modules&action=modedit&mod=import&moduleaction=edit&import_id=' . $import_id . '&cp=' . SESSION);
|
|
|
|
exit;
|
|
|
|
|
|
|
|
case 'save':
|
|
|
|
$import_id = $import->importSave((int)$_REQUEST['import_id']);
|
|
|
|
if (! $_REQUEST['import_id'])
|
|
|
|
header('Location:index.php?do=modules&action=modedit&mod=import&moduleaction=edit&import_id=' . $import_id . '&cp=' . SESSION);
|
|
|
|
else
|
|
|
|
header($header_list);
|
|
|
|
exit;
|
|
|
|
|
|
|
|
case 'delete':
|
|
|
|
$import->importDelete((int)$_REQUEST['import_id']);
|
|
|
|
header($header_list);
|
|
|
|
exit;
|
|
|
|
|
|
|
|
case 'tags':
|
|
|
|
$import_id = (int)$_REQUEST['import_id'];
|
|
|
|
$import->importRun($import_id, true);
|
|
|
|
header('Location:index.php?do=modules&action=modedit&mod=import&moduleaction=edit&import_id=' . $import_id . '&cp=' . SESSION);
|
|
|
|
exit;
|
|
|
|
|
|
|
|
case 'run':
|
|
|
|
$import_id = (int)$_REQUEST['import_id'];
|
|
|
|
$import->importRun($import_id);
|
|
|
|
header('Location:index.php?do=modules&action=modedit&mod=import&moduleaction=edit&import_id=' . $import_id . '&cp=' . SESSION);
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|