From b9f4d7b0ba8f3519bf9994fea5fa143dc54bb353 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 23 Jul 2021 14:03:44 +0200 Subject: [PATCH] issue a message if no attributes are defined --- views/bootstrap/class.EditAttributes.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/views/bootstrap/class.EditAttributes.php b/views/bootstrap/class.EditAttributes.php index 45be4b2ba..6a969236b 100644 --- a/views/bootstrap/class.EditAttributes.php +++ b/views/bootstrap/class.EditAttributes.php @@ -52,8 +52,8 @@ class SeedDMS_View_EditAttributes extends SeedDMS_Theme_Style { contentContainerStart(); if($attrdefs) { + $this->contentContainerStart(); foreach($attrdefs as $attrdef) { $arr = $this->callHook('editDocumentContentAttribute', $version, $attrdef); if(is_array($arr)) { @@ -66,17 +66,19 @@ class SeedDMS_View_EditAttributes extends SeedDMS_Theme_Style { $this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, $version->getAttribute($attrdef))); } } - } - $arrs = $this->callHook('addDocumentContentAttributes', $version); - if(is_array($arrs)) { - foreach($arrs as $arr) { - $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null); + $arrs = $this->callHook('addDocumentContentAttributes', $version); + if(is_array($arrs)) { + foreach($arrs as $arr) { + $this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null); + } + } elseif(is_string($arrs)) { + echo $arrs; } - } elseif(is_string($arrs)) { - echo $arrs; + $this->contentContainerEnd(); + $this->formSubmit(" ".getMLText('save')); + } else { + $this->warningMsg(getMLText('no_attributes_defined')); } - $this->contentContainerEnd(); - $this->formSubmit(" ".getMLText('save')); ?>