Модуль импорта v2.26.0 (Light версия)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

110 lines
2.5 KiB

<?php
/**
* AVE.cms - Модуль импорта
*
* @package AVE.cms
* @subpackage module_Import
* @filesource
*/
if(!defined('BASE_DIR')) exit;
if (defined('ACP'))
{
$modul['ModuleName'] = "Модуль импорта";
$modul['ModuleSysName'] = "import";
$modul['ModuleVersion'] = "1.2.2";
$modul['ModuleDescription'] = "Данный модуль предназначен для импорта документов в определенную рубрику";
$modul['ModuleAutor'] = "Realter, val005, M@dD3n";
$modul['ModuleCopyright'] = "&copy; AVE.cms Team - " . date('Y');
$modul['ModuleStatus'] = 1;
$modul['ModuleIsFunction'] = 0;
$modul['ModuleTemplate'] = 0;
$modul['ModuleAdminEdit'] = 1;
$modul['ModuleFunction'] = null;
$modul['ModuleTag'] = null;
$modul['ModuleTagLink'] = null;
$modul['ModuleAveTag'] = null;
$modul['ModulePHPTag'] = null;
}
/**
* Администрирование
*/
function module_import_autoupdate()
{
global $AVE_DB;
$sql="
SELECT
Id,
import_default_file,
import_last_update
FROM " . PREFIX . "_module_import
WHERE import_monitor_file != 0
";
$res = $AVE_DB->Query($sql);
$rows = array();
while ($row = $res->FetchAssocArray())
{
$rows[] = $row;
if(file_exists(BASE_DIR . $row["import_default_file"]))
{
if(filemtime(BASE_DIR . $row["import_default_file"]) > $row['import_last_update'])
{
if (!(is_file(BASE_DIR . '/modules/import/class.import.php') &&
include_once(BASE_DIR . '/modules/import/class.import.php'))) module_error();
$import = new import;
$import -> DoImport($row['Id']);
}
}
}
}
if (defined('ACP') && $_REQUEST['moduleaction'])
{
if (! (is_file(BASE_DIR . '/modules/import/class.import.php')))
module_error();
include_once(BASE_DIR . '/modules/import/class.import.php');
$import = new import;
$tpl_dir = BASE_DIR . '/modules/import/templates/';
$lang_file = BASE_DIR . '/modules/import/lang/' . $_SESSION['user_language'] . '.txt';
$AVE_Template->config_load($lang_file);
switch ($_REQUEST['moduleaction'])
{
case '1':
$import->importList($tpl_dir);
break;
case 'del':
$import->importDelete($_REQUEST['id']);
break;
case 'edit':
$import->importEdit(isset($_REQUEST['id']) ? $_REQUEST['id'] : null, $tpl_dir);
break;
case 'saveedit':
$import->importSave(isset($_REQUEST['id']) ? $_REQUEST['id'] : null);
break;
case 'do':
$import->DoImport($_REQUEST['id'], false);
break;
case 'tags':
$import->DoImport(isset($_REQUEST['id']) ? $_REQUEST['id'] : null, true);
break;
}
}
?>