<!DOCTYPE html >
<html lang="en">
<head>
  <title><%cat_full_name%>: Send message</title>
<%include include_common_head.html%>
</head>

<%~if bad_username%>
  <%~if user_username%>
    <%~set error = "No such user: $user_username"%>
  <%~else%>
    <%~set error = "No recipient entered!"%>
  <%~endif%>
<%~elsif user_no_privmsg%>
  <%~set error = "$user_username has chosen not to accept private messages"%>
<%~endif%>
<%~set content_header_title = 'Send Private Message'%>
<%~set url = GForum::SEO::url(params => "do=message_list")%>
<%~set content_header_breadcrumb = "<a href=\"$url\">Messages</a>"%>
<%~if this_do eq message_reply_write%>
<%~set content_header_subtitle = "Send a Reply to $user_username"%>
<%~endif%>

<body class="page-<%page_id%>">
  <iframe id="spellcheck_frame" src="<%GForum::SEO::url(params => "do=spellcheck_inline_msg;just_load=1")%>" class="hide"></iframe>
  <div class="container-b">
    <%include include_header.html%>

    <div class="main">
      <div class="contentwrapper clearfix">
        <div class="sidebar">
            <%include include_sidebar.html%>
        </div>

        <%~set content_header_title = 'New Message'%>
        <%~init array breadcrumbs%><%init hash breadcrumbs.0%><%init hash breadcrumbs.1%>
        <%~set breadcrumbs.0.name = 'Private Messages'%>
        <%~set breadcrumbs.0.url  = GForum::SEO::url(params => "do=message_list")%>
        <%~set breadcrumbs.1.name = 'New Message'%>

        <%~set url_param_mh = ""%>
        <%~if in.mh%><%set url_param_mh = ";mh=$mh"%><%endif%>

        <%include include_breadcrumb.html%>

        <div class="content"><%-- start content--%>
          <%include include_content_header.html%>

          <%~if this_do eq message_reply_write and not user_accept_privmsg%>
          <p class="warning">
          <%user_username%> has chosen not to accept private messages.
          </p>
          <%~else%>
          <%preview || ''%>

          <form id="<%set compose_form_id = 'message_write_form'%><%compose_form_id%>" name="message" action="<%GForum::SEO::url()%>" method="post" enctype="multipart/form-data">
            <%hidden_form%>
            <%~if this_do eq message_reply_write%>
            <input type="hidden" name="user" value="<%user_id%>" />
            <input type="hidden" name="reply_to" value="<%parent_msg_id%>" />
            <%~endif%>

            <%include include_message_write.html%>

            <div class="btn-wrapper post-actions">
              <%~if this_do eq message_reply_write%>
              <input type="submit" id="button_post" name="do=message_send" value="Send Reply" class="btn default" tabindex="15" />
              <%~else%>
              <input type="submit" id="button_post" name="do=message_send" value="Send Message" class="btn default" tabindex="15" />
              <%~endif%>
            </div>
          </form>

          <div class="clearall"></div>
          <%~if this_do eq message_reply_write%>
          <%~parent%>
          <%~set preview = 0%><%set reply_view = 1%>
          <%include include_message_display.html%>
          <%~endif%>
          <%~endif%>

        </div><%-- end content --%>
      </div>
    </div>
  </div>

  <%include include_footer.html%>

</div>

</body>
<%~include include_global_js.html%>
</html>
