Limit size of file names.
This commit is contained in:
parent
cc6c2890e9
commit
835363eadf
@ -591,7 +591,7 @@ $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolowe
|
|||||||
$formfile=new FormFile($db);
|
$formfile=new FormFile($db);
|
||||||
$param='&section='.$section;
|
$param='&section='.$section;
|
||||||
$textifempty=($section?$langs->trans("NoFileFound"):$langs->trans("ECMSelectASection"));
|
$textifempty=($section?$langs->trans("NoFileFound"):$langs->trans("ECMSelectASection"));
|
||||||
$formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty);
|
$formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,40);
|
||||||
|
|
||||||
// print '<table width="100%" class="border">';
|
// print '<table width="100%" class="border">';
|
||||||
|
|
||||||
|
|||||||
@ -421,7 +421,7 @@ class FormFile
|
|||||||
* \param textifempty Text to show if filearray is empty
|
* \param textifempty Text to show if filearray is empty
|
||||||
* \return int <0 if KO, nb of files shown if OK
|
* \return int <0 if KO, nb of files shown if OK
|
||||||
*/
|
*/
|
||||||
function list_of_documents($filearray,$object,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='')
|
function list_of_documents($filearray,$object,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0)
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs;
|
||||||
global $bc;
|
global $bc;
|
||||||
@ -461,7 +461,7 @@ class FormFile
|
|||||||
if ($forcedownload) print '&type=application/binary';
|
if ($forcedownload) print '&type=application/binary';
|
||||||
print '&file='.urlencode($relativepath.$file['name']).'">';
|
print '&file='.urlencode($relativepath.$file['name']).'">';
|
||||||
print img_mime($file['name']).' ';
|
print img_mime($file['name']).' ';
|
||||||
print $file['name'];
|
print dol_trunc($file['name'],$maxlength,'middle');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td align="right">'.dol_print_size($file['size']).'</td>';
|
print '<td align="right">'.dol_print_size($file['size']).'</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user