示例#1
0
                 break;
         }
     }
     if ($installError) {
         report('Error during installation process :');
         report($installError, true);
     } else {
         report('-> Patch installation done without error.');
     }
 } elseif ($exportFile->exists()) {
     //Module datas to import
     $importDatas = $exportFile->getContent();
     if (!$importDatas) {
         report('Error: no content to import or invalid content...', true);
     }
     $import = new CMS_module_import();
     if (!$import->import($importDatas, 'xml', $cms_language, $importLog)) {
         report('Error during datas importation...');
     }
     if (isset($importLog) && $importLog) {
         verbose('Import log: ');
         verbose($importLog);
     }
 } else {
     report('Error : File ' . PATH_TMP_FS . '/patch does not exists ... This file is not a valid Automne patch.', true);
 }
 //remove temporary files
 report('Start cleaning temporary files...');
 if (!CMS_file::deltree(PATH_TMP_FS)) {
     report('Error during temporary folder cleaning...');
 } else {
示例#2
0
define('MESSAGE_PAGE_MODULE_IMPORT_DONE', 1658);
define('MESSAGE_PAGE_MODULE_ERROR_CLEANING_DIR', 1659);
define('MESSAGE_PAGE_MODULE_IMPORT_LOG', 1660);
define('MESSAGE_PAGE_ERROR_MODULE_RIGHTS', 65);
define('MESSAGE_PAGE_EXPORT_XML_FORMAT', 1636);
define('MESSAGE_PAGE_EXPORT_PHP_FORMAT', 1637);
define('MESSAGE_PAGE_EXPORT_OPTIONS', 1638);
//Create page object
$dialog = new CMS_dialog();
//checks rights
if (!$cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITVALIDATEALL)) {
    $dialog->setContent($cms_language->getMessage(MESSAGE_PAGE_ERROR_MODULE_RIGHTS));
    $dialog->show();
    exit;
}
$import = new CMS_module_import();
$dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_MODULE_IMPORT_TITLE));
$format = io::post('format', '', 'xml');
$options = io::post('options', 'is_array', !io::post('action') ? $import->getDefaultParameters() : array());
$dialog->setBackLink('modules_admin.php');
$content = '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data">
				<input type="hidden" name="action" value="import" />
				<fieldset>
					<legend>' . $cms_language->getMessage(MESSAGE_PAGE_EXPORT_OPTIONS) . '</legend>';
$importParams = $import->getAvailableParameters($cms_language);
foreach ($importParams as $param => $label) {
    $content .= '<label>
							<input type="checkbox" name="options[]" value="' . $param . '"' . (in_array($param, $options) ? ' checked="checked"' : '') . ' />
							' . $label . '
						</label><br />';
}