mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-31 05:57:34 +00:00
add hook for editing attribute, return value of hook can be an empty array
This commit is contained in:
parent
4b89d920cb
commit
dc58e02d25
|
@ -275,10 +275,12 @@ $(document).ready(function() {
|
|||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('addDocumentAttribute', null, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
if($arr) {
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
|
|
|
@ -126,12 +126,22 @@ $(document).ready( function() {
|
|||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_folder, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('addFolderAttribute', null, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
if($arr) {
|
||||
echo "<div class=\"control-group\">";
|
||||
echo " <label class=\"control-label\">".$arr[0].":</label>";
|
||||
echo " <div class=\"controls\">".$arr[1]."</div>";
|
||||
echo "</div>";
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><?php echo htmlspecialchars($attrdef->getName()); ?>:</label>
|
||||
<div class="controls"><?php $this->printAttributeEditField($attrdef, '') ?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -55,6 +55,15 @@ class SeedDMS_View_EditAttributes extends SeedDMS_Bootstrap_Style {
|
|||
<?php
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('editDocumentContentAttribute', $version, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
if($arr) {
|
||||
echo "<div class=\"control-group\">";
|
||||
echo "<label class=\"control-label\">".$arr[0].":</label>";
|
||||
echo "<div class=\"controls\">".$arr[1]."</div>";
|
||||
echo "</div>";
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><?php echo htmlspecialchars($attrdef->getName()); ?></label>
|
||||
|
@ -63,6 +72,7 @@ class SeedDMS_View_EditAttributes extends SeedDMS_Bootstrap_Style {
|
|||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -192,10 +192,12 @@ $(document).ready( function() {
|
|||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('editDocumentAttribute', $document, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
if($arr) {
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
|
|
|
@ -132,13 +132,14 @@ $(document).ready(function() {
|
|||
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('folderEditAttribute', $folder, $attrdef);
|
||||
$arr = $this->callHook('editFolderAttribute', $folder, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
echo $txt;
|
||||
echo "<div class=\"control-group\">";
|
||||
echo "<label class=\"control-label\">".$arr[0]."</label>";
|
||||
echo "<div class=\"controls\">".$arr[1]."</div>";
|
||||
echo "</div>";
|
||||
if($arr) {
|
||||
echo "<div class=\"control-group\">";
|
||||
echo "<label class=\"control-label\">".$arr[0]."</label>";
|
||||
echo "<div class=\"controls\">".$arr[1]."</div>";
|
||||
echo "</div>";
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<div class="control-group">
|
||||
|
|
|
@ -277,13 +277,14 @@ console.log(element);
|
|||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('editDocumentContentAttribute', null, $attrdef);
|
||||
$arr = $this->callHook('editDocumentContentAttribute', $document, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
echo $txt;
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
if($arr) {
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
|
|
Loading…
Reference in New Issue
Block a user