better handling of return values of hooks

This commit is contained in:
Uwe Steinmann 2019-01-17 18:30:10 +01:00
parent 50cf2fa5a0
commit 869a82d4a8

View File

@ -121,10 +121,10 @@ class SeedDMS_View_Common {
break; break;
} }
if($tmpret !== null) { if($tmpret !== null) {
if(is_string($tmpret)) if(is_string($tmpret)) {
$ret .= $tmpret; $ret = ($ret === null) ? $tmpret : (is_string($ret) ? $ret.$tmpret : array_merge($ret, array($tmpret)));
elseif(is_array($tmpret) || is_object($tmpret)) { } elseif(is_array($tmpret) || is_object($tmpret)) {
$ret = ($ret === null) ? $tmpret : array_merge($ret, $tmpret); $ret = ($ret === null) ? $tmpret : (is_string($ret) ? array_merge(array($ret), $tmpret) : array_merge($ret, $tmpret));
} else } else
$ret = $tmpret; $ret = $tmpret;
} }