fix line indenting

This commit is contained in:
Uwe Steinmann 2021-09-30 07:52:47 +02:00
parent 8c3857c6e2
commit 99efcac8bb
4 changed files with 153 additions and 153 deletions

View File

@ -217,7 +217,7 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify {
if (isset($GLOBALS['SEEDDMS_HOOKS']['mailqueue'])) { if (isset($GLOBALS['SEEDDMS_HOOKS']['mailqueue'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['mailqueue'] as $queueService) { foreach($GLOBALS['SEEDDMS_HOOKS']['mailqueue'] as $queueService) {
if(method_exists($queueService, 'queueMailJob')) { if(method_exists($queueService, 'queueMailJob')) {
$ret = $queueService->queueMailJob($mail_params, $to, $hdrs, getMLText($subject, $params, "", $lang), $message); $ret = $queueService->queueMailJob($mail_params, $to, $hdrs, getMLText($subject, $params, "", $lang), $message);
if($ret !== null) if($ret !== null)
return $ret; return $ret;

View File

@ -398,8 +398,8 @@ class Settings { /* {{{ */
* *
*/ */
function arrayToString($value) { /* {{{ */ function arrayToString($value) { /* {{{ */
return implode(";", $value); return implode(";", $value);
} /* }}} */ } /* }}} */
/** /**
* Return array from ';' seperated string * Return array from ';' seperated string
@ -408,8 +408,8 @@ class Settings { /* {{{ */
* *
*/ */
function stringToArray($value) { /* {{{ */ function stringToArray($value) { /* {{{ */
return explode(";", $Value); return explode(";", $Value);
} /* }}} */ } /* }}} */
/** /**
* set $_viewOnlineFileTypes * set $_viewOnlineFileTypes
@ -417,9 +417,9 @@ class Settings { /* {{{ */
* @param string $stringValue string value * @param string $stringValue string value
* *
*/ */
function setViewOnlineFileTypesFromString($stringValue) { /* {{{ */ function setViewOnlineFileTypesFromString($stringValue) { /* {{{ */
$this->_viewOnlineFileTypes = explode(";", $stringValue); $this->_viewOnlineFileTypes = explode(";", $stringValue);
} /* }}} */ } /* }}} */
/** /**
* get $_viewOnlineFileTypes in a string value * get $_viewOnlineFileTypes in a string value
@ -427,9 +427,9 @@ class Settings { /* {{{ */
* @return string value * @return string value
* *
*/ */
function getViewOnlineFileTypesToString() { /* {{{ */ function getViewOnlineFileTypesToString() { /* {{{ */
return implode(";", $this->_viewOnlineFileTypes); return implode(";", $this->_viewOnlineFileTypes);
} /* }}} */ } /* }}} */
/** /**
* set $_editOnlineFileTypes * set $_editOnlineFileTypes
@ -437,9 +437,9 @@ class Settings { /* {{{ */
* @param string $stringValue string value * @param string $stringValue string value
* *
*/ */
function setEditOnlineFileTypesFromString($stringValue) { /* {{{ */ function setEditOnlineFileTypesFromString($stringValue) { /* {{{ */
$this->_editOnlineFileTypes = explode(";", $stringValue); $this->_editOnlineFileTypes = explode(";", $stringValue);
} /* }}} */ } /* }}} */
/** /**
* get $_editOnlineFileTypes in a string value * get $_editOnlineFileTypes in a string value
@ -447,9 +447,9 @@ class Settings { /* {{{ */
* @return string value * @return string value
* *
*/ */
function getEditOnlineFileTypesToString() { /* {{{ */ function getEditOnlineFileTypesToString() { /* {{{ */
return implode(";", $this->_editOnlineFileTypes); return implode(";", $this->_editOnlineFileTypes);
} /* }}} */ } /* }}} */
/** /**
* Load config file * Load config file
@ -806,20 +806,20 @@ class Settings { /* {{{ */
* *
* @return true/false * @return true/false
*/ */
protected function setXMLAttributValue($node, $attributName, $attributValue) { /* {{{ */ protected function setXMLAttributValue($node, $attributName, $attributValue) { /* {{{ */
if (is_bool($attributValue)) { if (is_bool($attributValue)) {
if ($attributValue) if ($attributValue)
$attributValue = "true"; $attributValue = "true";
else else
$attributValue = "false"; $attributValue = "false";
} }
if (isset($node[$attributName])) { if (isset($node[$attributName])) {
$node[$attributName] = $attributValue; $node[$attributName] = $attributValue;
} else { } else {
$node->addAttribute($attributName, $attributValue); $node->addAttribute($attributName, $attributValue);
} }
} /* }}} */ } /* }}} */
/** /**
* Get XML node, create it if not exists * Get XML node, create it if not exists
@ -851,12 +851,12 @@ class Settings { /* {{{ */
* @return true/false * @return true/false
*/ */
public function save($configFilePath=NULL) { /* {{{ */ public function save($configFilePath=NULL) { /* {{{ */
if (is_null($configFilePath)) if (is_null($configFilePath))
$configFilePath = $this->_configFilePath; $configFilePath = $this->_configFilePath;
// Load // Load
$xml = simplexml_load_string(file_get_contents($configFilePath)); $xml = simplexml_load_string(file_get_contents($configFilePath));
$this->getXMLNode($xml, '/', 'configuration'); $this->getXMLNode($xml, '/', 'configuration');
// XML Path: /configuration/site/display // XML Path: /configuration/site/display
$this->getXMLNode($xml, '/configuration', 'site'); $this->getXMLNode($xml, '/configuration', 'site');
@ -973,71 +973,71 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "enableUserImage", $this->_enableUserImage); $this->setXMLAttributValue($node, "enableUserImage", $this->_enableUserImage);
$this->setXMLAttributValue($node, "disableSelfEdit", $this->_disableSelfEdit); $this->setXMLAttributValue($node, "disableSelfEdit", $this->_disableSelfEdit);
// XML Path: /configuration/system/authentication/connectors // XML Path: /configuration/system/authentication/connectors
foreach($this->_usersConnectors as $keyConn => $paramConn) foreach($this->_usersConnectors as $keyConn => $paramConn)
{ {
// search XML node // search XML node
$node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="'. $keyConn .'"]'); $node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="'. $keyConn .'"]');
// Just the first is configured // Just the first is configured
if (isset($node)) if (isset($node))
{ {
if (count($node)>0) if (count($node)>0)
{ {
$node = $node[0]; $node = $node[0];
} }
else else
{ {
$nodeParent = $xml->xpath('/configuration/system/authentication/connectors'); $nodeParent = $xml->xpath('/configuration/system/authentication/connectors');
$node = $nodeParent[0]->addChild("connector"); $node = $nodeParent[0]->addChild("connector");
} }
foreach($paramConn as $key => $value) foreach($paramConn as $key => $value)
{ {
$this->setXMLAttributValue($node, $key, $value); $this->setXMLAttributValue($node, $key, $value);
} }
} // isset($node) } // isset($node)
} // foreach } // foreach
// XML Path: /configuration/system/authentication/connectors // XML Path: /configuration/system/authentication/connectors
// manage old settings parameters // manage old settings parameters
if (isset($this->_ldapHost) && (strlen($this->_ldapHost)>0)) if (isset($this->_ldapHost) && (strlen($this->_ldapHost)>0))
{ {
if ($this->_ldapType == 1) if ($this->_ldapType == 1)
{ {
$node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="AD"]'); $node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="AD"]');
$node = $node[0]; $node = $node[0];
$this->setXMLAttributValue($node, "accountDomainName", $this->_ldapAccountDomainName); $this->setXMLAttributValue($node, "accountDomainName", $this->_ldapAccountDomainName);
} }
else else
{ {
$node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="ldap"]'); $node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="ldap"]');
$node = $node[0]; $node = $node[0];
} }
$this->setXMLAttributValue($node, "host", $this->_ldapHost); $this->setXMLAttributValue($node, "host", $this->_ldapHost);
$this->setXMLAttributValue($node, "port", $this->_ldapPort); $this->setXMLAttributValue($node, "port", $this->_ldapPort);
$this->setXMLAttributValue($node, "baseDN", $this->_ldapBaseDN); $this->setXMLAttributValue($node, "baseDN", $this->_ldapBaseDN);
} }
// XML Path: /configuration/system/database // XML Path: /configuration/system/database
$node = $this->getXMLNode($xml, '/configuration/system', 'database'); $node = $this->getXMLNode($xml, '/configuration/system', 'database');
$this->setXMLAttributValue($node, "dbDriver", $this->_dbDriver); $this->setXMLAttributValue($node, "dbDriver", $this->_dbDriver);
$this->setXMLAttributValue($node, "dbHostname", $this->_dbHostname); $this->setXMLAttributValue($node, "dbHostname", $this->_dbHostname);
$this->setXMLAttributValue($node, "dbDatabase", $this->_dbDatabase); $this->setXMLAttributValue($node, "dbDatabase", $this->_dbDatabase);
$this->setXMLAttributValue($node, "dbUser", $this->_dbUser); $this->setXMLAttributValue($node, "dbUser", $this->_dbUser);
$this->setXMLAttributValue($node, "dbPass", $this->_dbPass); $this->setXMLAttributValue($node, "dbPass", $this->_dbPass);
$this->setXMLAttributValue($node, "doNotCheckDBVersion", $this->_doNotCheckDBVersion); $this->setXMLAttributValue($node, "doNotCheckDBVersion", $this->_doNotCheckDBVersion);
// XML Path: /configuration/system/smtp // XML Path: /configuration/system/smtp
$node = $this->getXMLNode($xml, '/configuration/system', 'smtp'); $node = $this->getXMLNode($xml, '/configuration/system', 'smtp');
$this->setXMLAttributValue($node, "smtpServer", $this->_smtpServer); $this->setXMLAttributValue($node, "smtpServer", $this->_smtpServer);
$this->setXMLAttributValue($node, "smtpPort", $this->_smtpPort); $this->setXMLAttributValue($node, "smtpPort", $this->_smtpPort);
$this->setXMLAttributValue($node, "smtpSendFrom", $this->_smtpSendFrom); $this->setXMLAttributValue($node, "smtpSendFrom", $this->_smtpSendFrom);
$this->setXMLAttributValue($node, "smtpUser", $this->_smtpUser); $this->setXMLAttributValue($node, "smtpUser", $this->_smtpUser);
$this->setXMLAttributValue($node, "smtpPassword", $this->_smtpPassword); $this->setXMLAttributValue($node, "smtpPassword", $this->_smtpPassword);
// XML Path: /configuration/advanced/display // XML Path: /configuration/advanced/display
$advnode = $this->getXMLNode($xml, '/configuration', 'advanced'); $advnode = $this->getXMLNode($xml, '/configuration', 'advanced');
@ -1048,50 +1048,50 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "showMissingTranslations", $this->_showMissingTranslations); $this->setXMLAttributValue($node, "showMissingTranslations", $this->_showMissingTranslations);
// $this->setXMLAttributValue($node, "hiddenConfFields", $this->_hiddenConfFields); // $this->setXMLAttributValue($node, "hiddenConfFields", $this->_hiddenConfFields);
// XML Path: /configuration/advanced/authentication // XML Path: /configuration/advanced/authentication
$node = $this->getXMLNode($xml, '/configuration/advanced', 'authentication'); $node = $this->getXMLNode($xml, '/configuration/advanced', 'authentication');
$this->setXMLAttributValue($node, "guestID", $this->_guestID); $this->setXMLAttributValue($node, "guestID", $this->_guestID);
$this->setXMLAttributValue($node, "adminIP", $this->_adminIP); $this->setXMLAttributValue($node, "adminIP", $this->_adminIP);
$this->setXMLAttributValue($node, "apiKey", $this->_apiKey); $this->setXMLAttributValue($node, "apiKey", $this->_apiKey);
$this->setXMLAttributValue($node, "apiUserId", $this->_apiUserId); $this->setXMLAttributValue($node, "apiUserId", $this->_apiUserId);
$this->setXMLAttributValue($node, "apiOrigin", $this->_apiOrigin); $this->setXMLAttributValue($node, "apiOrigin", $this->_apiOrigin);
// XML Path: /configuration/advanced/edition // XML Path: /configuration/advanced/edition
$node = $this->getXMLNode($xml, '/configuration/advanced', 'edition'); $node = $this->getXMLNode($xml, '/configuration/advanced', 'edition');
$this->setXMLAttributValue($node, "enableAdminRevApp", $this->_enableAdminRevApp); $this->setXMLAttributValue($node, "enableAdminRevApp", $this->_enableAdminRevApp);
$this->setXMLAttributValue($node, "enableOwnerRevApp", $this->_enableOwnerRevApp); $this->setXMLAttributValue($node, "enableOwnerRevApp", $this->_enableOwnerRevApp);
$this->setXMLAttributValue($node, "enableSelfRevApp", $this->_enableSelfRevApp); $this->setXMLAttributValue($node, "enableSelfRevApp", $this->_enableSelfRevApp);
$this->setXMLAttributValue($node, "enableUpdateRevApp", $this->_enableUpdateRevApp); $this->setXMLAttributValue($node, "enableUpdateRevApp", $this->_enableUpdateRevApp);
$this->setXMLAttributValue($node, "enableRemoveRevApp", $this->_enableRemoveRevApp); $this->setXMLAttributValue($node, "enableRemoveRevApp", $this->_enableRemoveRevApp);
$this->setXMLAttributValue($node, "presetExpirationDate", $this->_presetExpirationDate); $this->setXMLAttributValue($node, "presetExpirationDate", $this->_presetExpirationDate);
$this->setXMLAttributValue($node, "versioningFileName", $this->_versioningFileName); $this->setXMLAttributValue($node, "versioningFileName", $this->_versioningFileName);
$this->setXMLAttributValue($node, "presetExpirationDate", $this->_presetExpirationDate); $this->setXMLAttributValue($node, "presetExpirationDate", $this->_presetExpirationDate);
$this->setXMLAttributValue($node, "workflowMode", $this->_workflowMode); $this->setXMLAttributValue($node, "workflowMode", $this->_workflowMode);
$this->setXMLAttributValue($node, "allowReviewerOnly", $this->_allowReviewerOnly); $this->setXMLAttributValue($node, "allowReviewerOnly", $this->_allowReviewerOnly);
$this->setXMLAttributValue($node, "enableVersionDeletion", $this->_enableVersionDeletion); $this->setXMLAttributValue($node, "enableVersionDeletion", $this->_enableVersionDeletion);
$this->setXMLAttributValue($node, "enableVersionModification", $this->_enableVersionModification); $this->setXMLAttributValue($node, "enableVersionModification", $this->_enableVersionModification);
$this->setXMLAttributValue($node, "enableDuplicateDocNames", $this->_enableDuplicateDocNames); $this->setXMLAttributValue($node, "enableDuplicateDocNames", $this->_enableDuplicateDocNames);
$this->setXMLAttributValue($node, "enableDuplicateSubFolderNames", $this->_enableDuplicateSubFolderNames); $this->setXMLAttributValue($node, "enableDuplicateSubFolderNames", $this->_enableDuplicateSubFolderNames);
$this->setXMLAttributValue($node, "overrideMimeType", $this->_overrideMimeType); $this->setXMLAttributValue($node, "overrideMimeType", $this->_overrideMimeType);
$this->setXMLAttributValue($node, "removeFromDropFolder", $this->_removeFromDropFolder); $this->setXMLAttributValue($node, "removeFromDropFolder", $this->_removeFromDropFolder);
// XML Path: /configuration/advanced/notification // XML Path: /configuration/advanced/notification
$node = $this->getXMLNode($xml, '/configuration/advanced', 'notification'); $node = $this->getXMLNode($xml, '/configuration/advanced', 'notification');
$this->setXMLAttributValue($node, "enableNotificationAppRev", $this->_enableNotificationAppRev); $this->setXMLAttributValue($node, "enableNotificationAppRev", $this->_enableNotificationAppRev);
$this->setXMLAttributValue($node, "enableOwnerNotification", $this->_enableOwnerNotification); $this->setXMLAttributValue($node, "enableOwnerNotification", $this->_enableOwnerNotification);
$this->setXMLAttributValue($node, "enableNotificationWorkflow", $this->_enableNotificationWorkflow); $this->setXMLAttributValue($node, "enableNotificationWorkflow", $this->_enableNotificationWorkflow);
// XML Path: /configuration/advanced/server // XML Path: /configuration/advanced/server
$node = $this->getXMLNode($xml, '/configuration/advanced', 'server'); $node = $this->getXMLNode($xml, '/configuration/advanced', 'server');
$this->setXMLAttributValue($node, "coreDir", $this->_coreDir); $this->setXMLAttributValue($node, "coreDir", $this->_coreDir);
$this->setXMLAttributValue($node, "luceneClassDir", $this->_luceneClassDir); $this->setXMLAttributValue($node, "luceneClassDir", $this->_luceneClassDir);
$this->setXMLAttributValue($node, "extraPath", $this->_extraPath); $this->setXMLAttributValue($node, "extraPath", $this->_extraPath);
$this->setXMLAttributValue($node, "contentOffsetDir", $this->_contentOffsetDir); $this->setXMLAttributValue($node, "contentOffsetDir", $this->_contentOffsetDir);
$this->setXMLAttributValue($node, "maxDirID", $this->_maxDirID); $this->setXMLAttributValue($node, "maxDirID", $this->_maxDirID);
$this->setXMLAttributValue($node, "updateNotifyTime", $this->_updateNotifyTime); $this->setXMLAttributValue($node, "updateNotifyTime", $this->_updateNotifyTime);
$this->setXMLAttributValue($node, "maxExecutionTime", $this->_maxExecutionTime); $this->setXMLAttributValue($node, "maxExecutionTime", $this->_maxExecutionTime);
$this->setXMLAttributValue($node, "cmdTimeout", $this->_cmdTimeout); $this->setXMLAttributValue($node, "cmdTimeout", $this->_cmdTimeout);
$this->setXMLAttributValue($node, "enableDebugMode", $this->_enableDebugMode); $this->setXMLAttributValue($node, "enableDebugMode", $this->_enableDebugMode);
/* Check if there is still a converters list with a target attribute */ /* Check if there is still a converters list with a target attribute */
$node = $xml->xpath('/configuration/advanced/converters[count(@*)=0]'); $node = $xml->xpath('/configuration/advanced/converters[count(@*)=0]');
@ -1130,8 +1130,8 @@ class Settings { /* {{{ */
} // foreach } // foreach
// XML Path: /configuration/extensions // XML Path: /configuration/extensions
$extnodes = $xml->xpath('/configuration/extensions'); $extnodes = $xml->xpath('/configuration/extensions');
if(!$extnodes) { if(!$extnodes) {
$nodeParent = $xml->xpath('/configuration'); $nodeParent = $xml->xpath('/configuration');
$extnodes = $nodeParent[0]->addChild("extensions"); $extnodes = $nodeParent[0]->addChild("extensions");
@ -1139,9 +1139,9 @@ class Settings { /* {{{ */
unset($xml->extensions); unset($xml->extensions);
$extnodes = $xml->addChild("extensions"); $extnodes = $xml->addChild("extensions");
} }
foreach($this->_extensions as $name => $extension) foreach($this->_extensions as $name => $extension)
{ {
// search XML node // search XML node
$extnode = $extnodes->addChild('extension'); $extnode = $extnodes->addChild('extension');
$this->setXMLAttributValue($extnode, 'name', $name); $this->setXMLAttributValue($extnode, 'name', $name);
$this->setXMLAttributValue($extnode, 'disable', $extension['__disable__'] ? 'true' : 'false'); $this->setXMLAttributValue($extnode, 'disable', $extension['__disable__'] ? 'true' : 'false');
@ -1167,10 +1167,10 @@ class Settings { /* {{{ */
*/ */
} // foreach } // foreach
// Save // Save
return $xml->asXML($configFilePath); return $xml->asXML($configFilePath);
} /* }}} */ } /* }}} */
/** /**
@ -1242,15 +1242,15 @@ class Settings { /* {{{ */
$pageURL = 'http'; $pageURL = 'http';
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") { if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
$pageURL .= "s"; $pageURL .= "s";
} }
$pageURL .= "://"; $pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") { if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else { } else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
} }
return $pageURL; return $pageURL;

View File

@ -39,25 +39,25 @@ if(!trim($settings->_encryptionKey)) {
$__basedir = dirname(dirname(__DIR__)); $__basedir = dirname(dirname(__DIR__));
$__datadir = dirname(dirname(__DIR__))."/data";; $__datadir = dirname(dirname(__DIR__))."/data";;
if(empty($settings->_rootDir)) { if(empty($settings->_rootDir)) {
$settings->_rootDir = $__basedir."/www/"; $settings->_rootDir = $__basedir."/www/";
} }
if(empty($settings->_contentDir)) { if(empty($settings->_contentDir)) {
$settings->_contentDir = $__basedir; $settings->_contentDir = $__basedir;
} }
if(empty($settings->_cacheDir)) { if(empty($settings->_cacheDir)) {
$settings->_cacheDir = $__datadir."/cache/"; $settings->_cacheDir = $__datadir."/cache/";
} }
if(empty($settings->_backupDir)) { if(empty($settings->_backupDir)) {
$settings->_backupDir = $__datadir."/backup/"; $settings->_backupDir = $__datadir."/backup/";
} }
if(empty($settings->_luceneDir)) { if(empty($settings->_luceneDir)) {
$settings->_luceneDir = $__datadir."/lucene/"; $settings->_luceneDir = $__datadir."/lucene/";
} }
if(empty($settings->_stagingDir)) { if(empty($settings->_stagingDir)) {
$settings->_stagingDir = $__datadir."/lucene/"; $settings->_stagingDir = $__datadir."/lucene/";
} }
if($settings->_dbDriver == 'sqlite' && empty($settings->_dbDatabase)) { if($settings->_dbDriver == 'sqlite' && empty($settings->_dbDatabase)) {
$settings->_dbDatabase = $__datadir."/content.db"; $settings->_dbDatabase = $__datadir."/content.db";
} }
ini_set('include_path', $settings->_rootDir.'pear'. PATH_SEPARATOR .ini_get('include_path')); ini_set('include_path', $settings->_rootDir.'pear'. PATH_SEPARATOR .ini_get('include_path'));

View File

@ -1015,12 +1015,12 @@ class SeedDMS_JwtToken { /* {{{ */
class SeedDMS_FolderTree { /* {{{ */ class SeedDMS_FolderTree { /* {{{ */
public function __construct($folder, $callback) { /* {{{ */ public function __construct($folder, $callback) { /* {{{ */
$iter = new \SeedDMS\RecursiveFolderIterator($folder); $iter = new \SeedDMS\RecursiveFolderIterator($folder);
$iter2 = new RecursiveIteratorIterator($iter, RecursiveIteratorIterator:: SELF_FIRST); $iter2 = new RecursiveIteratorIterator($iter, RecursiveIteratorIterator:: SELF_FIRST);
foreach($iter2 as $ff) { foreach($iter2 as $ff) {
call_user_func($callback, $ff, $iter2->getDepth()); call_user_func($callback, $ff, $iter2->getDepth());
// echo $ff->getID().': '.$ff->getFolderPathPlain().'-'.$ff->getName()."<br />"; // echo $ff->getID().': '.$ff->getFolderPathPlain().'-'.$ff->getName()."<br />";
} }
} /* }}} */ } /* }}} */
} /* }}} */ } /* }}} */