use filter parameter of getAttributeDefinitions(), call hook

This commit is contained in:
Uwe Steinmann 2016-08-03 12:27:59 +02:00
parent 188b53789e
commit 50fa5a991c

View File

@ -237,15 +237,22 @@ function folderSelected(id, name) {
$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_folder));
echo "<tr><td colspan=\"2\"><b>".htmlspecialchars($attrdefgrp['group']->getName())."</b></td></tr>";
$attrdefs = $attrdefgrp['group']->getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_all, SeedDMS_Core_AttributeDefinition::objtype_folder), SeedDMS_Core_AttributeDefinitionGroup::show_details);
if($attrdefs) {
echo "<tr><td colspan=\"2\"><b>".htmlspecialchars($attrdefgrp['group']->getName())."</b></td></tr>";
foreach($attrdefs as $attrdefarr) {
$attrdef = $attrdefarr['attrdef'];
if($attrdefarr['show'] & SeedDMS_Core_AttributeDefinitionGroup::show_details) {
$attribute = $folder->getAttribute($attrdef);
if($attribute)
$attribute = $folder->getAttribute($attrdef);
if($attribute) {
$arr = $this->callHook('showFolderAttribute', $folder, $attribute);
if(is_array($arr)) {
echo "<tr>";
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1].":</td>";
echo "</tr>";
} else {
$this->printAttribute($attribute);
}
}
}
}
@ -256,7 +263,6 @@ function folderSelected(id, name) {
foreach($attributes as $attribute) {
$arr = $this->callHook('showFolderAttribute', $folder, $attribute);
if(is_array($arr)) {
echo $txt;
echo "<tr>";
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1].":</td>";