add new methods printAttribute() and printAttributeValue()

This commit is contained in:
Uwe Steinmann 2016-08-02 10:37:25 +02:00
parent e2a1a9f1ba
commit 19133dd199

View File

@ -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) {
<?php
} /* }}} */
/**
* Output a single attribute in the document info section
*
* @param object $attribute attribute
*/
protected function printAttributeValue($attribute) { /* {{{ */
$attrdef = $attribute->getAttributeDefinition();
switch($attrdef->getType()) {
case SeedDMS_Core_AttributeDefinition::type_url:
$attrs = $attribute->getValueAsArray();
$tmp = array();
foreach($attrs as $attr) {
$tmp[] = '<a href="'.htmlspecialchars($attr).'">'.htmlspecialchars($attr).'</a>';
}
echo implode('<br />', $tmp);
break;
case SeedDMS_Core_AttributeDefinition::type_email:
$attrs = $attribute->getValueAsArray();
$tmp = array();
foreach($attrs as $attr) {
$tmp[] = '<a mailto="'.htmlspecialchars($attr).'">'.htmlspecialchars($attr).'</a>';
}
echo implode('<br />', $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();
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td><?php $this->printAttributeValue($attribute); ?></td>
</tr>
<?php
} /* }}} */
function printAttributeEditField($attrdef, $attribute, $fieldname='attributes', $norequire=false) { /* {{{ */
switch($attrdef->getType()) {
case SeedDMS_Core_AttributeDefinition::type_boolean: