diff --git a/lam/templates/pdfedit/pdfmain.php b/lam/templates/pdfedit/pdfmain.php index 43470fc8..acec5114 100644 --- a/lam/templates/pdfedit/pdfmain.php +++ b/lam/templates/pdfedit/pdfmain.php @@ -40,7 +40,7 @@ $Id$ */ /** -* This is the main window of the pdf structure editor. +* This is the main window of the PDF structure editor. * * @author Michael Duergner * @author Roland Gruber @@ -72,7 +72,7 @@ if (!empty($_POST)) { setlanguage(); -// Unset pdf structure definitions in session if set +// Unset PDF structure definitions in session if set if(isset($_SESSION['currentPDFStructure'])) { unset($_SESSION['currentPDFStructure']); unset($_SESSION['currentPageDefinitions']); @@ -124,7 +124,7 @@ foreach ($configProfiles as $profileName) { $serverProfiles[$profileName] = new \LAMConfig($profileName); } -// import profiles +// import structures if (!empty($_POST['import'])) { $cfg = new LAMCfgMain(); $typeId = $_POST['typeId']; @@ -147,7 +147,30 @@ if (!empty($_POST['import'])) { } } - +// export structures +if (!empty($_POST['export'])) { + $cfg = new LAMCfgMain(); + $typeId = $_POST['typeId']; + // check master password + $errMessage = null; + if (!$cfg->checkPassword($_POST['passwd_e_' . $_POST['typeId']])) { + $errMessage = new htmlStatusMessage('ERROR', _('Master password is wrong!')); + } + elseif (!empty($_POST['exportProfiles_' . $typeId])) { + $options = array(); + foreach ($_POST['exportProfiles_' . $typeId] as $importProfiles) { + $parts = explode('##', $importProfiles); + $options[] = array('conf' => $parts[0], 'typeId' => $parts[1]); + } + $typeId = $_POST['typeId']; + $name = $_POST['name_' . $typeId]; + $errMessage = exportStructures($typeId, $name, $options, $serverProfiles, $typeManager); + } + if ($errMessage != null) { + $errMessage->colspan = 10; + $container->addElement($errMessage, true); + } +} // upload logo file if (isset($_POST['uploadLogo']) && !empty($_FILES['logoUpload']) && !empty($_FILES['logoUpload']['size'])) { @@ -334,54 +357,52 @@ include '../main_header.php'; echo ''; echo "\n"; + + //export dialog + echo "