diff --git a/lam/templates/pdfedit/pdfmain.php b/lam/templates/pdfedit/pdfmain.php index 8a41296c..87cac2cf 100644 --- a/lam/templates/pdfedit/pdfmain.php +++ b/lam/templates/pdfedit/pdfmain.php @@ -113,6 +113,13 @@ for ($i = 0; $i < sizeof($templateClasses); $i++) { include '../main_header.php'; ?>

+ + +
diff --git a/lam/templates/pdfedit/pdfpage.php b/lam/templates/pdfedit/pdfpage.php index 8eb1a173..9565cd1c 100644 --- a/lam/templates/pdfedit/pdfpage.php +++ b/lam/templates/pdfedit/pdfpage.php @@ -84,23 +84,21 @@ if ((isset($_GET['headline'])) && ($_GET['headline'] != $_SESSION['currentPageDe // Check if pdfname is valid, then save current structure to file and go to // main pdf structure page +$saveErrors = array(); if(isset($_GET['submit'])) { - include '../main_header.php'; if(!isset($_GET['pdfname']) || !preg_match('/[a-zA-Z0-9\-\_]+/',$_GET['pdfname'])) { - StatusMessage('ERROR', _('PDF-structure name not valid'), _('The name for that PDF-structure you submitted is not valid. A valid name must constist at least of one of the following characters \'a-z\',\'A-Z\',\'0-9\',\'_\',\'-\',\'.\'.')); + $saveErrors[] = array('ERROR', _('PDF structure name not valid'), _('The name for that PDF-structure you submitted is not valid. A valid name must consist of the following characters: \'a-z\',\'A-Z\',\'0-9\',\'_\',\'-\'.')); } else { $return = savePDFStructureDefinitions($_GET['type'],$_GET['pdfname']); if($return == 'ok') { - StatusMessage('INFO', _("PDF structure was successfully saved."), $_GET['pdfname']); + metaRefresh('pdfmain.php?savedSuccessfully=' . $_GET['pdfname']); + exit; } elseif($return == 'no perms'){ - StatusMessage('ERROR', _("Could not save PDF profile, access denied."), $_GET['pdfname']); + $saveErrors[] = array('ERROR', _("Could not save PDF structure, access denied."), $_GET['pdfname']); } } - echo ("
" . _("Back to PDF Editor") . ""); - echo ""; - exit; } // add a new text field elseif(isset($_GET['add_text'])) { @@ -388,7 +386,15 @@ foreach($logoFiles as $logoFile) { // print header include '../main_header.php'; -// TODO Change enctype of form + +// print error messages if any +if (sizeof($saveErrors) > 0) { + for ($i = 0; $i < sizeof($saveErrors); $i++) { + call_user_func_array('StatusMessage', $saveErrors[$i]); + } + echo "
\n"; +} + ?>
@@ -662,50 +668,24 @@ foreach($_SESSION['currentPDFStructure'] as $key => $entry) {
- - - - - - - - - - - - - - - - -
- : - - - - -
-   -
- - - : + - "> - - "> - -   -
+ else if (isset($_POST['pdfname'])) { + $structureName = $_POST['pdfname']; + } + ?> + + +

+ "> +   + ">