From 19133dd19935d00d25ec1e6343b33b3dc42c045a Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 2 Aug 2016 10:37:25 +0200 Subject: [PATCH] add new methods printAttribute() and printAttributeValue() --- views/bootstrap/class.Bootstrap.php | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index e72661267..8448cd0ff 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -554,6 +554,9 @@ $(document).ready(function () { $menuitems['edit_folder_access'] = array('link'=>"../out/out.FolderAccess.php?folderid=".$folderID."&showtree=".showtree(), 'label'=>'edit_folder_access'); } $menuitems['edit_existing_notify'] = array('link'=>"../out/out.FolderNotify.php?folderid=". $folderID ."&showtree=". showtree(), 'label'=>'edit_existing_notify'); + if ($accessMode == M_ALL) { + $menuitems['edit_folder_attrdefgrp'] = array('link'=>"../out/out.FolderAttributeGroup.php?folderid=".$folderID."&showtree=".showtree(), 'label'=>'edit_folder_attrdefgrp'); + } } if ($this->params['user']->isAdmin() && $this->params['enablefullsearch']) { $menuitems['index_folder'] = array('link'=>"../out/out.Indexer.php?folderid=". $folderID."&showtree=".showtree(), 'label'=>'index_folder'); @@ -1298,6 +1301,50 @@ $('#acceptkeywords').click(function(ev) { getAttributeDefinition(); + switch($attrdef->getType()) { + case SeedDMS_Core_AttributeDefinition::type_url: + $attrs = $attribute->getValueAsArray(); + $tmp = array(); + foreach($attrs as $attr) { + $tmp[] = ''.htmlspecialchars($attr).''; + } + echo implode('
', $tmp); + break; + case SeedDMS_Core_AttributeDefinition::type_email: + $attrs = $attribute->getValueAsArray(); + $tmp = array(); + foreach($attrs as $attr) { + $tmp[] = ''.htmlspecialchars($attr).''; + } + echo implode('
', $tmp); + break; + default: + echo htmlspecialchars(implode(', ', $attribute->getValueAsArray())); + } + } /* }}} */ + + /** + * Output a single attribute in the document info section + * + * @param object $attribute attribute + */ + protected function printAttribute($attribute) { /* {{{ */ + $attrdef = $attribute->getAttributeDefinition(); +?> + + getName()); ?>: + printAttributeValue($attribute); ?> + +getType()) { case SeedDMS_Core_AttributeDefinition::type_boolean: