mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-12-17 09:33:13 +00:00
remove printAttribute(), as it is now in the parent class
This commit is contained in:
parent
7b7c8c1a0a
commit
9ec7cb9025
|
|
@ -76,44 +76,6 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_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
|
||||
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
|
||||
} /* }}} */
|
||||
|
||||
function timelinedata() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
|
|
@ -545,15 +507,39 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "</ul>\n";
|
||||
print "<p style=\"font-style: italic;\">".htmlspecialchars($latestContent->getComment())."</p>";
|
||||
print "<ul class=\"actions unstyled\">\n";
|
||||
$attributes = $latestContent->getAttributes();
|
||||
if($attributes) {
|
||||
foreach($attributes as $attribute) {
|
||||
$arr = $this->callHook('showDocumentContentAttribute', $latestContent, $attribute);
|
||||
if(is_array($arr)) {
|
||||
print "<li>".$arr[0].": ".$arr[1]."</li>\n";
|
||||
} else {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars(implode(', ', $attribute->getValueAsArray()))."</li>\n";
|
||||
$f = null;
|
||||
$attrdefgrps = $folder->getAttributeDefintionGroupList(true, $f);
|
||||
if($attrdefgrps) {
|
||||
foreach($attrdefgrps as $attrdefgrp) {
|
||||
$attrdefs = $attrdefgrp['group']->getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_all, SeedDMS_Core_AttributeDefinition::objtype_documentcontent));
|
||||
// echo "<tr><td colspan=\"2\"><b>".htmlspecialchars($attrdefgrp['group']->getName())."</b></td></tr>";
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdefarr) {
|
||||
$attrdef = $attrdefarr['attrdef'];
|
||||
if($attrdefarr['show'] & SeedDMS_Core_AttributeDefinitionGroup::show_details) {
|
||||
$attribute = $document->getAttribute($attrdef);
|
||||
if($attribute) {
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ";
|
||||
$this->printAttributeValue($attribute);
|
||||
echo "</li>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$attributes = $latestContent->getAttributes();
|
||||
if($attributes) {
|
||||
foreach($attributes as $attribute) {
|
||||
$arr = $this->callHook('showDocumentContentAttribute', $latestContent, $attribute);
|
||||
if(is_array($arr)) {
|
||||
print "<li>".$arr[0].": ".$arr[1]."</li>\n";
|
||||
} else {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ";
|
||||
$this->printAttributeValue($attribute);
|
||||
echo "</li>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user