<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblAdmin} : {$language.lblSettings}</title>
{*include file='CommonStyles.tpl'*}
{*include file='CommonJavaScript.tpl'*}
<script type="text/javascript" src="{$common_js}/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="{$common_js}/jquery-migrate-1.4.1.js"></script>
<link href="{$view_styles}/popup.css" rel="stylesheet" type="text/css" media="screen" /> 
<script type="text/javascript">
var editImageTitle	=	"{$language.lbleditImageTitle}";
var lblAlertOk='{$language.lblAlertOk}';
var lblAlertCancel='{$language.lblAlertCancel}';
var lblAlertYes='{$language.lblAlertYes}';
var lblAlertNo='{$language.lblAlertNo}';
var lblAlert='{$language.lblAlert}';
$(document).ready(function(){ 
 $('.div_delete_sub_languageImage').hide();
});
</script>
<script type="text/javascript" src="{$view_javascript}/message.plugin.js"></script>
</head>

<body>
{assign var="required_validate" value=$required_validate|default:''}
<div class="popup-block">    
	   <div class="form_listing clearfix">
    <div id="common_message" ></div>
	{assign var="languageID" value=$languageID|default:''}
    {form->start name="formLanguagesAdd" id="formLanguagesAdd" action=""  method="post" enctype="multipart/form-data"}
        <ul>
			<li class="clearfix">
                <div class="inner-left fixing_left"><strong>{$language.lblMenuBrands}</strong></div>
                <div class="inner-right fixing_right">
                  {form->select style="width:45%;" class="selectBx00 select" name="brandID" options=$listBrand validate="required" error="$language.errFranchisee" value=$brandID}
                </div>
            </li>
            <li class="clearfix">
                <div class="inner-left fixing_left"><strong>{$language.lblLanguageName}</strong></div>
                <div class="inner-right fixing_right">
                  {form->textbox tabindex="1" name="languageName" class="textbox width_55" validate="required" error=$language.errLanguageName}
                </div>
            </li>
            <li class="clearfix">
                <div class="inner-left fixing_left"><strong>{$language.lblLanguageCode}</strong></div>
                <div class="inner-right fixing_right">
                  {form->textbox maxlength="4" tabindex="1" class="textbox width_55" name="languageCode" validate="required" error=$language.errLanguageCode}
                </div>
            </li>
            <li class="clearfix">
                <div class="inner-left fixing_left"><strong>{$language.lblLanguageLCIDstring}</strong></div>
                <div class="inner-right fixing_right">
                  {form->textbox maxlength="5" tabindex="1" name="LanguageLCIDstring" class="textbox width_55" validate="required~*isLCIDString" error=$language.errLanguageLCIDstring|cat:"~*"|cat:$language.errValidLcidString}
                </div>
            </li>
            <li class="clearfix">
                <div class="inner-left fixing_left"><strong>{$language.lblLanguageLocale}</strong></div>
                <div class="inner-right fixing_right">
                  {form->textbox name="languageLocale" class="textbox width_55" tabindex="1" validate="required" error=$language.errLanguageLocale}
                </div>
            </li>
			<li class="clearfix">
                <div class="inner-left fixing_left"><strong>{$language.lblLanguageDirection}</strong></div>
                <div class="inner-right fixing_right">
                  {form->select name="languageDirection" class="selectbox width_55" caption="->{$language.lblSelect}" options="ltr->LTR~*rtl->RTL"}
                </div>
            </li>
            <li class="clearfix">
                <div class="inner-left fixing_left">
                <strong>{$language.lblLanguageImage}</strong></div>
                <div class="inner-right fixing_right icon">
                 <span tabindex="5">
                  {form->upload_image
						name		  = "languageImage" 
						width		  = "25"
						path		  = "uploads/languages/"
						file		  = $languageImage|escape|default:'' 
						validate	  = "required"
						error		  = $language.errLanguageImage 
						tabindex	  ="1"
						size_caption  = $language.lblMaximumFileSize 
						types_caption = $language.lblFileTypes}
                 </span>
                 </div>
            </li>
			 <li class="clearfix">
                <div class="inner-left fixing_left">
                <strong>{$language.lblImage}</strong></div>
               <div class="inner-right fixing_right">
                 <span tabindex="5">
                   {form->upload_image
							name		  = "languageLogo" 
							validate	  = "isImage" 
							error         = $language.errValidImage
							path		  = "uploads/languages/logo/"
							file		  = $languageLogo
							size_caption  = $language.lblMaximumFileSize 
							types_caption = $language.lblFileTypes}
                 </span>
               </div>
            </li>
			
            <li class="clearfix">
                <div class="inner-left fixing_left"><strong>{$language.lblLanguageTemplateFile}</strong><span class="sub-text">{$language.lblFrontEnd}(.xml)</span></div>
                <div class="inner-right fixing_right">
                {if $LanguageLCIDstring|default:'' eq ""}
                	{assign var="required_validate" value="required~*languageFileFrontEnd->isFileType->xml"}
                    {assign var="filename" value=""}
                {else}
                	{assign var="filename" value=$LanguageLCIDstring|cat:".xml"|default:''}
                {/if}
                 {form->upload name="languageFileFrontEnd" value="{$views_path}/languages/"|cat:$LanguageLCIDstring|cat:".xml"|default:'' tabindex="1" validate=$required_validate error=$language.errLanguageFile|cat:"~*"|cat:$language.errInvalidFileType}
                 {if $languageID}
                {html->anchor href="language/ajaxdownload/file/frontend/id/"|cat:$languageID title=$language.lblLanguageFileDownload class="button-link01" content=$language.lblFrontEndDownload tabindex="1"}
                 {/if}
                </div>
            </li>
            <li class="clearfix">
                <div class="inner-left fixing_left"><strong>{$language.lblLanguageTemplateFile}</strong><span class="sub-text">{$language.lblBusiness}(.xml)</span></div>
                <div class="inner-right fixing_right">
                {if $LanguageLCIDstring|default:'' eq ""}
                  {assign var="required_validate" value="required~*languageFileBusiness->isFileType->xml"}
                    {assign var="filename" value=""}
                {else}
                  {assign var="filename" value=$LanguageLCIDstring|cat:".xml"|default:''}
                {/if}
                 {form->upload name="languageFileBusiness" value="{$views_path}/languages/"|cat:$LanguageLCIDstring|cat:".xml"|default:'' tabindex="1" validate=$required_validate error=$language.errLanguageFile|cat:"~*"|cat:$language.errInvalidFileType}
                 {if $languageID}
                 {html->anchor href="language/ajaxdownload/file/business/id/"|cat:$languageID title=$language.lblLanguageFileDownload class="button-link01" content=$language.lblBusinessDownload tabindex="1"}
                 {/if}
                </div>
            </li>  
           
        {*     <!--*********Affiliate******************-->
           {if $affiliateExist}
            <li class="clearfix">
                <div class="inner-left fixing_left"><strong>{$language.lblLanguageTemplateFile}</strong><span class="sub-text">{$language.lblAffiliate}(.xml)</span>
                </div>
                <div class="inner-right fixing_right">
                {if $LanguageLCIDstring|default:'' eq ""}
                	{assign var="required" value="required~*languageFileAffiliate->isFileType->xml"}
                    {assign var="filename" value=""}
                {else}
                	{assign var="filename" value=$LanguageLCIDstring|cat:".xml"|default:''}
                {/if}
                 {form->upload name="languageFileAffiliate" value="default/affiliate/standard/languages/"|cat:$LanguageLCIDstring|cat:".xml"|default:'' tabindex="1" validate=$required|default:'' error=$language.errLanguageFile|cat:"~*"|cat:$language.errInvalidFileType}
                 {if $languageID}
                 <strong>{html->anchor href="language/ajaxdownload/file/affiliate/id/"|cat:$languageID title=$language.lblLanguageFileDownload class="button-link01" content=$language.lblAffiliateDownload tabindex="1"}</strong>
                 {/if}
                </div>
            </li>
            {/if}
            <!--*********Affiliate End**********************-->       *}   
            <li class="clearfix">
                <div class="inner-left fixing_left"><strong>{$language.lblLanguageTemplateFile}</strong><span class="sub-text">{$language.lblBackEnd}(.xml)</span></div>
                <div class="inner-right fixing_right">
                {if $LanguageLCIDstring|default:'' eq ""}
                	{assign var="required_validate" value="required~*languageFile->isFileType->xml"}
                    {assign var="filename" value=""}
                {else}
                	{assign var="filename" value=$LanguageLCIDstring|cat:".xml"|default:''}
                {/if}
                 {form->upload name="languageFile" value="{$views_path}/languages/"|cat:$LanguageLCIDstring|cat:".xml"|default:'' tabindex="1" validate=$required_validate error=$language.errLanguageFile|cat:"~*"|cat:$language.errInvalidFileType}
                 {if $languageID}
                 {html->anchor href="language/ajaxdownload/file/backend/id/"|cat:$languageID title=$language.lblLanguageFileDownload class="button-link01" content=$language.lblBackEndDownload tabindex="1"}
                 {/if}
                </div>
            </li>
            <li class="clearfix">
                <div class="inner-left fixing_left"><strong>{$language.lblStatus}</strong></div>
                <div class="inner-right fixing_right">
                	<div id="perioddiv">
                         {if $languageID neq $defaultLngID}  
                         {form->radio tabindex="1" name="languageStatus" class="customradio" options="Active->{$language.lblActive}~*Inactive->{$language.lblInactive}" value="Active"}   
                         {else}
                            {form->radio tabindex="1" name="languageStatus" class="customradio" options="Active->{$language.lblActive}" value="Active"}   
                           {/if}
                        </div>
                </div>
            </li>
            <li class="clearfix">
                <div class="submit-block clearfix textto_center">
                <span>&nbsp; </span>
                  	  {if $languageID}
                        	{assign var="linkappend" value="id/"|cat:$languageID|cat:"/"}
                            {assign var="submit_button" value=$language.lblUpdate}
                      {else}
                      		{assign var="submit_button" value=$language.lblSave}
                      {/if}
                      {form->submit tabindex="1" name="submit" class="curve-3" id="submit" value=$submit_button} 
                      {$language.lblOr} 
                        {html->anchor id="cancel"  tabindex="1" onclick="top.location.reload();" content=$language.lblCancel}
                </div>
            </li>
        </ul>
    {form->close}
    </div>
</div>    
{form->validate_script form="formLanguagesAdd"}
{html->messages_script id="common_message"}
{if $languageID}
	{assign var="pageAction" value="edit"}
{else}
	{assign var="pageAction" value="add"}
{/if}
<script type="text/javascript" src="{$view_javascript}/languageAdd.page.js"></script>
<script type="text/javascript" src="{$common_js}/uploadImage.plugin.js"></script>
<script type="text/javascript" src="{$view_javascript}/custom-radiobutton.js"></script>
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script>
<script type="text/javascript">
var pageAction="{$pageAction}";
var languageID="{$languageID}";
$(document).ready(function(){
	$("#brandID").change(function(){
		var id			=	$('#brandID').val();	
		if(pageAction=="edit" && languageID > 0) {
			window.location.href = GLOBAL_BASE_PATH+"/language/edit/id/"+languageID+"/brandID/"+ id+"/";
		}
	}); 
});
$(function(){
	 $('#perioddiv input').customInput('');
	});	
</script>
</body>
</html>