Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2022-07-26 14:33:23 +02:00
commit b8fd313e2d
3 changed files with 15 additions and 13 deletions

View File

@ -17,6 +17,7 @@
"pear/db": "*", "pear/db": "*",
"alecrabbit/php-console-colour": "*", "alecrabbit/php-console-colour": "*",
"dragonmantank/cron-expression": "^2.2", "dragonmantank/cron-expression": "^2.2",
"zf1/zend-search-lucene": "*" "zf1/zend-search-lucene": "*",
"symfony/http-foundation": "^5.4"
} }
} }

View File

@ -54,17 +54,18 @@ class SeedDMS_Controller_Common {
* @return mixed return value of called method * @return mixed return value of called method
*/ */
function __invoke($get=array()) { function __invoke($get=array()) {
$this->callHook('preRun', isset($get['action']) ? $get['action'] : 'run'); if(!$this->callHook('preRun', get_class($this), isset($get['action']) ? $get['action'] : 'run', $get)) {
if(isset($get['action']) && $get['action']) { if(isset($get['action']) && $get['action']) {
if(method_exists($this, $get['action'])) { if(method_exists($this, $get['action'])) {
return $this->{$get['action']}(); return $this->{$get['action']}();
} else { } else {
echo "Missing action '".$get['action']."'"; echo "Missing action '".$get['action']."'";
return false; return false;
} }
} else } else
return $this->run(); return $this->run();
$this->callHook('postRun', isset($get['action']) ? $get['action'] : 'run'); }
$this->callHook('postRun', get_class($this), isset($get['action']) ? $get['action'] : 'run', $get);
} }
function setParams($params) { function setParams($params) {

View File

@ -82,7 +82,7 @@ $docname = $document->getName();
$controller->setParam('document', $document); $controller->setParam('document', $document);
$controller->setParam('fulltextservice', $fulltextservice); $controller->setParam('fulltextservice', $fulltextservice);
if(!$controller->run()) { if(!$controller($_POST)) {
if ($controller->getErrorMsg() != '') if ($controller->getErrorMsg() != '')
$errormsg = $controller->getErrorMsg(); $errormsg = $controller->getErrorMsg();
else else