mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-01 14:37:20 +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) {
|
foreach($attrdefs as $attrdef) {
|
||||||
$arr = $this->callHook('addDocumentAttribute', null, $attrdef);
|
$arr = $this->callHook('addDocumentAttribute', null, $attrdef);
|
||||||
if(is_array($arr)) {
|
if(is_array($arr)) {
|
||||||
echo "<tr>";
|
if($arr) {
|
||||||
echo "<td>".$arr[0].":</td>";
|
echo "<tr>";
|
||||||
echo "<td>".$arr[1]."</td>";
|
echo "<td>".$arr[0].":</td>";
|
||||||
echo "</tr>";
|
echo "<td>".$arr[1]."</td>";
|
||||||
|
echo "</tr>";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -126,12 +126,22 @@ $(document).ready( function() {
|
||||||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_folder, SeedDMS_Core_AttributeDefinition::objtype_all));
|
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_folder, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||||
if($attrdefs) {
|
if($attrdefs) {
|
||||||
foreach($attrdefs as $attrdef) {
|
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">
|
<div class="control-group">
|
||||||
<label class="control-label"><?php echo htmlspecialchars($attrdef->getName()); ?>:</label>
|
<label class="control-label"><?php echo htmlspecialchars($attrdef->getName()); ?>:</label>
|
||||||
<div class="controls"><?php $this->printAttributeEditField($attrdef, '') ?></div>
|
<div class="controls"><?php $this->printAttributeEditField($attrdef, '') ?></div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -55,6 +55,15 @@ class SeedDMS_View_EditAttributes extends SeedDMS_Bootstrap_Style {
|
||||||
<?php
|
<?php
|
||||||
if($attrdefs) {
|
if($attrdefs) {
|
||||||
foreach($attrdefs as $attrdef) {
|
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">
|
<div class="control-group">
|
||||||
<label class="control-label"><?php echo htmlspecialchars($attrdef->getName()); ?></label>
|
<label class="control-label"><?php echo htmlspecialchars($attrdef->getName()); ?></label>
|
||||||
|
@ -63,6 +72,7 @@ class SeedDMS_View_EditAttributes extends SeedDMS_Bootstrap_Style {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -192,10 +192,12 @@ $(document).ready( function() {
|
||||||
foreach($attrdefs as $attrdef) {
|
foreach($attrdefs as $attrdef) {
|
||||||
$arr = $this->callHook('editDocumentAttribute', $document, $attrdef);
|
$arr = $this->callHook('editDocumentAttribute', $document, $attrdef);
|
||||||
if(is_array($arr)) {
|
if(is_array($arr)) {
|
||||||
echo "<tr>";
|
if($arr) {
|
||||||
echo "<td>".$arr[0].":</td>";
|
echo "<tr>";
|
||||||
echo "<td>".$arr[1]."</td>";
|
echo "<td>".$arr[0].":</td>";
|
||||||
echo "</tr>";
|
echo "<td>".$arr[1]."</td>";
|
||||||
|
echo "</tr>";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -132,13 +132,14 @@ $(document).ready(function() {
|
||||||
|
|
||||||
if($attrdefs) {
|
if($attrdefs) {
|
||||||
foreach($attrdefs as $attrdef) {
|
foreach($attrdefs as $attrdef) {
|
||||||
$arr = $this->callHook('folderEditAttribute', $folder, $attrdef);
|
$arr = $this->callHook('editFolderAttribute', $folder, $attrdef);
|
||||||
if(is_array($arr)) {
|
if(is_array($arr)) {
|
||||||
echo $txt;
|
if($arr) {
|
||||||
echo "<div class=\"control-group\">";
|
echo "<div class=\"control-group\">";
|
||||||
echo "<label class=\"control-label\">".$arr[0]."</label>";
|
echo "<label class=\"control-label\">".$arr[0]."</label>";
|
||||||
echo "<div class=\"controls\">".$arr[1]."</div>";
|
echo "<div class=\"controls\">".$arr[1]."</div>";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<div class="control-group">
|
<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));
|
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||||
if($attrdefs) {
|
if($attrdefs) {
|
||||||
foreach($attrdefs as $attrdef) {
|
foreach($attrdefs as $attrdef) {
|
||||||
$arr = $this->callHook('editDocumentContentAttribute', null, $attrdef);
|
$arr = $this->callHook('editDocumentContentAttribute', $document, $attrdef);
|
||||||
if(is_array($arr)) {
|
if(is_array($arr)) {
|
||||||
echo $txt;
|
if($arr) {
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<td>".$arr[0].":</td>";
|
echo "<td>".$arr[0].":</td>";
|
||||||
echo "<td>".$arr[1]."</td>";
|
echo "<td>".$arr[1]."</td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user