From 3d9ff70b7c69b9382e1a34e11ec574352efbd54c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Aug 2005 22:05:06 +0000 Subject: [PATCH] Simplification du code --- htdocs/html.form.class.php | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index cc536a66b99..ac5ce39da57 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1377,7 +1377,6 @@ class Form print '
'; print ''; } - print_titre($langs->trans("Documents")); print ''; @@ -1406,30 +1405,32 @@ class Form print ''; } - + + $i=0; if (is_dir($filedir)) { $handle=opendir($filedir); while (($file = readdir($handle))!==false) { - if (is_readable($filedir."/".$file) && eregi('\.pdf$',$file)) - { - print ""; - if (eregi('\-detail\.pdf',$file)) print ''; - else print ''; - - $relativepathdetail = "${filename}/$file"; - - print ''; - print ''; - print ''; - print ''; - } + // Si fichier non lisible ou non .pdf, on passe au suivant + if (! is_readable($filedir."/".$file) || ! eregi('\.pdf$',$file)) continue; + + print ""; + if (eregi('\-detail\.pdf',$file)) print ''; + else print ''; + + $relativepathdetail = "${filename}/$file"; + + print ''; + print ''; + print ''; + print ''; + + $i++; } } print "
'; print '
PDF DétailléPDF'.$file.''.filesize($filedir."/".$file). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($filedir."/".$file)).'
PDF DétailléPDF'.$file.''.filesize($filedir."/".$file). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($filedir."/".$file)).'
\n"; - if ($genallowed) { print '
';