{*********************************************************
* Copyright (c) 2009 PHPLDTemplates.com
* Theme Author: http://www.PHPLDTemplates.com
* Theme URL: http://www.phpldtemplates.com/2009/07/free-phpld-template-dbs-3/
* 
* Report bug: Please email contact @ PHPLDTemplates.com
* License: Free, provided user keeps the footer links intake. Not to be resold.
* More free phpld templates are available at http://www.PHPLDTemplates.com
* 
**********************************************************}
{capture name="title"} - {l}Submit Category{/l}{/capture}
{capture assign="in_page_title"}{l}Submit Category{/l}{/capture}
{capture assign="description"}{l}Submit a new category to the directory{/l}{/capture}

{include file="header.tpl"}
{include file="top_bar.tpl"}

{strip}

{if $smarty.const.DISABLE_SUBMIT == 1 && $is_admin neq 1} 
    <table class="formPage" align="center">
 <tr>      
  <td>         
    <h2>{l}Closed{/l}</h2>      
  </td>   
 </tr>   
 <tr>      
    <td>         
     {l}We are sorry but category submissions are closed.{/l}<br />         {$disablereason}</a>      
     </td>   
 </tr> 
</table> 
<br /> 
{else}
{if empty($regular_user_details.ID) || (($uLevel != 1) && ($uLevel != 3))}
    <table class="formPage" align="center">
       <tr>
          <td>
             <h3>{l}Information{/l}</h3>
          </td>
       </tr>
       <tr>
          <td>
             {l}You must be logged in as Admin or Super Editor to submit a new category.{/l}
             <br />
             {l}No account yet?{/l} <a href="{$smarty.const.DOC_ROOT}/profile.php?mode=register" title="{l}Register new user{/l}">{l}Create one{/l}</a>
          </td>
       </tr>
    </table>
{else}
    <form method="post" action="">
    <table class="formPage" align="center">
    {if $error}
       <tr><td colspan="2" class="err">
          {l}An error occured while saving the category.{/l}
       </td></tr>
    {/if}
    
    {if $posted}
       <tr><td colspan="2" class="msg">
       {l}Category submitted{/l}{if $waiting_approval eq 1}{l} and awaiting approval{/l}{/if}.<br />
       {l}Submit another category.{/l}
       </td></tr>
    {/if}

<tr>
   <td class="label" align='left'>{l}Fields marked with a {/l}<span class='req'>*</span>{l} are required.{/l}</td>
   </tr>
  <tr>
   <td class="label"><span class='req'>*</span>{l}Title{/l}:</td>
   <td class="field">
      <input type="text" name="TITLE" value="{$TITLE|escape|trim}" size="40" maxlength="{$smarty.const.TITLE_MAX_LENGTH}" class="text" />
      {validate form="submit_cat" id="v_TITLE" message=$smarty.capture.field_char_required}
      {validate form="submit_cat" id="v_TITLE_U" message=$smarty.capture.title_not_unique}
      {validate form="submit_cat" id="v_TITLE_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.TITLE_MIN_LENGTH|replace:'#MAX#':$smarty.const.TITLE_MAX_LENGTH}
   </td>
  </tr>
  
  {if $ENABLE_REWRITE and $symbolic ne 1}
  <tr>
     <td class="label"><span class='req'>*</span>{l}URL Title{/l}:</td>
     <td class="field">
        <input type="text" id="TITLE_URL" name="TITLE_URL" size="40" value="{$TITLE_URL|escape|trim}" maxlength="255" class="text" />
        {validate form="submit_cat" id="v_TITLE_URL"  message=$smarty.capture.invalid_url_path}
        {validate form="submit_cat" id="v_TITLE_URL_U" message=$smarty.capture.url_title_not_unique}
     </td>
  </tr>
  {/if}
  {if $symbolic ne 1}
  <tr>
    <td class="label">{l}Description{/l}:</td>
    <td class="field">
     <textarea name="DESCRIPTION" rows="3" cols="37" class="text" {formtool_count_chars name="DESCRIPTION" limit=$smarty.const.DESCRIPTION_MAX_LENGTH alert=true}>{$DESCRIPTION|escape|trim}</textarea>
        {validate form="submit_cat" id="v_DESCRIPTION_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.DESCRIPTION_MIN_LENGTH|replace:'#MAX#':$smarty.const.DESCRIPTION_MAX_LENGTH}
        <br />
        {l}Limit{/l}: <input type="text" name="DESCRIPTION_limit" size="4" class="limit_field" readonly="readonly" value="{$DescriptionLimit|trim}" />{if isset ($allowedTags)} <small>Allowed html tags: {$allowedTags|wordwrap:30:"<br />\n"}</small>{/if} <br />{if isset ($allowedAttr)}<small>Allowed html attribute tags: {$allowedAttr|wordwrap:30:"<br />\n"}</small>{/if}
    </td>
  </tr>
  {/if}
  <tr>
   <td class="label">{l}Parent Category{/l}:</td>
   <td class="field">
      {* Load category selection *}
      {include file="category_select_parent.tpl"}
   </td>
 </tr>
 <tr>
   <td class="label">{l}RSS feed:{/l}</label></td>
   <td class="field">
       <input type="text" id="RSS_URL" name="RSS_URL" value="{$RSS_URL|escape|trim}" maxlength="255" size="40" class="text" />
   </td>
 </tr>
 

 {if $symbolic eq 1}
 <tr>
    <td class="label required"><label for="SYMBOLIC_ID">{l}Symbolic category for{/l}:</label></td>
    <td class="smallDesc">
       {html_options options=$categs selected=$SYMBOLIC_ID name="SYMBOLIC_ID" id="SYMBOLIC_ID"}
       {validate form="submit_cat" id="v_SYMBOLIC_ID" message=$smarty.capture.no_url_in_top}
       {validate form="submit_cat" id="v_SYMBOLIC_ID_E" message=$smarty.capture.invalid_symbolic_category}
       {validate form="submit_cat" id="v_SYMBOLIC_ID_U" message=$smarty.capture.symbolic_category_exist}
       {validate form="submit_cat" id="v_SYMBOLIC_ID_P" message=$smarty.capture.invalid_symbolic_parent}
    </td>
 </tr>
 {/if}

 
 <tr>
    <td class="label required"><label for="STATUS">{l}Status{/l}:</label></td>
    <td class="smallDesc">
       {html_options options=$stats selected=$STATUS name="STATUS" id="STATUS"}
    </td>
 </tr>
 
 
 
 {if $symbolic ne 1 and $smarty.const.ENABLE_META_TAGS eq 1}
   <tr>
      <td class="label">{l}META Keywords{/l}:</td>
      <td class="field">
        <input type="text" name="META_KEYWORDS" value="{$META_KEYWORDS|escape|trim}" size="40" maxlength="2000" class="text" />
        <p class="small">{l}Separate keywords by comma.{/l}</p>
        {validate form="submit_cat" id="v_META_KEYWORDS_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.META_KEYWORDS_MIN_LENGTH|replace:'#MAX#':$smarty.const.META_KEYWORDS_MAX_LENGTH}
      </td>
   </tr>
   <tr>
      <td class="label">{l}META Description{/l}:</td>
      <td class="field">
         <textarea name="META_DESCRIPTION" rows="3" cols="30" class="text" {formtool_count_chars name="META_DESCRIPTION" limit=$smarty.const.META_DESCRIPTION_MAX_LENGTH alert=true}>{$META_DESCRIPTION|escape|trim}</textarea>
         {validate form="submit_cat" id="v_META_DESCRIPTION_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.META_DESCRIPTION_MIN_LENGTH|replace:'#MAX#':$smarty.const.META_DESCRIPTION_MAX_LENGTH}
         <br />
         {l}Limit{/l}: <input type="text" name="META_DESCRIPTION_limit" size="4" class="limit_field" readonly="readonly" value="{$MetaDescriptionLimit|trim}" />
      </td>
   </tr>
  {/if}

  {if $symbolic ne 1}
  <tr>
  <td class="label">{l}Page Title{/l}:</td>
  <td class="field">
  <textarea name="TDESCRIPTION" id="TDESCRIPTION" rows="6" cols="37" class="text" >{$TDESCRIPTION|trim|escape}</textarea>
  </td>
  </tr>
  {/if} 
  
  {if $symbolic ne 1}
  <tr>
  <td class="label">{l}Main area Content for the Category{/l}:</td>
  <td class="field">
  {if isset ($useRTE) and $useRTE eq 1}
   {literal}
<script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "exact",
		elements: "CATCONTENT",
		theme : "advanced",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
		theme_advanced_buttons2 : "styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons3 : "cut,copy,paste,pastetext,pasteword,|,outdent,indent,|,undo,redo",
		//theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid",
		//theme_advanced_buttons4 : "insertdate,inserttime,preview,|,forecolor,backcolor,|,charmap,emotions,iespell,media,advhr,|,print,|,fullscreen",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
		content_css : "css/content.css"
		
		});
</script>
{/literal}
<textarea id="CATCONTENT" name="CATCONTENT" rows="4" cols="40" style="width: 80%">{$CATCONTENT}
</textarea>          
  {else}   
  <textarea name="CATCONTENT" id="CATCONTENT" rows="4" cols="50" class="text" >{$CATCONTENT}</textarea>{/if}
  </td>
  </tr>
  {/if}
  
  <tr>
      <td colspan="2" class="buttons">
         {if !$review_cat and !$remove_cat}
            <input type="submit" name="submit" value="{l}Continue{/l}" class="btn" />
         {else}
            <input type="submit" name="edit" value="{l}Continue{/l}" class="btn" />
         {/if}
      </td>
  </tr>
</table>
</form>
{/if}
{/if}
{include file="footer.tpl"}
{/strip}