move code into getAttributeValue()

This commit is contained in:
Uwe Steinmann 2020-08-28 11:53:34 +02:00
parent f1d1c01c70
commit d7fe2087d1

View File

@ -93,30 +93,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td>
<?php
switch($attrdef->getType()) {
case SeedDMS_Core_AttributeDefinition::type_url:
$attrs = $attribute->getValueAsArray();
$tmp = array();
foreach($attrs as $attr) {
$tmp[] = '<a href="'.htmlspecialchars($attr).'">'.htmlspecialchars($attr).'</a>';
}
echo implode('<br />', $tmp);
break;
case SeedDMS_Core_AttributeDefinition::type_email:
$attrs = $attribute->getValueAsArray();
$tmp = array();
foreach($attrs as $attr) {
$tmp[] = '<a mailto="'.htmlspecialchars($attr).'">'.htmlspecialchars($attr).'</a>';
}
echo implode('<br />', $tmp);
break;
default:
echo htmlspecialchars(implode(', ', $attribute->getValueAsArray()));
}
?>
</td>
<td><?php echo $this->getAttributeValue($attribute); ?></td>
</tr>
<?php
} /* }}} */
@ -192,7 +169,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$latestContent = $document->getLatestContent();
$this->printTimelineJs('out.ViewDocument.php?action=timelinedata&documentid='.$latestContent->getDocument()->getID(), 300, '', date('Y-m-d'));
}
$this->printDocumentChooserJs("form1");
// $this->printDocumentChooserJs("form1");
$this->printDeleteDocumentButtonJs();
/* Add js for catching click on document in one page mode */
$this->printClickDocumentJs();