isAdmin())
die ("access denied");
printHTMLHead( getMLText("admin_tools") );
?>
_rootFolderID));
printCenterStart();
printStartBox(getMLText("folders_and_documents_statistic"));
print "
";
printFolder(getFolder($settings->_rootFolderID));
print "
";
printEndBox();
printCenterEnd();
printHTMLFoot();
function getAccessColor($mode)
{
if ($mode == M_NONE)
return "red";
else if ($mode == M_READ)
return "orange";
else if ($mode == M_READWRITE)
return "green";
else // if ($mode == M_ALL)
return "blue";
}
function printFolder($folder)
{
$color = $folder->inheritsAccess() ? "black" : getAccessColor($folder->getDefaultAccess());
print "";
print "getID()."\">".$folder->getName() ."";
if (! $folder->inheritsAccess())
printAccessList($folder);
print "";
$subFolders = $folder->getSubFolders();
$documents = $folder->getDocuments();
print "";
foreach ($subFolders as $folder)
printFolder($folder);
foreach ($documents as $document)
printDocument($document);
print "
";
}
function printDocument($document)
{
$color = $document->inheritsAccess() ? "black" : getAccessColor($document->getDefaultAccess());
print "";
print "getID()."\">".$document->getName()."";
if (! $document->inheritsAccess())
printAccessList($document);
print "";
}
function printAccessList($obj)
{
$accessList = $obj->getAccessList();
if (count($accessList["users"]) == 0 && count($accessList["groups"]) == 0)
return;
print " (";
for ($i = 0; $i < count($accessList["groups"]); $i++)
{
$group = $accessList["groups"][$i]->getGroup();
$color = getAccessColor($accessList["groups"][$i]->getMode());
print "".$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();
$color = getAccessColor($accessList["users"][$i]->getMode());
print "".$user->getFullName()."";
if ($i+1 < count($accessList["users"]))
print ", ";
}
print ")";
}
?>