{capture name="title"} - {l}Submit Link{/l}{/capture}
{capture assign="in_page_title"}{l}Submit Link{/l}{/capture}
{capture assign="description"}{l}Submit a new link to the directory{/l}{/capture}
    
{include file="header.tpl"}
{include file="top_bar.tpl"}
 
<table border="0" class="formPage">
    <form action="{$smarty.const.DOC_ROOT}/inplace_editlink.php?ID={$ID}" method="post">
        {if $posted}
             <h3 style="color: red">Link Saved.</h3>
        {/if}
        {if $error_message}
           <h3 style="color: red">{$error_message}</h3>
        {/if}
        <table border="0" class="formPage">
            <tr>
                <td colspan="2" style="text-align: center; font-weight: bold;">Edit Link</td>
            </tr>
            <tr>
                <td>{l}Title{/l}</td>
                <td><input type="text" name="TITLE" value="{$link.TITLE}"/></td>
            </tr>
            {if $categs|@count > 0}
            <tr>
                <td>{l}Category{/l}</td>
                <td>
                {*html_options options=$categs selected=$CATEGORY_ID name="CATEGORY_ID" id="CATEGORY_ID"*}
                {*include file="category_select.tpl"*}
                
                  {html_options options=$categs selected=$link.CATEGORY_ID name="CATEGORY_ID"}
               
                
                </td>
            </tr>
            {/if}
            <tr>
                <td>{l}Description{/l}</td>
                <td>
                    {if isset ($useRTE) and $useRTE eq 1}
                    {literal}
                    <script type="text/javascript">
                    //<![CDATA[
                    tinyMCE.init({
                     
                         mode : "exact",
                         elements: "DESCRIPTION",
                         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_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect",
                         theme_advanced_buttons2 : ",fontselect,fontsizeselect,|,cut,copy,paste,pastetext,pasteword,|,outdent,indent,|,undo,redo",
                         theme_advanced_toolbar_location : "top",
                         theme_advanced_toolbar_align : "left",
                         theme_advanced_statusbar_location : "bottom",
                         theme_advanced_resizing : true,
                        
                        content_css : "css/content.css"
                 
                     });
                    //]]>
                    {/literal}
                    </script>
                 
                    <textarea id="DESCRIPTION" name="DESCRIPTION" rows="10" cols="10" style="width: 100%">
                        {$link.DESCRIPTION}
                    </textarea> 
                    {else}
                    <textarea name="DESCRIPTION" rows="10" cols="40">{$link.DESCRIPTION}</textarea>
                    {/if}
                </td>
            </tr>
            <tr>
                <td>URL</td>
                <td><input type="text" name="URL" value="{$link.URL}"/></td>
            </tr>
            {if $smarty.const.REQUIRE_REGISTERED_USER}
            <tr>
                <td>{l}Assign Owner{/l}</td>
                <td class="smallDesc">
                    {html_options options=$ActiveUsersList selected=$link.OWNER_ID name="OWNER_ID" id="OWNER_ID"}
                    <p class="msg notice info">{l}Use with care!! Selected user details will overwrite link owner name, email address and id!!{/l}</p>
                </td>
            </tr>
            {/if}
            <tr>
                <td class="label"><label for="OWNER_NAME">{l}Owner Name{/l}:</label></td>
                <td class="smallDesc">
                    <input type="text" id="OWNER_NAME" name="OWNER_NAME" value="{$link.OWNER_NAME|escape|trim}" maxlength="{$smarty.const.USER_NAME_MAX_LENGTH}" class="text" />
                </td>
            </tr>
            <tr>
                <td class="label"><label for="OWNER_EMAIL">{l}Owner Email{/l}:</label></td>
                <td class="smallDesc">
                    <input type="text" id="OWNER_EMAIL" name="OWNER_EMAIL" value="{$link.OWNER_EMAIL|escape|trim}" maxlength="255" class="text" />
                </td>
            </tr>
            <tr>
                <td class="label required"><label for="FEATURED">{l}Featured{/l}:</label></td>
                <td class="smallDesc">
                    <input type="checkbox" id="FEATURED" name="FEATURED" value="1" {if $link.FEATURED}checked="checked"{/if} />
                </td>
            </tr>
            <tr>
                <td class="label required"><label for="NOFOLLOW">{l}NoFollow{/l}:</label></td>
                <td class="smallDesc">
                    <input type="checkbox" id="NOFOLLOW" name="NOFOLLOW" value="1"{if $link.NOFOLLOW} checked="checked"{/if} />
                </td>
            </tr>
            <tr>
                <td class="label required"><label for="RECPR_REQUIRED">{l}Require Reciprocal Link{/l}:</label></td>
                <td class="smallDesc">
                    <input type="checkbox" id="RECPR_REQUIRED" name="RECPR_REQUIRED" value="1"{if $link.RECPR_REQUIRED} checked="checked"{/if} />
                </td>
            </tr>
            <tr>
                <td class="label"><label for="RECPR_URL">{l}Reciprocal Link URL{/l}:</label></td>
                <td class="smallDesc">
                    <input type="text" id="RECPR_URL" name="RECPR_URL" value="{$link.RECPR_URL|escape|trim}" class="text" />
                    {if !empty ($link.RECPR_URL)}
                    <a href="{$link.RECPR_URL|escape|trim}" title="{l}Visit{/l}: {$link.RECPR_URL|escape|trim}" class="button" target="_blank">{l}Visit reciprocal page{/l}</a>
                    {/if}
                </td>
            </tr>
            <tr>
                <td>{l}Status{/l}</td>
                <td>
                    {html_options options=$stats selected=$link.STATUS name="STATUS" id="STATUS"}
                </td>
            </tr>
            {if $smarty.const.ENABLE_PAGERANK}
            <tr>
                <td class="label"><label for="PAGERANK">{l}Pagerank{/l}:</label></td>
                <td class="smallDesc">
                    <input type="text" id="PAGERANK" name="PAGERANK" value="{$link.PAGERANK}" maxlength="2" class="text" />
                    <p class="msg notice info">{l}Leave the field blank for automatic Google Pagerank calculation or give value of "-1" for no Pagerank.{/l}</p>
                </td>
            </tr>
            {/if}
            <tr>
                <td class="label"><label for="HITS">{l}Hits{/l}:</label></td>
                <td class="smallDesc">
                    <input type="text" id="HITS" name="HITS" value="{$link.HITS}" maxlength="15" class="text" />
                </td>
            </tr>
            {if $smarty.const.ENABLE_META_TAGS eq 1}
            <tr>
                <td class="label"><label for="META_KEYWORDS">{l}META Keywords{/l}:</label></td>
                <td class="smallDesc">
                    <input type="text" id="META_KEYWORDS" name="META_KEYWORDS" value="{$link.META_KEYWORDS|escape|trim}" class="text" />
                    <p class="msg notice info">{l}Separate keywords by comma.{/l}</p>
                </td>
            </tr>
            <tr>
                <td class="label"><label for="META_DESCRIPTION">{l}META Description{/l}:</label></td>
                <td class="smallDesc">
                    {if isset ($useRTE) and $useRTE eq 1}
                    {literal}
                    <script type="text/javascript">
                    //<![CDATA[
                    tinyMCE.init({
                 
                     mode : "exact",
                     elements: "META_DESCRIPTION",
                     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_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect",
                     theme_advanced_buttons2 : ",fontselect,fontsizeselect,|,cut,copy,paste,pastetext,pasteword,|,outdent,indent,|,undo,redo",
                     theme_advanced_toolbar_location : "top",
                     theme_advanced_toolbar_align : "left",
                     theme_advanced_statusbar_location : "bottom",
                     theme_advanced_resizing : true,
                     
                     content_css : "css/content.css"
             
                    });
                    //]]>
                    </script>
                    {/literal}
                    <textarea id="META_DESCRIPTION" name="META_DESCRIPTION" rows="10" cols="10" style="width: 100%">{$link.META_DESCRIPTION}
                    </textarea> 
                    {else}
                    <textarea id="META_DESCRIPTION" name="META_DESCRIPTION" rows="3" cols="30" class="text" >{$link.META_DESCRIPTION|trim|escape}</textarea>
                    {/if}
                </td>
            </tr>
            {/if}
           
            <tr>
                <td align="center" colspan="2"> <input type="submit" name="save" value="{l}Save{/l}" class="btn" /></td>
            </tr>
            <tr>
            </tr>
        </table>
        <input type="hidden" name="action" value="submit" />
        <input type="hidden" name="ID" value="{$link.ID}" />
		<input type="hidden" name="formSubmitted" value="1" />
    </form>
{include file="footer.tpl"}