PDF editor bug should be removed
This commit is contained in:
parent
fe4947e491
commit
61012f6572
|
@ -26,19 +26,23 @@ include_once("ldap.inc");
|
||||||
|
|
||||||
function getPDFStructureDefinitions($scope = "user") {
|
function getPDFStructureDefinitions($scope = "user") {
|
||||||
$return = array();
|
$return = array();
|
||||||
$dirHandle = opendir($_SESSION['lampath'] . '/config/pdf/' . $scope . '/');
|
$path = $_SESSION['lampath'] . 'config/pdf/' . $scope;
|
||||||
|
if(is_dir($path)) {
|
||||||
|
$dirHandle = opendir($path);
|
||||||
while($file = readdir($dirHandle)) {
|
while($file = readdir($dirHandle)) {
|
||||||
if(!is_dir($file) && $file != '.' && $file != '..' && $file != 'default.xml') {
|
if(!is_dir($file) && $file != '.' && $file != '..' && $file != 'default.xml') {
|
||||||
array_push($return, substr($file,0,strlen($file)-4));
|
array_push($return, substr($file,0,strlen($file)-4));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort($return);
|
sort($return);
|
||||||
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadPDFStructureDefinitions($scope='user', $definition='default.xml') {
|
function loadPDFStructureDefinitions($scope='user', $definition='default.xml') {
|
||||||
$parser = new xmlParser();
|
$parser = new xmlParser();
|
||||||
$xml = $parser->parse($_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition);
|
$file = $_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition;
|
||||||
|
$xml = $parser->parse($file);
|
||||||
|
|
||||||
$border = array();
|
$border = array();
|
||||||
$structure = array();
|
$structure = array();
|
||||||
|
@ -61,7 +65,7 @@ function savePDFStructureDefinitions($scope,$definition) {
|
||||||
$handle = fopen($_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition,'w');
|
$handle = fopen($_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition,'w');
|
||||||
$pdf_attributes = '';
|
$pdf_attributes = '';
|
||||||
foreach($_SESSION['currentPageDefinitions'] as $key => $value) {
|
foreach($_SESSION['currentPageDefinitions'] as $key => $value) {
|
||||||
if($key != 'TYPE') {
|
if($key != 'type') {
|
||||||
$pdf_attributes .= ' ' . $key . '="' . $value . '"';
|
$pdf_attributes .= ' ' . $key . '="' . $value . '"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +102,8 @@ function savePDFStructureDefinitions($scope,$definition) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function deletePDFStructureDefinition($scope,$definition) {
|
function deletePDFStructureDefinition($scope,$definition) {
|
||||||
return unlink($_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition . '.xml');
|
$file = $_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition;
|
||||||
|
return unlink($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAvailableLogos() {
|
function getAvailableLogos() {
|
||||||
|
|
|
@ -36,12 +36,12 @@ setlanguage();
|
||||||
|
|
||||||
// Unset pdf structure definitions in session if set
|
// Unset pdf structure definitions in session if set
|
||||||
if(isset($_SESSION['currentPDFStructure'])) {
|
if(isset($_SESSION['currentPDFStructure'])) {
|
||||||
unset($_SESSION['currentPDFStructure']);
|
|
||||||
unset($_SESSION['availablePDFFields']);
|
|
||||||
unset($_SESSION['currentPageDefinitions']);
|
|
||||||
session_unregister('currentPDFStructure');
|
session_unregister('currentPDFStructure');
|
||||||
session_unregister('availablePDFFields');
|
session_unregister('availablePDFFields');
|
||||||
session_unregister('currentPageDefinitions');
|
session_unregister('currentPageDefinitions');
|
||||||
|
unset($_SESSION['currentPDFStructure']);
|
||||||
|
unset($_SESSION['availablePDFFields']);
|
||||||
|
unset($_SESSION['currentPageDefinitions']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if user is logged in, if not go to login
|
// check if user is logged in, if not go to login
|
||||||
|
|
|
@ -319,7 +319,7 @@ elseif(isset($_POST['page'])) {
|
||||||
$_SESSION['currentPageDefinitions']['logo-max'] = true;
|
$_SESSION['currentPageDefinitions']['logo-max'] = true;
|
||||||
}
|
}
|
||||||
if($_POST['headline'] != 'LDAP Account Manager' && $_POST['headline'] != $_SESSION['currentPageDefinitions']['headline']) {
|
if($_POST['headline'] != 'LDAP Account Manager' && $_POST['headline'] != $_SESSION['currentPageDefinitions']['headline']) {
|
||||||
$_SESSION['currentPageDefinitions']['headline'] = $_POST['headline'];
|
$_SESSION['currentPageDefinitions']['headline'] = str_replace('<','',str_replace('>','',$_POST['headline']));
|
||||||
}
|
}
|
||||||
if($_POST['margin-top'] != '10.0' && $_SESSION['currentPageDefinitions']['margin-top'] != $_POST['margin-top']) {
|
if($_POST['margin-top'] != '10.0' && $_SESSION['currentPageDefinitions']['margin-top'] != $_POST['margin-top']) {
|
||||||
$_SESSION['currentPageDefinitions']['margin-top'] = $_POST['margin-top'];
|
$_SESSION['currentPageDefinitions']['margin-top'] = $_POST['margin-top'];
|
||||||
|
|
Loading…
Reference in New Issue