';
echo $HTML->listTableTop($tabletop);
$time_new = 604800;
$rowid = 0;
foreach ($nested_docs[$dirid] as $d) {
echo '
boxGetAltRowStyle($rowid).'>';
switch ($d->getFileType()) {
case "URL":
$docurl=$d->getFileName();
break;
default:
$docurl=util_make_url ('/docman/view.php/'.$group_id.'/'.$d->getID().'/'.urlencode($d->getFileName()));
}
echo '';
switch ($d->getFileType()) {
case "image/png":
case "image/jpeg":
case "image/gif":
case "image/tiff":
echo html_image('docman/file_type_image.png',22,22,array('alt'=>$d->getFileType()));
break;
case "application/pdf":
echo html_image('docman/file_type_pdf.png',22,22,array('alt'=>$d->getFileType()));
break;
case "text/html":
case "URL":
echo html_image('docman/file_type_html.png',22,22,array('alt'=>$d->getFileType()));
break;
case "text/plain":
echo html_image('docman/file_type_plain.png',22,22,array('alt'=>$d->getFileType()));
break;
case "application/msword":
case "application/vnd.oasis.opendocument.text":
echo html_image('docman/file_type_writer.png',22,22,array('alt'=>$d->getFileType()));
break;
case "application/vnd.ms-excel":
case "application/vnd.oasis.opendocument.spreadsheet":
echo html_image('docman/file_type_spreadsheet.png',22,22,array('alt'=>$d->getFileType()));
break;
case "application/vnd.oasis.opendocument.presentation":
case "application/vnd.ms-powerpoint":
echo html_image('docman/file_type_presentation.png',22,22,array('alt'=>$d->getFileType()));
break;
case "application/zip":
case "application/x-tar":
case "application/x-rpm":
echo html_image('docman/file_type_archive.png',22,22,array('alt'=>$d->getFileType()));
break;
default:
echo html_image('docman/file_type_unknown.png',22,22,array('alt'=>$d->getFileType()));
}
echo ' | ';
echo '';
if (($d->getUpdated() && $time_new > (time() - $d->getUpdated())) || $time_new > (time() - $d->getCreated())) {
echo html_image('docman/new.png',14,14,array('alt'=>'new'));
}
echo ' '.$d->getFileName();
echo ' | ';
echo ''.$d->getName().' | ';
echo ''.$d->getDescription().' | ';
echo ''.make_user_link($d->getCreatorUserName(),$d->getCreatorRealName()).' | ';
echo '';
if ( $d->getUpdated() ) {
echo date(_('Y-m-d H:i'),$d->getUpdated());
} else {
echo date(_('Y-m-d H:i'),$d->getCreated());
}
echo ' | ';
echo '';
if ($d->getReserved()) {
echo html_image('docman/document-reserved.png',22,22,array('alt'=>_('Reserved Document'),'title'=>_('Reserved Document')));
} else {
echo $d->getStateName().' | ';
}
echo '';
switch ($d->getFileType()) {
case "URL":
echo "--";
break;
default:
$metric = 'B';
$size = $d->getFileSize();
if ($size > 1024 ) {
$metric = 'KB';
$size = floor ($size/1024);
if ($size > 1024 ) {
$metric = 'MB';
$size = floor ($size/1024);
}
}
echo $size . $metric;
echo ' | ';
}
if (forge_check_perm ('docman', $group_id, 'approve')) {
echo '';
/* should we steal the lock on file ? */
if ($d->getLocked()) {
if ($d->getLockedBy() == $LUSER->getID()) {
$d->setLock(0);
} elseif ((time() - $d->getLockdate()) > 600) {
$d->setLock(0);
}
}
if (!$d->getLocked() && !$d->getReserved()) {
echo ''.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Trash this file'))). '';
echo ''.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this file'))). '';
echo ''.html_image('docman/reserve-document.png',22,22,array('alt'=>_('Reserve this document'))). '';
} else {
if ($d->getReservedBy() != $LUSER->getID()) {
if (forge_check_perm ('docman', $group_id, 'admin')) {
echo ''.html_image('docman/enforce-document.png',22,22,array('alt'=>_('Enforce reservation')));
}
} else {
echo ''.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Trash this file'))). '';
echo ''.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this file'))). '';
echo ''.html_image('docman/release-document.png',22,22,array('alt'=>_('Release reservation'))). '';
}
}
echo ' | ';
}
echo '