<%@ page buffer="8kb" autoFlush="true" %>
<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="zm" uri="com.zimbra.zm" %>
<%@ taglib prefix="app" uri="com.zimbra.htmlclient" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="com.zimbra.i18n" %>
        
<app:handleError>
    <zm:getMailbox var="mailbox"/>
    <c:choose>
    <c:when test="${not empty mailbox.prefs.locale}">
        <fmt:setLocale value='${mailbox.prefs.locale}' scope='request' />
    </c:when>
    <c:otherwise>
        <fmt:setLocale value='${pageContext.request.locale}' scope='request' />
    </c:otherwise>
    </c:choose>
    <fmt:setBundle basename="/messages/ZhMsg" scope="request"/>

    <fmt:message var="title" key="attachFiles"/>

    <c:set var="attachSize" value="${zm:displaySize(pageContext, mailbox.accountInfo.documentSizeLimit)}"/>
    
    <zm:composeUploader var="uploader"/>

    <c:set var="message" value="${null}"/>

</app:handleError>

<app:view mailbox="${mailbox}" title="${title}" selected='briefcases' briefcases="true" tags="true" searches="false" context="${null}" keys="false">

    <c:set var="toolbar">
        <table width=100% cellspacing=0>
            <tr valign='middle'>
                <td class='TbBt'>
                    <table cellspacing=0 cellpadding=0 class='Tb'>
                        <tr>
                            <app:button name="actionAttachDone" src="common/ImgCheck.png" tooltip="done" text="done"/>
                            <td><div class='vertSep'></div></td>
                            <app:button name="actionAttachCancel" src="common/ImgCancel.png" tooltip="cancel" text="cancel"/>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </c:set>

    <form action="" method="post" enctype="multipart/form-data" accept-charset="utf-8">
        <table width=100% cellpadding="0" cellspacing="0">
            <tr>
                <td class='TbTop'>
                    ${toolbar}
                </td>
            </tr>
            <tr>
                <td class='ZhAppContent'>
                        <table cellpadding=0 cellspacing=10 height=80% width=100% class='Compose'>
                            <tr>
                                <td align='right'><app:img altkey="ALT_ATTACHMENT" src="startup/ImgAttachment.png"/></td>
                                <td colspan=2><b><fmt:message key="selectFilesToAttach"/></b></td>
                            </tr>
                            <c:forEach begin="1" end="10" var="current">
                                <tr>
                                    <td align='right'>${current}.</td>
                                    <td colspan=2><input type=file size="40" name="fileUpload"></td>
                                </tr>
                            </c:forEach>
                            <tr>
                                <td>&nbsp;</td>
                                <td colspan="2"><b>
                                    <fmt:message key="attachmentLimitMsg">
                                        <fmt:param value="${attachSize}"/>
                                    </fmt:message>
                                    </b>
                                </td>
                            </tr>
                        </table>
                </td>
            </tr>
            <tr>
                <td class='TbBottom'>
                    ${toolbar}
                </td>
            </tr>
        </table>
        <input type="hidden" name="doBriefcaseAction" value="1"/>
        <input type="hidden" name="sendUID" value="${fn:escapeXml(compose.sendUID)}"/>
        <c:if test="${zm:boolean(message.isDraft)}">
            <input type="hidden" name="draftid" value="${message.id}"/>
        </c:if>
    </form>
</app:view>
