server()) { metaRefresh("../login.php"); exit; } // check if new template should be created if(isset($_POST['createNewTemplate'])) { metaRefresh('pdfpage.php?type=' . $_POST['scope']); exit(); } $scopes = $_SESSION['config']->get_ActiveTypes(); $sortedScopes = array(); for ($i = 0; $i < sizeof($scopes); $i++) { $sortedScopes[$scopes[$i]] = getTypeAlias($scopes[$i]); } natcasesort($sortedScopes); $container = new htmlTable(); $container->addElement(new htmlTitle(_('PDF editor')), true); if (isset($_POST['deleteProfile']) && ($_POST['deleteProfile'] == 'true')) { // delete structure if (deletePDFStructureDefinition($_POST['profileDeleteType'], $_POST['profileDeleteName'])) { $message = new htmlStatusMessage('INFO', _('Deleted PDF structure.'), getTypeAlias($_POST['profileDeleteType']) . ': ' . htmlspecialchars($_POST['profileDeleteName'])); $message->colspan = 10; $container->addElement($message, true); } else { $message = new htmlStatusMessage('ERROR', _('Unable to delete PDF structure!'), getTypeAlias($_POST['profileDeleteType']) . ': ' . htmlspecialchars($_POST['profileDeleteName'])); $message->colspan = 10; $container->addElement($message, true); } } // get list of account types $availableScopes = ''; $templateClasses = array(); foreach ($sortedScopes as $scope => $title) { $templateClasses[] = array( 'scope' => $scope, 'title' => $title, 'templates' => ""); $availableScopes[$title] = $scope; } // get list of templates for each account type for ($i = 0; $i < sizeof($templateClasses); $i++) { $templateClasses[$i]['templates'] = getPDFStructureDefinitions($templateClasses[$i]['scope']); } // check if a template should be edited for ($i = 0; $i < sizeof($templateClasses); $i++) { if (isset($_POST['editTemplate_' . $templateClasses[$i]['scope']]) || isset($_POST['editTemplate_' . $templateClasses[$i]['scope'] . '_x'])) { metaRefresh('pdfpage.php?type=' . $templateClasses[$i]['scope'] . '&edit=' . $_POST['template_' . $templateClasses[$i]['scope']]); exit; } } include '../main_header.php'; ?>