From 188b53789e0d814e8ef908d14a1b60770b7e25dd Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 3 Aug 2016 11:27:55 +0200 Subject: [PATCH] call more hooks, filter attrdef list by show value when retrieving it --- views/bootstrap/class.ViewDocument.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index d6143c545..2132e7735 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -511,14 +511,17 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { $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 "".htmlspecialchars($attrdefgrp['group']->getName()).""; + $attrdefs = $attrdefgrp['group']->getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_all, SeedDMS_Core_AttributeDefinition::objtype_documentcontent), 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 = $document->getAttribute($attrdef); - if($attribute) { + $attribute = $latestContent->getAttribute($attrdef); + if($attribute) { + $arr = $this->callHook('showDocumentContentAttribute', $latestContent, $attribute); + if(is_array($arr)) { + echo "
  • ".$arr[0].": ".$arr[1]."
  • \n"; + } else { print "
  • ".htmlspecialchars($attrdef->getName()).": "; $this->printAttributeValue($attribute); echo "
  • \n";