pass 3rd parameter to formField() if returned by hook

This commit is contained in:
Uwe Steinmann 2021-03-19 10:49:51 +01:00
parent 2c013b3429
commit 56ae6a89f7
5 changed files with 12 additions and 12 deletions

View File

@ -315,7 +315,7 @@ $(document).ready(function() {
$arr = $this->callHook('addDocumentAttribute', null, $attrdef); $arr = $this->callHook('addDocumentAttribute', null, $attrdef);
if(is_array($arr)) { if(is_array($arr)) {
if($arr) { if($arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} }
} elseif(is_string($arr)) { } elseif(is_string($arr)) {
echo $arr; echo $arr;
@ -327,7 +327,7 @@ $(document).ready(function() {
$arrs = $this->callHook('addDocumentAttributes', null); $arrs = $this->callHook('addDocumentAttributes', null);
if(is_array($arrs)) { if(is_array($arrs)) {
foreach($arrs as $arr) { foreach($arrs as $arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} }
} elseif(is_string($arrs)) { } elseif(is_string($arrs)) {
echo $arrs; echo $arrs;
@ -385,7 +385,7 @@ $(document).ready(function() {
foreach($attrdefs as $attrdef) { foreach($attrdefs as $attrdef) {
$arr = $this->callHook('addDocumentContentAttribute', null, $attrdef); $arr = $this->callHook('addDocumentContentAttribute', null, $attrdef);
if(is_array($arr)) { if(is_array($arr)) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} elseif(is_string($arr)) { } elseif(is_string($arr)) {
echo $arr; echo $arr;
} else { } else {
@ -397,7 +397,7 @@ $(document).ready(function() {
$arrs = $this->callHook('addDocumentContentAttributes', $folder); $arrs = $this->callHook('addDocumentContentAttributes', $folder);
if(is_array($arrs)) { if(is_array($arrs)) {
foreach($arrs as $arr) { foreach($arrs as $arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} }
} elseif(is_string($arrs)) { } elseif(is_string($arrs)) {
echo $arrs; echo $arrs;

View File

@ -119,7 +119,7 @@ $(document).ready( function() {
$arr = $this->callHook('addFolderAttribute', null, $attrdef); $arr = $this->callHook('addFolderAttribute', null, $attrdef);
if(is_array($arr)) { if(is_array($arr)) {
if($arr) { if($arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} }
} elseif(is_string($arr)) { } elseif(is_string($arr)) {
echo $arr; echo $arr;
@ -135,7 +135,7 @@ $(document).ready( function() {
$arrs = $this->callHook('addFolderAttributes', null); $arrs = $this->callHook('addFolderAttributes', null);
if(is_array($arrs)) { if(is_array($arrs)) {
foreach($arrs as $arr) { foreach($arrs as $arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} }
} elseif(is_string($arrs)) { } elseif(is_string($arrs)) {
echo $arrs; echo $arrs;

View File

@ -215,7 +215,7 @@ $(document).ready( function() {
$arr = $this->callHook('editDocumentAttribute', $document, $attrdef); $arr = $this->callHook('editDocumentAttribute', $document, $attrdef);
if(is_array($arr)) { if(is_array($arr)) {
if($arr) { if($arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} }
} elseif(is_string($arr)) { } elseif(is_string($arr)) {
echo $arr; echo $arr;
@ -227,7 +227,7 @@ $(document).ready( function() {
$arrs = $this->callHook('addDocumentAttributes', $document); $arrs = $this->callHook('addDocumentAttributes', $document);
if(is_array($arrs)) { if(is_array($arrs)) {
foreach($arrs as $arr) { foreach($arrs as $arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} }
} elseif(is_string($arrs)) { } elseif(is_string($arrs)) {
echo $arrs; echo $arrs;

View File

@ -116,7 +116,7 @@ $(document).ready(function() {
$arr = $this->callHook('editFolderAttribute', $folder, $attrdef); $arr = $this->callHook('editFolderAttribute', $folder, $attrdef);
if(is_array($arr)) { if(is_array($arr)) {
if($arr) { if($arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} }
} elseif(is_string($arr)) { } elseif(is_string($arr)) {
echo $arr; echo $arr;
@ -128,7 +128,7 @@ $(document).ready(function() {
$arrs = $this->callHook('addFolderAttributes', $folder); $arrs = $this->callHook('addFolderAttributes', $folder);
if(is_array($arrs)) { if(is_array($arrs)) {
foreach($arrs as $arr) { foreach($arrs as $arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} }
} elseif(is_string($arrs)) { } elseif(is_string($arrs)) {
echo $arrs; echo $arrs;

View File

@ -282,7 +282,7 @@ console.log(element);
$arr = $this->callHook('editDocumentContentAttribute', $document, $attrdef); $arr = $this->callHook('editDocumentContentAttribute', $document, $attrdef);
if(is_array($arr)) { if(is_array($arr)) {
if($arr) if($arr)
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} elseif(is_string($arr)) { } elseif(is_string($arr)) {
echo $arr; echo $arr;
} else { } else {
@ -293,7 +293,7 @@ console.log(element);
$arrs = $this->callHook('addDocumentContentAttributes', $document); $arrs = $this->callHook('addDocumentContentAttributes', $document);
if(is_array($arrs)) { if(is_array($arrs)) {
foreach($arrs as $arr) { foreach($arrs as $arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} }
} elseif(is_string($arrs)) { } elseif(is_string($arrs)) {
echo $arrs; echo $arrs;