add new method printAttribute() (just like in 5.1.x)

This commit is contained in:
Uwe Steinmann 2021-07-12 19:47:34 +02:00
parent 652acf4b86
commit e733b4fced

View File

@ -83,6 +83,21 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
} }
} /* }}} */ } /* }}} */
/**
* Output a single attribute in the document info section
*
* @param object $attribute attribute
*/
protected function printAttribute($attribute) { /* {{{ */
$attrdef = $attribute->getAttributeDefinition();
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td><?php echo $this->getAttributeValue($attribute); ?></td>
</tr>
<?php
} /* }}} */
protected function printVersionAttributes($folder, $version) { /* {{{ */ protected function printVersionAttributes($folder, $version) { /* {{{ */
$attributes = $version->getAttributes(); $attributes = $version->getAttributes();
if($attributes) { if($attributes) {
@ -363,13 +378,7 @@ $(document).ready( function() {
} elseif(is_string($arr)) { } elseif(is_string($arr)) {
echo $arr; echo $arr;
} else { } else {
$attrdef = $attribute->getAttributeDefinition(); $this->printAttribute($attribute);
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td><?php echo $this->getAttributeValue($attribute); ?></td>
</tr>
<?php
} }
} }
} }