Simplification du code

This commit is contained in:
Laurent Destailleur 2005-08-24 22:05:06 +00:00
parent 86e1bfb57a
commit 3d9ff70b7c

View File

@ -1377,7 +1377,6 @@ class Form
print '<form action="'.$urlsource.'" method="post">'; print '<form action="'.$urlsource.'" method="post">';
print '<input type="hidden" name="action" value="setpdfmodel">'; print '<input type="hidden" name="action" value="setpdfmodel">';
} }
print_titre($langs->trans("Documents")); print_titre($langs->trans("Documents"));
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -1407,29 +1406,31 @@ class Form
print '</td></tr>'; print '</td></tr>';
} }
$i=0;
if (is_dir($filedir)) if (is_dir($filedir))
{ {
$handle=opendir($filedir); $handle=opendir($filedir);
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (is_readable($filedir."/".$file) && eregi('\.pdf$',$file)) // Si fichier non lisible ou non .pdf, on passe au suivant
{ if (! is_readable($filedir."/".$file) || ! eregi('\.pdf$',$file)) continue;
print "<tr $bc[$var]>";
if (eregi('\-detail\.pdf',$file)) print '<td nowrap>PDF Détaillé</td>';
else print '<td nowrap>PDF</td>';
$relativepathdetail = "${filename}/$file"; print "<tr $bc[$var]>";
if (eregi('\-detail\.pdf',$file)) print '<td nowrap>PDF Détaillé</td>';
else print '<td nowrap>PDF</td>';
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepathdetail).'">'.$file.'</a></td>'; $relativepathdetail = "${filename}/$file";
print '<td align="right">'.filesize($filedir."/".$file). ' bytes</td>';
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($filedir."/".$file)).'</td>'; print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepathdetail).'">'.$file.'</a></td>';
print '</tr>'; print '<td align="right">'.filesize($filedir."/".$file). ' bytes</td>';
} print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($filedir."/".$file)).'</td>';
print '</tr>';
$i++;
} }
} }
print "</table>\n"; print "</table>\n";
if ($genallowed) if ($genallowed)
{ {
print '</form>'; print '</form>';