From 55ec35b5b81569ac7113f39e2f7b8b2bdabaa7ef Mon Sep 17 00:00:00 2001 From: steinm Date: Wed, 6 Feb 2013 13:58:15 +0000 Subject: [PATCH] - do not show meta data without a value (comment, ..) - show access rights if admin --- views/bootstrap/class.ViewDocument.php | 85 +++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 3 deletions(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index d62604484..209a4ccb8 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -31,6 +31,46 @@ require_once("class.Bootstrap.php"); */ class LetoDMS_View_ViewDocument extends LetoDMS_Bootstrap_Style { + function getAccessModeText($defMode) { /* {{{ */ + switch($defMode) { + case M_NONE: + return getMLText("access_mode_none"); + break; + case M_READ: + return getMLText("access_mode_read"); + break; + case M_READWRITE: + return getMLText("access_mode_readwrite"); + break; + case M_ALL: + return getMLText("access_mode_all"); + break; + } + } /* }}} */ + + function printAccessList($obj) { /* {{{ */ + $accessList = $obj->getAccessList(); + if (count($accessList["users"]) == 0 && count($accessList["groups"]) == 0) + return; + + for ($i = 0; $i < count($accessList["groups"]); $i++) + { + $group = $accessList["groups"][$i]->getGroup(); + $accesstext = $this->getAccessModeText($accessList["groups"][$i]->getMode()); + print $accesstext.": ".htmlspecialchars($group->getName()); + if ($i+1 < count($accessList["groups"]) || count($accessList["users"]) > 0) + print "
"; + } + for ($i = 0; $i < count($accessList["users"]); $i++) + { + $user = $accessList["users"][$i]->getUser(); + $accesstext = $this->getAccessModeText($accessList["users"][$i]->getMode()); + print $accesstext.": ".htmlspecialchars($user->getFullName()); + if ($i+1 < count($accessList["users"])) + print "
"; + } + } /* }}} */ + function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; @@ -96,29 +136,65 @@ class LetoDMS_View_ViewDocument extends LetoDMS_Bootstrap_Style { : - getOwner(); print "getEmail()."\">".htmlspecialchars($owner->getFullName()).""; - ?> +?> +getComment()) { +?> : getComment());?> +isAdmin()) { + if($document->inheritsAccess()) { + echo ""; + echo "".getMLText("access_mode").":\n"; + echo ""; + echo getMLText("inherited"); + echo ""; + } else { + echo ""; + echo "".getMLText('default_access').""; + echo "".$this->getAccessModeText($document->getDefaultAccess()).""; + echo ""; + echo ""; + echo "".getMLText('access_mode').""; + echo ""; + $this->printAccessList($document); + echo ""; + echo ""; + } + } +?> + + : + getUsedDiskSpace());?> + : getDate()); ?> +getKeywords()) { +?> : getKeywords());?> +getCategories()) { +?> : getCategories(); $ct = array(); foreach($cats as $cat) $ct[] = htmlspecialchars($cat->getName()); @@ -126,6 +202,9 @@ class LetoDMS_View_ViewDocument extends LetoDMS_Bootstrap_Style { ?> + getAttributes(); if($attributes) {