mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 13:42:04 +00:00
nicer output of attribute values
This commit is contained in:
parent
6af9a3a210
commit
46c2019ef2
|
@ -81,7 +81,30 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
<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>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user