hook documentInfos() replaces title and container, new hook additionalDocumentInfos

This commit is contained in:
Uwe Steinmann 2020-11-13 11:23:04 +01:00
parent c36d5c9cb9
commit f094262e8b

View File

@ -197,15 +197,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$user = $this->params['user']; $user = $this->params['user'];
$document = $this->params['document']; $document = $this->params['document'];
$txt = $this->callHook('documentInfos', $document);
if(is_string($txt))
echo $txt;
else {
$this->contentHeading(getMLText("document_infos")); $this->contentHeading(getMLText("document_infos"));
$this->contentContainerStart(); $this->contentContainerStart();
$txt = $this->callHook('preDocumentInfos', $document); $txt = $this->callHook('preDocumentInfos', $document);
if(is_string($txt)) if(is_string($txt))
echo $txt; echo $txt;
$txt = $this->callHook('documentInfos', $document);
if(is_string($txt))
echo $txt;
else {
?> ?>
<table class="table-condensed"> <table class="table-condensed">
<?php <?php
@ -320,8 +320,6 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
<?php <?php
} }
} }
?>
<?php
$attributes = $document->getAttributes(); $attributes = $document->getAttributes();
if($attributes) { if($attributes) {
foreach($attributes as $attribute) { foreach($attributes as $attribute) {
@ -338,14 +336,25 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
} }
} }
} }
$arrarr = $this->callHook('additionalDocumentInfos', $document);
if(is_array($arrarr)) {
foreach($arrarr as $arr) {
echo "<tr>";
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
}
} elseif(is_string($arrarr)) {
echo $arrarr;
}
?> ?>
</table> </table>
<?php <?php
}
$txt = $this->callHook('postDocumentInfos', $document); $txt = $this->callHook('postDocumentInfos', $document);
if(is_string($txt)) if(is_string($txt))
echo $txt; echo $txt;
$this->contentContainerEnd(); $this->contentContainerEnd();
}
} /* }}} */ } /* }}} */
function preview() { /* {{{ */ function preview() { /* {{{ */