- echo ' <TR>' . "\n" .
- ' <TD VALIGN=MIDDLE ALIGN=RIGHT>' . "\n" .
- _("Attach:") .
- ' </TD>' . "\n" .
- ' <TD VALIGN=MIDDLE ALIGN=LEFT>' . "\n" .
- ' <INPUT NAME="attachfile" SIZE=48 TYPE="file">' . "\n" .
- ' <input type="submit" name="attach"' .
- ' value="' . _("Add") .'">' . "\n" .
- ' </TD>' . "\n" .
- ' </TR>' . "\n";
-
- if (count($attachments)) {
- $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
- echo '<tr><td bgcolor="' . $color[0] . '" align=right>' . "\n" .
- ' ' .
- '</td><td align=left bgcolor="' . $color[0] . '">';
- foreach ($attachments as $key => $info) {
- $attached_file = "$hashed_attachment_dir/$info[localfilename]";
- echo '<input type="checkbox" name="delete[]" value="' . $key . "\">\n" .
- $info['remotefilename'] . ' - ' . $info['type'] . ' (' .
- show_readable_size(filesize($attached_file)) . ")<br>\n";
- }
-
- echo '<input type="submit" name="do_delete" value="' .
- _("Delete selected attachments") . "\">\n" .
- '</td></tr>';
- }
- /* End of attachment code */
-
- echo '</TABLE>' . "\n";
+ if ($file_uploads) {
+ echo html_tag( 'tr',
+ html_tag( 'td', "\n" . _("Attach:") ."\n", 'right', '', 'valign="middle"' ) ."\n" .
+ html_tag( 'td', "\n" . '<INPUT NAME="attachfile" SIZE=48 TYPE="file">' .
+ ' <input type="submit" name="attach"' .
+ ' value="' . _("Add") .'">' . "\n" ,
+ 'left', '', 'valign="middle"' ) ."\n"
+ );
+
+ if (count($attachments)) {
+ $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
+ echo html_tag( 'tr' ) .
+ html_tag( 'td', "\n" . ' ', 'right', $color[0] ) .
+ html_tag( 'td', '', 'left', $color[0] );
+ foreach ($attachments as $key => $info) {
+ if ($info['session'] == $session) {
+ $attached_file = "$hashed_attachment_dir/$info[localfilename]";
+ echo '<input type="checkbox" name="delete[]" value="' . $key . "\">\n" .
+ $info['remotefilename'] . ' - ' . $info['type'] . ' (' .
+ show_readable_size( filesize( $attached_file ) ) . ")<br>\n";
+ }
+ }
+
+ echo '<input type="submit" name="do_delete" value="' .
+ _("Delete selected attachments") . "\">\n" .
+ '</td></tr>';
+ }
+ /* End of attachment code */
+ }
+ if ($compose_new_win == '1') {
+ echo '</table>'."\n";
+ }
+ echo '</table>' . "\n";