diff --git a/lam/templates/pdfedit/pdfpage.php b/lam/templates/pdfedit/pdfpage.php
index a96a7cf6..e466c57a 100644
--- a/lam/templates/pdfedit/pdfpage.php
+++ b/lam/templates/pdfedit/pdfpage.php
@@ -142,36 +142,23 @@ elseif(isset($_GET['add_section'])) {
array_splice($_SESSION['currentPDFStructure'],$_GET['add_section_position'],0,$entry);
}
// Add a new value field
-elseif(isset($_GET['add_field'])) {
- // Get available modules
- $modules = explode(',',$_GET['modules']);
- $fields = array();
- // Search each module for selected values
- foreach($modules as $module) {
- if(isset($_GET[$module])) {
- foreach($_GET[$module] as $field) {
- // Create ne value entry
- $fields[] = array('tag' => 'ENTRY','type' => 'complete','level' => '3','attributes' => array('NAME' => $module . '_' . $field));
- }
- }
+elseif(isset($_GET['add_new_field'])) {
+ $field = array('tag' => 'ENTRY','type' => 'complete','level' => '3','attributes' => array('NAME' => $_GET['new_field']));
+ $pos = 0;
+ // Find begin section to insert into
+ while($pos < $_GET['add_field_position']) {
+ next($_SESSION['currentPDFStructure']);
+ $pos++;
}
- if(count($fields) > 0) {
- $pos = 0;
- // Find begin section to insert into
- while($pos < $_GET['section']) {
- next($_SESSION['currentPDFStructure']);
- $pos++;
- }
+ $current = next($_SESSION['currentPDFStructure']);
+ $pos++;
+ // End of section to insert into
+ while($current && $current['tag'] != 'SECTION' && $current['type'] != 'close') {
$current = next($_SESSION['currentPDFStructure']);
$pos++;
- // End of section to insert into
- while($current && $current['tag'] != 'SECTION' && $current['type'] != 'close') {
- $current = next($_SESSION['currentPDFStructure']);
- $pos++;
- }
- // Insert new entry before closing section tag
- array_splice($_SESSION['currentPDFStructure'],$pos,0,$fields);
}
+ // Insert new entry before closing section tag
+ array_splice($_SESSION['currentPDFStructure'],$pos,0,array($field));
}
// Change section headline
elseif(isset($_GET['change'])) {
@@ -414,28 +401,29 @@ echo $_SESSION['header'];
\n\n" . "\n | \n" . - "\n\n" . "\n | \n" . - "\n\n" . - "\n | \n"; + "\n\n" . + ""; // We have a new section to start if($entry['tag'] == "SECTION" && $entry['type'] == "open") { $name = $entry['attributes']['NAME']; @@ -448,10 +436,7 @@ foreach($_SESSION['currentPDFStructure'] as $key => $entry) { $nonTextSections .= '\n"; ?> | ||||||||||||
- - | -+ | $entry) { $sections .= '\n"; ?> | |||||||||||||
+ |
|
||||||||||||||
- | -+ | @@ -518,16 +501,19 @@ foreach($_SESSION['currentPDFStructure'] as $key => $entry) { | |||||||||||||
- | -- - | -+ |
+ |
||||||||||||
+ | + | ++ + | +|||||||||||||
|
|||||||||||||||
- |
@@ -561,60 +545,6 @@ foreach($_SESSION['currentPDFStructure'] as $key => $entry) {
|
- - - | - - -- - | ||||||||||||
@@ -705,11 +635,30 @@ foreach($_SESSION['availablePDFFields'] as $module => $fields) {
+ : - |
|||||||||||||||