From 99cdcf18ff5e39b84a1580a8931ee82e762438ec Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 3 Aug 2016 12:27:59 +0200 Subject: [PATCH] use filter parameter of getAttributeDefinitions(), call hook --- views/bootstrap/class.ViewFolder.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/views/bootstrap/class.ViewFolder.php b/views/bootstrap/class.ViewFolder.php index 5869a6a1f..18e6375c5 100644 --- a/views/bootstrap/class.ViewFolder.php +++ b/views/bootstrap/class.ViewFolder.php @@ -341,15 +341,22 @@ $('body').on('click', '.order-btn', function(ev) { $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 "".htmlspecialchars($attrdefgrp['group']->getName()).""; + $attrdefs = $attrdefgrp['group']->getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_all, SeedDMS_Core_AttributeDefinition::objtype_folder), SeedDMS_Core_AttributeDefinitionGroup::show_details); if($attrdefs) { + echo "".htmlspecialchars($attrdefgrp['group']->getName()).""; 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 ""; + echo "".$arr[0].":"; + echo "".$arr[1].":"; + echo ""; + } else { $this->printAttribute($attribute); + } } } }