mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-01-20 16:19:16 +00:00
add new methods printAttribute() and printAttributeValue()
This commit is contained in:
parent
e2a1a9f1ba
commit
19133dd199
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user