function display_upload($apli, $post_id, $Mmod) { $att_size = ''; $att_type = ''; $att_name = ''; $att_url = ''; $att_link = ''; $attachments = ''; $att_icon = ''; $num_cells = 5; $att = getAttachments($apli, $post_id, 0, $Mmod); if (is_array($att)) { $att_count = count($att); // $attachments = "\n<table id=\"ooo\" class=\"fo-post-mes\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" width=\"100%\">\n<tr>"; $attachments = ' <div class="list-group"> <div class="list-group-item"> <img class="smil" src="themes/npds-boost/images/forum/subject/1F4CE.png" border="0" alt="icon_post" /> <span class="text-muted">' . upload_translate("Pièces jointes") . '</span> <span class="label label-default label-pill pull-right">' . $att_count . '</span> </div>'; $ncell = 0; for ($i = 0; $i < $att_count; $i++) { $att_id = $att[$i]["att_id"]; $att_name = $att[$i]["att_name"]; $att_path = $att[$i]["att_path"]; $att_type = $att[$i]["att_type"]; $att_size = (int) $att[$i]["att_size"]; $compteur = $att[$i]["compteur"]; $visible = $att[$i]["visible"]; $att_inline = $att[$i]["inline"]; if (!$visible) { $marqueurV = "@"; } else { $marqueurV = ""; } $att_link = getAttachmentUrl($apli, $post_id, $att_id, "{$att_path}/{$att_id}.{$apli}." . $marqueurV . "{$att_name}", $att_type, $att_size, $att_inline, $compteur, $visible, $Mmod); // check for full row if (++$ncell > $num_cells) { // $attachments .= "</tr>\n<tr>"; $ncell = 1; } if (getAttDisplayMode($att_type, $att_inline) != ATT_DSP_LINK) { if ($ncell > 1) { while ($ncell++ <= $num_cells) { // $attachments .= "<td> </td>"; $attachments .= "</tr>\n<tr>"; } } $ncell = $num_cells + 1; // $td = "<td colspan=\"".$num_cells."\">"; } else { // $td = "<td>"; } // $attachments .= $td.$att_link."</td>"; $attachments .= $att_link; $att_list[$att_id] = $att_name; } // $attachments .= "</tr></table>"; $attachments .= '</div>'; return $attachments; } }
<th> </th> <th data-sortable="true">' . upload_translate("Fichier") . '</th> <th data-sortable="true">' . upload_translate("Type") . '</th> <th data-sortable="true">' . upload_translate("Taille") . '</th> <th data-sortable="true">' . upload_translate("Affichage intégré") . '</th> ' . $vizut . ' </tr> </thead> <tbody>'; $Fichier = new FileManagement(); // essai class PHP7 for ($i = 0; $i < $att_count; $i++) { $id = $att[$i]['att_id']; $tsz += $att[$i]['att_size']; $sz = $Fichier->file_size_format($att[$i]['att_size'], 2); if (getAttDisplayMode($att[$i]['att_type'], 'A') == ATT_DSP_LINK) { // This mime-type can't be displayed inline echo '<input type="hidden" name="inline_att[' . $id . ']" value="0" />'; $inline_box = '--'; } else { $inline_box = getListBox("inline_att[{$id}]", $inline_list, $att[$i]["inline"]); } if ($Mmod) { $visu = "<td align=\"center\">" . getCheckBox("visible_att[]", $id, $att[$i]["visible"] == 1 ? $id : -1, "") . "</td>"; $visible_list .= $id . ','; } $att_table .= ' <tr> <td>' . getCheckBox("del_att[]", $id, 0, "") . '</td> <td>' . $att[$i]['att_name'] . '</td> <td>' . $att[$i]['att_type'] . '</td>