<script type="text/javascript">
$(document).ready(function(){
  $('img.showhelp').click(function(){
    $('#help2').dialog();
  });
});
</script>

<h3>{$mod->Lang('title_mod_compose_message')}</h3>

{$startform}

<div class="pageoverflow">
  <p class="pageinput">{$submit}{$cancel}</p>
</div>

{cge_start_tabs}
{cge_tabheader name='basics' label=$mod->Lang('basics')}
{cge_tabheader name='content' label=$mod->Lang('content')}
{cge_tabheader name='text' label=$mod->Lang('text')}
{cge_tabheader name='test' label=$mod->Lang('test/job')}

{cge_tabcontent_start name='basics'}
  <div class="c_full cf">
    <label class="grid_2">{$prompt_subject}:</label>
    <p class="grid_9">{$subject}</p>
  </div>
  <div class="c_full cf">
    <p class="grid_2">{$prompt_text_only}:</p>
    <p class="grid_9">{$text_only}</p>
  </div>
  {if isset($templatelist)}
  <div class="c_full cf">
    <p class="grid_2">{$prompt_template}:</p>
    <p class="grid_9">{$templatelist}</p>
  </div>
  {/if}
  <div class="c_full cf">
    <p class="grid_2">{$prompt_page}:</p>
    <p class="grid_9">{$pagelist}</p>
  </div>
  <div class="c_full cf">
    <p class="grid_2">{$prompt_archivable}:</p>
    <p class="grid_9">{$archivable}</p>
  </div>
  <div class="c_full cf">
    <p class="grid_2">{$mod->Lang('prompt_sendas')}:</p>
    <p class="grid_9">
       <input type="text" name="{$actionid}send_as" value="{$sendas}" size="80" maxlength="255"/>
       <br/>{$mod->Lang('info_sendas')}
    </p>
  </div>
  {if isset($selectstatus)}
    <div class="c_full cf">
      <p class="grid_2">{$prompt_selectstatus}:</p>
      <p class="grid_9">{$selectstatus}</p>
    </div>
  {/if}
{cge_tabcontent_end}

{cge_tabcontent_start name='content'}
   <div class="warning">{$message_help2}</div>
   <div id="help2" title="{$mod->Lang('title_help')}" style="display: none;">{$message_help}</div>
   {if isset($contentblocks)}
   {foreach from=$contentblocks item='block'}
     {if isset($block->hidden)}
        {$block->control}
     {else}
     <div class="pageoverflow">
	<p class="pagetext">{$block->prompt}:&nbsp;{cgimage image="icons/system/info.gif" class="showhelp"}
</p>
	<p class="pageinput">{$block->control}</p>
     </div>
     {/if}
   {/foreach}
   {/if}
{cge_tabcontent_end}

{cge_tabcontent_start name='text'}
   <div class="pageoverflow">
	<p class="pagetext">{$prompt_textmessage}:&nbsp;{cgimage image="icons/system/info.gif" class="showhelp"}</p>
	<p class="pageinput">{$textmessage}</p>
   </div>
{cge_tabcontent_end}

{cge_tabcontent_start name='test'}
<fieldset>
  <legend>{$mod->Lang('prompt_compose_test')}</legend>
  <div class="c_full">
    &nbsp;&nbsp;{$mod->Lang('prompt_compose_test_to')}:
    <input type="text" name="{$actionid}test_email" size="80" placeholder="{$mod->Lang('email_address')}"/>
    <input type="submit" name="{$actionid}sendtest" value="{$mod->Lang('send')}"/>
  </div>
</fieldset>

{if !empty($job_lists)}
  <fieldset>
    <legend>{$mod->Lang('prompt_compose_newjob')}</legend>
    <div class="information">{$mod->Lang('info_compose_newjob')}</div>
    <div class="c_full cf">
      &nbsp;&nbsp;{$mod->Lang('p_list')}:
      <select name="{$actionid}job_list">
        <option value="">{$mod->Lang('none')}</option>
        {html_options options=$job_lists selected=$job_list}
      </select>
      <input type="submit" name="{$actionid}newjob" value="{$mod->Lang('create')}"/>
    </div>
{/if}
{cge_tabcontent_end}
{cge_end_tabs}

{if isset($hidden)}{$hidden}{/if}
{$endform}
