fixed 5.4 issue and insert position for PDF editor

This commit is contained in:
Roland Gruber 2017-08-24 20:29:55 +02:00
parent d545622594
commit 485c04f092
2 changed files with 3 additions and 3 deletions

View File

@ -652,7 +652,7 @@ class PDFEntrySection {
* @return boolean is attribute * @return boolean is attribute
*/ */
public function isAttributeTitle() { public function isAttributeTitle() {
return boolval(preg_match('/^_([a-zA-Z0-9_-])+$/', $this->title)); return (bool) preg_match('/^_([a-zA-Z0-9_-])+$/', $this->title);
} }
/** /**

View File

@ -553,14 +553,14 @@ function addSection(&$structure) {
} }
else { else {
$section = new PDFEntrySection($_POST['new_section_text']); $section = new PDFEntrySection($_POST['new_section_text']);
array_splice($sections, $_POST['add_text_position'], 0, array($section)); array_splice($sections, $_POST['add_sectionText_position'], 0, array($section));
$structure->setSections($sections); $structure->setSections($sections);
} }
} }
// Add a new section with item as headline // Add a new section with item as headline
elseif(isset($_POST['add_section'])) { elseif(isset($_POST['add_section'])) {
$section = new PDFEntrySection('_' . $_POST['new_section_item']); $section = new PDFEntrySection('_' . $_POST['new_section_item']);
array_splice($sections, $_POST['add_text_position'], 0, array($section)); array_splice($sections, $_POST['add_section_position'], 0, array($section));
$structure->setSections($sections); $structure->setSections($sections);
} }
} }