nicer output of attribute values

This commit is contained in:
Uwe Steinmann 2015-04-15 16:14:47 +02:00
parent 6af9a3a210
commit 46c2019ef2

View File

@ -81,7 +81,30 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td><?php echo htmlspecialchars(implode(', ', $attribute->getValueAsArray())); ?></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>
</tr>
<?php