10require_once __DIR__ .
'/../class/controller.class.php';
40 echo
'<h2>' . htmlspecialchars($title) .
'</h2>';
42 if (is_array($itemList) && count($itemList) > 0) {
44 $directories = array();
46 foreach ($itemList as $item) {
47 if ($item[
'type'] ===
'dir') {
48 $directories[] = $item;
55 echo
'<table class="table table-hover" width="100%">';
57 echo
'<th>' . $langs->trans(
'Name') .
'</th>';
58 echo
'<th style="text-align: right; white-space: nowrap;">' . $langs->trans(
'Size') .
'</th>';
59 echo
'<th style="text-align: right; white-space: nowrap;">' . $langs->trans(
'DateM') .
'</th>';
64 foreach ($directories as $dir) {
67 echo
'<td><a href="' . $linkBuilder[
'dir']($dir) .
'">📁 ' . htmlspecialchars($dir[
'name']) .
'</a></td>';
68 echo
'<td style="text-align: right;">--</td>';
69 echo
'<td style="text-align: right;">' .
dol_print_date($dir[
'date'],
'dayhour') .
'</td>';
74 foreach ($files as $file) {
77 echo
'<td><a href="' . $linkBuilder[
'file']($file) .
'" target="_blank">📄 ' . htmlspecialchars($file[
'name']) .
'</a></td>';
78 echo
'<td style="text-align: right;">' .
dol_print_size($file[
'size']) .
'</td>';
79 echo
'<td style="text-align: right;">' .
dol_print_date($file[
'date'],
'dayhour') .
'</td>';
83 echo
'</tbody></table>';
85 echo
'<p>' . htmlspecialchars($emptyMessage) .
'</p>';
displayDocumentTable($title, $itemList, $emptyMessage, array $linkBuilder)
Renders an HTML file browser table for a given list of files and directories.
dol_print_size($size, $shortvalue=0, $shortunit=0)
Return string with formatted size.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).