mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 12:11:19 +00:00
add hooks, put output of attribute into separate function
This commit is contained in:
parent
c36442303f
commit
ab07fbfef7
|
@ -31,7 +31,7 @@ require_once("class.Bootstrap.php");
|
|||
*/
|
||||
class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||
|
||||
function getAccessModeText($defMode) { /* {{{ */
|
||||
protected function getAccessModeText($defMode) { /* {{{ */
|
||||
switch($defMode) {
|
||||
case M_NONE:
|
||||
return getMLText("access_mode_none");
|
||||
|
@ -48,7 +48,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
}
|
||||
} /* }}} */
|
||||
|
||||
function printAccessList($obj) { /* {{{ */
|
||||
protected function printAccessList($obj) { /* {{{ */
|
||||
$accessList = $obj->getAccessList();
|
||||
if (count($accessList["users"]) == 0 && count($accessList["groups"]) == 0)
|
||||
return;
|
||||
|
@ -71,6 +71,22 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
}
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* 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 echo htmlspecialchars(implode(', ', $attribute->getValueAsArray())); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
} /* }}} */
|
||||
|
||||
function show() { /* {{{ */
|
||||
parent::show();
|
||||
$dms = $this->params['dms'];
|
||||
|
@ -95,11 +111,16 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
|
||||
if ($document->isLocked()) {
|
||||
$lockingUser = $document->getLockingUser();
|
||||
$txt = $this->callHook('documentIsLocked', $document, $lockingUser);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
?>
|
||||
<div class="alert alert-warning">
|
||||
<?php printMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName())));?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
/* Retrieve attacheѕ files */
|
||||
|
@ -140,6 +161,10 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
<?php
|
||||
$this->contentHeading(getMLText("document_infos"));
|
||||
$this->contentContainerStart();
|
||||
$txt = $this->callHook('documentInfos', $document);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
?>
|
||||
<table class="table-condensed">
|
||||
<?php
|
||||
|
@ -238,18 +263,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
$attributes = $document->getAttributes();
|
||||
if($attributes) {
|
||||
foreach($attributes as $attribute) {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||
<td><?php echo htmlspecialchars(implode(', ', $attribute->getValueAsArray())); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$this->printAttribute($attribute);
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
$this->contentContainerEnd();
|
||||
?>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user