diff --git a/lam/templates/pdfedit/pdfpage.php b/lam/templates/pdfedit/pdfpage.php index 92bc09bd..3cd07fa3 100644 --- a/lam/templates/pdfedit/pdfpage.php +++ b/lam/templates/pdfedit/pdfpage.php @@ -107,38 +107,40 @@ if(isset($_GET['submit'])) { echo ""; exit; } -// Add a new section or static text -elseif(isset($_GET['add'])) { - // Check if name for new section is specified when needed - if($_GET['section_type'] == 'text' && (!isset($_GET['section_text']) || $_GET['section_text'] == '')) { - StatusMessage('ERROR',_('No section text specified'),_('The headline for a new section must contain at least one character.')); - } +// add a new text field +elseif(isset($_GET['add_text'])) { // Check if text for static text field is specified - elseif($_GET['section_type'] == 'textbox' && (!isset($_GET['text_text']) || $_GET['text_text'] == '')) { + if(!isset($_GET['text_text']) || ($_GET['text_text'] == '')) { StatusMessage('ERROR',_('No static text specified'),_('The static text must contain at least one character.')); } else { - // Add a new section - if(($_GET['section_type'] == 'item') || ($_GET['section_type'] == 'text')) { - $attributes = array(); - // Add a new section with user headline - if($_GET['section_type'] == 'text') { - $attributes['NAME'] = $_GET['section_text']; - } - // Add a new section with a module value headline - elseif($_GET['section_type'] == 'item') { - $attributes['NAME'] = '_' . $_GET['section_item']; - } - $entry = array(array('tag' => 'SECTION','type' => 'open','level' => '2','attributes' => $attributes),array('tag' => 'SECTION','type' => 'close','level' => '2')); - } - // Add new static text field - elseif($_GET['section_type'] == 'textbox') { - $entry = array(array('tag' => 'TEXT','type' => 'complete','level' => '2','value' => $_GET['text_text'])); - } + $entry = array(array('tag' => 'TEXT','type' => 'complete','level' => '2','value' => $_GET['text_text'])); // Insert new field in structure - array_splice($_SESSION['currentPDFStructure'],$_GET['add_position'],0,$entry); + array_splice($_SESSION['currentPDFStructure'],$_GET['add_text_position'],0,$entry); } } +// add a new section with text headline +elseif(isset($_GET['add_sectionText'])) { + // Check if name for new section is specified when needed + if(!isset($_GET['section_text']) || ($_GET['section_text'] == '')) { + StatusMessage('ERROR',_('No section text specified'),_('The headline for a new section must contain at least one character.')); + } + else { + $attributes = array(); + $attributes['NAME'] = $_GET['section_text']; + $entry = array(array('tag' => 'SECTION','type' => 'open','level' => '2','attributes' => $attributes),array('tag' => 'SECTION','type' => 'close','level' => '2')); + // Insert new field in structure + array_splice($_SESSION['currentPDFStructure'],$_GET['add_sectionText_position'],0,$entry); + } +} +// Add a new section with item as headline +elseif(isset($_GET['add_section'])) { + $attributes = array(); + $attributes['NAME'] = '_' . $_GET['section_item']; + $entry = array(array('tag' => 'SECTION','type' => 'open','level' => '2','attributes' => $attributes),array('tag' => 'SECTION','type' => 'close','level' => '2')); + // Insert new field in structure + array_splice($_SESSION['currentPDFStructure'],$_GET['add_section_position'],0,$entry); +} // Add a new value field elseif(isset($_GET['add_field'])) { // Get available modules @@ -624,8 +626,8 @@ foreach($_SESSION['availablePDFFields'] as $module => $fields) {
- - + +
- - - - - - - -
@@ -636,21 +638,34 @@ foreach($_SESSION['availablePDFFields'] as $module => $fields) { - + - + +
- + :     - : + + : + + +
- - + :     + + : + + +
@@ -665,39 +680,27 @@ foreach($_SESSION['availablePDFFields'] as $module => $fields) {
- + - +
- + +     - + : + + +
- : - - -
-
-
- -