<!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.lblAddCity}</title>
<link rel="stylesheet" type="text/css" href="{$view_styles}/language.css" media="screen" />
<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" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox-img-gallery.css" />
<style>
h4{
background-color: #ECECEB;
border-bottom: #BBB solid 1px;
padding: 5px;
margin: 0 0 15px;
}
h4 .hidePanel{
cursor:pointer;
}
</style>
{form->basepath_script}
{form->rootpath_script}
</head>
<body >
<div class="popup-block">
 <div >
  <div class="full_width">
  <div id="common_message" ></div>
    
  {form->start name="formThemeActivate" action="" method="post" enctype="multipart/form-data"}  
  {form->hidden name="languageID" value=1}
  {form->hidden name="themeKey" value=$themeKey}
  <div class="clear"></div>
  <div class="form_listing02 clearfix ">  	
    
	
	<div id="accordion">
      
	  {foreach $templateArray as $key=>$group}
		

		 <h4>{$language[$group.title]}<span class="hidePanel show" rel="key_{$key}"> (-) </span></h4>
		<div rel="key_{$key}">
		 <ul>
		 {assign var="templates" value=$group.pages}
		  {foreach $templates as $template}
		   <li class="clearfix">
			<div class="inner-left fixing_left">{$language[$template.languageKey]}</div>
			<div class="inner-right fixing_right">
				 <div class="clearfix">
				 {foreach $template.layout as $layout}
			   <div class="box">
				<a href="{$imagePath}{$layout.img}" class='preview'><img  height="81" width="110" src="{$imagePath}thumb/{$layout.img}"/></a> 
				<span>{form->radio name="layout[{$template.key}]" class="class_{$template.key}" value=$template.checked options=$layout.tpl|cat:"->"|cat:$layout.name  tabindex="1"}</span>
				{form->validate name="{$template.key}" validate='required' error=$language.lblSelectPageLayout}
				
				</div>
				{/foreach}
			</div>
			<div class="clear"></div>
			<script>
					$(document).ready(function(){
						if($(".class_{$template.key}:checked").length>0){
							$("#{$template.key}").val('1')
						}
						else{
							$("#{$template.key}").val('');
						}
						$(".class_{$template.key}").change(function(){
							if($(".class_{$template.key}:checked").length>0){
							$("#{$template.key}").val('1')
						}
						else{
							$("#{$template.key}").val('');
						}
						});
					});

				</script>
		  </li>
		  
		  {/foreach}
		  </ul>
		 </div>

      
	  {/foreach}
	 </div>
	 
	 <div>
      	<div class="submit-block clearfix textto_center"> 
           <span>&nbsp; </span>
         
		 {if $sectionID|default:''} 
			{assign var="label" value="{$language.lblUpdate}"}          
          {else}          
			{assign var="label" value="{$language.lblSave}"}          
          {/if} 
		  
          {form->submit name="submitActivate" class="curve-3"  tabindex="1" value=$label} 
          {$language.lblOr} 
          {html->anchor id="cancel" tabindex="1" onclick="top.location.reload();" content=$language.lblCancel}
        </div>
      </div>
   
	
	
    {form->close} </div>
    </div>
    </div>
</div>
{form->validate_script form="formThemeActivate"}
{html->messages_script id="common_message"}
<script type="text/javascript">
var lblAlertOk='{$language.lblAlertOk}';
var lblAlertCancel='{$language.lblAlertCancel}';
var lblAlertYes='{$language.lblAlertYes}';
var lblAlertNo='{$language.lblAlertNo}';
var lblAlert='{$language.lblAlert}';
</script>
{literal}
<script>
$(document).ready(function(){
	$(".preview").colorbox({iframe:true, innerWidth:"657px", innerHeight:"80%"});
	$(".hidePanel").click(function(){
		if($(this).hasClass('show')){
			$('div[rel='+$(this).attr('rel')+']').hide();
			$(this).removeClass('show').text(' (+)');
		}
		else{
			$('div[rel='+$(this).attr('rel')+']').show();
			$(this).addClass('show').text(' (-)');
		}
		
	});

});
</script>
{/literal}
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script>
<script type="text/javascript" src="{$view_javascript}/message.plugin.js"></script>
<script type="text/javascript"  src="{$view_javascript}/jquery.colorbox.js"></script> 


</body>
</html>
