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