mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-10-09 18:42:56 +00:00
add hooks showDocumentAttribute and showDocumentContentAttribute
This commit is contained in:
parent
15d89c09d6
commit
b9ad2195d3
|
@ -514,18 +514,40 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
|
||||||
$attrstr .= "<table class=\"table table-condensed\">\n";
|
$attrstr .= "<table class=\"table table-condensed\">\n";
|
||||||
$attrstr .= "<tr><th>".getMLText('name')."</th><th>".getMLText('attribute_value')."</th></tr>";
|
$attrstr .= "<tr><th>".getMLText('name')."</th><th>".getMLText('attribute_value')."</th></tr>";
|
||||||
foreach($lcattributes as $lcattribute) {
|
foreach($lcattributes as $lcattribute) {
|
||||||
$attrdef = $lcattribute->getAttributeDefinition();
|
$arr = $this->callHook('showDocumentContentAttribute', $lc, $lcattribute);
|
||||||
$attrstr .= "<tr><td>".htmlspecialchars($attrdef->getName())."</td><td>".htmlspecialchars(implode(', ', $lcattribute->getValueAsArray()))."</td></tr>\n";
|
if(is_array($arr)) {
|
||||||
|
$attrstr .= "<tr>";
|
||||||
|
$attrstr .= "<td>".$arr[0].":</td>";
|
||||||
|
$attrstr .= "<td>".$arr[1]."</td>";
|
||||||
|
$attrstr .= "</tr>";
|
||||||
|
} elseif(is_string($arr)) {
|
||||||
|
$attrstr .= $arr;
|
||||||
|
} else {
|
||||||
|
$attrdef = $lcattribute->getAttributeDefinition();
|
||||||
|
$attrstr .= "<tr><td>".htmlspecialchars($attrdef->getName())."</td><td>".htmlspecialchars(implode(', ', $lcattribute->getValueAsArray()))."</td></tr>\n";
|
||||||
|
// TODO: better use printAttribute()
|
||||||
|
// $this->printAttribute($lcattribute);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$attrstr .= "</table>\n";
|
$attrstr .= "</table>\n";
|
||||||
}
|
}
|
||||||
$docttributes = $document->getAttributes();
|
$docattributes = $document->getAttributes();
|
||||||
if($docttributes) {
|
if($docattributes) {
|
||||||
$attrstr .= "<table class=\"table table-condensed\">\n";
|
$attrstr .= "<table class=\"table table-condensed\">\n";
|
||||||
$attrstr .= "<tr><th>".getMLText('name')."</th><th>".getMLText('attribute_value')."</th></tr>";
|
$attrstr .= "<tr><th>".getMLText('name')."</th><th>".getMLText('attribute_value')."</th></tr>";
|
||||||
foreach($docttributes as $docttribute) {
|
foreach($docattributes as $docattribute) {
|
||||||
$attrdef = $docttribute->getAttributeDefinition();
|
$arr = $this->callHook('showDocumentAttribute', $document, $docattribute);
|
||||||
$attrstr .= "<tr><td>".htmlspecialchars($attrdef->getName())."</td><td>".htmlspecialchars(implode(', ', $docttribute->getValueAsArray()))."</td></tr>\n";
|
if(is_array($arr)) {
|
||||||
|
$attrstr .= "<tr>";
|
||||||
|
$attrstr .= "<td>".$arr[0].":</td>";
|
||||||
|
$attrstr .= "<td>".$arr[1]."</td>";
|
||||||
|
$attrstr .= "</tr>";
|
||||||
|
} elseif(is_string($arr)) {
|
||||||
|
$attrstr .= $arr;
|
||||||
|
} else {
|
||||||
|
$attrdef = $docattribute->getAttributeDefinition();
|
||||||
|
$attrstr .= "<tr><td>".htmlspecialchars($attrdef->getName())."</td><td>".htmlspecialchars(implode(', ', $docattribute->getValueAsArray()))."</td></tr>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$attrstr .= "</table>\n";
|
$attrstr .= "</table>\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user