<!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.lblModuleWidgets}</title>
{include file='CommonStyles.tpl'}
{include file='CommonCustomStyles.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/inner-formlisting.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" media="screen" />
<link href="{$view_styles}/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/ui.daterangepicker.css" />
<style>
.date_picker_field.disabled{
	background: #EBEBE4 url({$view_images}/sprite/sprite-icons.png) no-repeat right 5px !important;
	border: 1px solid CECECC !important;
}
.deleteConditionRow,.deleteGroupRow{
	float:right;
	font-size: 10px;
	font-weight: bold;
	margin-left:5px;
}

</style>
{include file='CommonJavaScript.tpl'}
{form->rootpath_script}
{form->basepath_script}
</head>
<body>
<div class="outer_container">
  {include file='CommonTop.tpl'}
  <!--End:Header Container-->
  <!--***********************************************************************START CONTAINER SECTION******************************************************-->
  <div class="content_container4 clearfix">
        <div class="wdgt-tab-section">
        <div class="wdgt-tab-head clearfix">
        	 <h4 class="page-head fixing_left inactive"> {html->anchor href="/widget/edit/id/{$widgetID}/"  class="icon-set-af edit" content="{$widgetTitle}"} 
       </h4>{assign var="tabID" value=$tabID|default:""}
		{assign var="resTabs" value=$resTabs|default:array()}
             <ul class="wdgt-tab2 fixing_right">		
		  {if $resTabs|count>0}
		  {foreach item="tabs" from=$resTabs}
		  {if $tabs.widgetTabID==$tabID} {assign var="tstatus" value="active"} {else} {assign var="tstatus" value=""}{/if}
<li>{html->anchor href="/widget/tabs/wid/{$widgetID}/tid/{$tabs.widgetTabID}/" class="tab {$tstatus} icon-set-af" content="{$tabs.tabTitle}"}
		{*html->anchor title="{$language.lblDelete}" rel="{$widgetID}" tabID="{$tabs.widgetTabID}" class="delete-tab icon-set"*}</li>
 {/foreach}
	        {/if}
		<li>
		{html->anchor href="/widget/tabs/wid/{$widgetID}/"  class="icon-set-bf add-new-btn2" content="{$language.lblAddTab}"} 
		</li>
             </ul>
	</div>
    
    {form->start name="formWtab" action="" method="post"}    
         <div class="wdgt-tab-cnt">
          <div id="common_message" style="display: none;"></div>
          <div class="create-wdgt">
          <div class="clearfix"><div class="fixing_right space-t-l">{include file='ContentLanguageOptions.tpl'}</div></div>
         <div class="form_listing form_listing03">
	    
         <div class="clearfix">
          	<div class="left-pane fixing_left">
            	<ul >{form->hidden name="postItemIds"}
			{form->hidden name="type"}
			{form->hidden name="no_image_path" value="{$view_images}/thumbnail.gif"}
			{form->hidden name="image_path" value="{$view_public_path}/uploads/"}			
			
                	<li class="clearfix">
                    	<span class="leftside01 mandatory"><strong>{$language.lblTabTitle}</strong></span>
                        <span class="rightside01 ">
			{form->textbox  class="text-box" name="tabTitle" validate="required"  error=$language.errRequired}
				</span>
                  </li>
                    <li class="clearfix">
                    	<span class="leftside01 fixing_left mandatory"><strong>{$language.lblNumberofitem}</strong></span>
                        <span class="rightside01 ">{form->textbox  validate="required~*isWholeNumberWithOutZero"   error=$language.errRequired|cat:"~*"|cat:$language.errMinimumLimit  value="5" class="text-box" name="itemCount"}</span>
                  </li>
				  
		     <li class="clearfix">
                    	<span class="leftside01 fixing_left">{$language.lblShowItemLabel}</span>
                        <span class="rightside01 top-spc">{form->checkbox name="showItemLabel" value="Yes" checked="{if $showItemLabel=='Yes'}checked{/if}"}
                </span>
                  </li>	
				  
                 <li class="clearfix">
                    <span class="leftside01 fixing_left mandatory">{$language.lblWidgetType}</span>
                    <span class="rightside01">
					{form->radio 
						name="widgetType" 
						options="default->Default~*static->Static"
						value="default"						
						} 
                    </span>
		</li>
   
                    
            <li class="clearfix staticDiv">
                    	<span class="leftside01 fixing_left"><strong>{$language.lblListingType}</strong></span>
                        <span class="rightside01 " id="listType">
			{form->select 
						name="listingType" 												
						tabindex="8"						
						options="you_may_like->{$language.lblYoumaylike}~*categories->{$language.lblCategories}~*custom->Custom" 
						} 	
                      </span>
                  </li>
	
		    <li class="clearfix promotionTab">
                    	<span class="leftside01 fixing_left">{$language.lblisFeatured}</span>
                        <span class="rightside01 ">
			{form->checkbox 
						name="promotion_data[conditions][isFeatured]"											
						value="Yes" checked="{if isset($isFeatured) && $isFeatured=='Yes'}checked{/if}"				
						 
						} 	
                      </span>
                  </li>
                    <li class="clearfix promotionTab">
                    	<span class="leftside01 fixing_left">{$language.lblOrderBy}</span>
                        <span class="rightside01 ">
			{form->select
						name="promotion_data[conditions][orderBy]" 										
												
						options="none->{$language.lblSelect}~*best_seller->{$language.lblBestSeller}~*productID->{$language.lblNewArrivals}~*discount->{$language.lblSpecialOffer}" 
						} 	
                      </span>
                  </li>
                </ul>
            </div>
           
            <div class="right-pane fixing_right">
            	<ul >
                <li class="clearfix">
                    	<span class="leftside01 fixing_left">{$language.lblShowViewMore}</span>
                        <span class="rightside01 top-spc ">			 
			{form->checkbox name="enableViewMore" value="Yes" checked="{if isset($enableViewMore) && $enableViewMore=='Yes'}checked{/if}"}			
                        </span>
                  </li>
				  <li class="clearfix">
                    	
                        <span class="rightside01 top-spc ">			 				
					    {html->anchor href="ajax/generatecataloglink/?id=widgetLink" id="generateCatalogLink" caption="{$language.lblImportCatUrl}" title="{$language.lblGenerateCatalogLinks}" class="linkbtnt01"}			 
                        </span>
                  </li>
                 <li class="clearfix" style="display: none" id="customShow">
		  <span class="leftside01">{$language.lblAddCustomLabel}</span>
			 <span class="rightside01 top-spc ">{form->checkbox 
						name="viewMoreLabelType"						
						value="custom"
						checked="{if isset($viewMoreLabelType) && $viewMoreLabelType=='custom'}checked{/if}"} 
				
                             <span class="blk-group" id="viewMore" style="display: none"> {form->textbox  validate="viewMoreLabelType->isEqual->custom~*required" error=$language.errRequired class="text-box" name="viewMoreLabel"} </span> 
                  </span></li>
		  <li class="clearfix" style="display: none" id="viewMoreLink">
                    	<span class="leftside01" >{$language.lblViewMoreLink}</span>
                        <span class="rightside01 ">
			      {form->textbox  class="text-box" name="viewMoreLink"}
			      {if isset($showLinkWarning)&& $showLinkWarning==1}<div id="linkWarn" class="message_info ">{$language.lblviewMoreWarn}</div>{/if}
                  </span>
			<span class="rightside01">{form->checkbox name="enableAutogenerate" value="Yes" checked="{if isset($enableAutogenerate) && $enableAutogenerate=='Yes'}checked{/if}"}			
                        {$language.lblAutoGenerateLink}</span>
			
                  </li>
<li class="clearfix">
				<div class="leftside01 mandatory">
					{$language.lblWidgetstatus}
				</div>
				<!--End:Left-->
				<div class="rightside01"> 
					<div id="perioddiv">
					{form->radio 
						name="status" 
						class="customradio"
						tabindex="7"
						value="A"
						options="A->{$language.lblActive}~*I->{$language.lblInactive}" 
						} 
					</div>
				</div>
				<!--End:right-->
			  </li>
                </ul>
            </div>
            
          </div>
           <ul>
                             <li class="clearfix staticDiv1">
                    <span class="leftside01 fixing_left" style="width: 17%;"><strong>{$language.lblStaticContents}</strong></span>
                    <span class="rightside01" style="width: 82%;"> 
			      {form->editor  
					validate="widgetType->isEqual->static~*required" 
					error=$language.errcontentRequire 
					mode="simple" skin=2 name="staticWidgetContent" 
					id="staticWidgetContent"   class="textarea" uploads="widgets"}
                       
                    </span>
		</li>
                
            </ul>
          <ul>
              <li class="clearfix full_width_list staticDiv">
            	<div class="rightside01-new  ">
                	<div class="wdgt-addblck">
                    <div class="info-message" id="dragInfo">{$language.lblDragDropsettingpriority}</div>
                    <h6>
		 <!--  <span id="brandLink">{html->anchor href="tabs/ajaxLoadBrands/" title="{$language.lblPromotionSchemaLinkBrands}"  rel="brands" class="popupPicker icon-set-bf" content="{$language.lblPromotionSchemaLinkBrands}"} </span>  -->
		  <span id="pdtLink" style="display: none">{html->anchor rel="products" title="{$language.lblAddProduct}" href="tabs/ajaxLoadProducts/brandID/{$brandID}/"  class="icon-set-bf popupPicker" content="{$language.lblAddProduct}"} 
		  </span> 
		  <span id="catLink" style="display: none">{html->anchor rel="categories" title="{$language.lblAddCategories}" href="tabs/ajaxLoadCategories/catID/{$wCategoryID}/brandID/{$brandID}/"  class="popupPicker icon-set-bf" content="{$language.lblAddCategories}"} 
		  </span> 
		    </h6>
            {if $tabID}
		    <ul id="contentList" class="item-list">
			{foreach $resItems as $item}
			<li id="{$item.itemID|default:''}" class="clearfix pickerDataListCommon {$type}" rel="{$item.itemID|default:''}" type="{$type}">
			<a class="deletePickerDataRowCommon delete03 icon-set fixing_right" title="Delete" rel="{$item.itemID|default:''}" href="Javascript:void(0);"></a>
			<div class="img-div">{if $item.itemIcon|default:''}<img src="{$view_public_path}/uploads/{$item.itemIcon|default:''}" width="40"/>{else}
            <img src="{$view_images}/thumbnail.gif" alt ="{$item.itemName|default:''}" width="40"/>
            {/if}</div>
			{$item.itemName|default:''}
			</li>
			{/foreach}
                    </ul>
		    {else}
                    <ul id="contentList" style="display: none" class="item-list">                    	                      
                    </ul>

		    {/if}{form->hidden name="hidItem" value=""}			
                        <div class="tabpane">
			<div class="tabpane_inner"> 
			<div class="promotionTab promotionTabblock" style="display: none">
							{form->validate name="validateConditionSelection" validate="callback_checkConditionFields" error=$language.errEnterTabConditions}
							{form->hidden class="validateConditionValues" name="validateConditionValues" value="0"}
							<br/>
							{include file='WidgetTabConditions.tpl'}
						      </div>
                          	</div>
					</div>                            
                    </div>
                </div>
            </li>
            <li class="clearfix">
             <div class="submit-block clearfix textto_center"> 
						<span>&nbsp; </span>
                        {form->submit name="submitWtab" value="{$language.lblSave}" class="curve-3"}
                         {$language.lblOr}
           {html->anchor href="/widget/index/"   content="{$language.lblCancel}"}
          </div>
                  </li>
            </ul>
           
          <!--End:Border 3--> 
          </div>
          </div>
       {form->close} </div>
        <!--End:Border 2--> 
  </div>
  <!--***********************************************************************END CONTAINER SECTION****************************************************--> 
  <!--End:Content Container-->
 <!--********************-->
<!--End:Content Container-->
{include file='CommonBottom.tpl'} 
</div>
</div>
<!--End:Outer Container-->

{include file='CommonJavaScriptBottom.tpl'}
<script type="text/javascript" src="{$view_javascript}/custom-radiobutton.js"></script> 
<script type="text/javascript">

$(function(){
	 $('.customradio').customInput('');
	});	
var lblDelete = "{$language.lblDelete}";
var lblPromoProductQuantity = "{$language.lblPromoProductQuantity}";
var msgConfirmDelete="{$language.lblPromotionCouponDeleted}";
var lblSelectItem ="{$language.lblSelectItem}";
var msgSelectAStatus ="{$language.msgSelectAStatus}";
var lblCombinations ="{$language.lblCombinations}";
var lblVariants ="{$language.lblVariants}";
var lblCustomOptions ="{$language.lblCustomOptions}";
{if isset($attrData) && $attrData}
	var attrArray = {$attrData};
	var attrData = attrArray.attributeArray;
	var attrOptionData = attrArray.attrOptionArray;
	var attrForOption = '';
	$.each(attrData, function(index, value) {
		attrForOption = attrForOption + '<option value="'+value['attributeID']+'" attrInputType="'+value['attrInputType']+'">'+value['attrName']+'</option>';
	});
	$(".promoConditionCopySource").find(".promotionCondtionElement_attributes").append(attrForOption);
	$(".promoBonusCopySource").find(".promotionBonusElement_attributes").append(attrForOption);
{/if}
</script> 
<script type="text/javascript" src="{$view_javascript}/tabs.page.js"></script>
<script type="text/javascript" src="{$view_javascript}/jquery.colorbox.js"></script>
<script type="text/javascript" src="{$view_javascript}/table.plugin.js"></script> 
<script type="text/javascript">
var lblWidgetPrioritySuccess="{$language.lblwidgetPrioritySuccess}";
var msgDeleteItem	= '{$language.msgDeleteItem}';
var msgSelectItem	= '{$language.msgSelectItem}';
var lblSelectAction			= '{$language.lblSelectAction}';
var msgSelectSearchCriteria	= '{$language.msgSelectSearchCriteria}';
var lblSelectItem			= '{$language.lblSelectItem}';
var lblDelete			= '{$language.lblDelete}';
var msgConfirmDeletetab      = '{$language.msgConfirmDelete}';
</script>


{form->editor_script names="staticWidgetContent"}
{html->messages_script id="common_message"}
{form->basepath_script}
{form->rootpath_script}
<script type="text/javascript" src="{$view_javascript}/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script> 
<script type="text/javascript" src="{$view_javascript}/newsletterrule.page.js"></script>
<script type="text/javascript">
{literal}
$(document).ready(function(){
	$("#generateCatalogLink").colorbox({iframe:true, width:"80%", height:"80%"});
});
$('.item-list').sortable({		
		items: "> li",
		placeholder:'placeholder2',
		update: function(event, ui) {
			var result = $(this).sortable('toArray');						 
			$("#postItemIds").val(result);
			}
	});
{/literal}
	</script>
<script type="text/javascript">
setTimeout(function(){ $("#linkWarn").slideUp();},10000);
</script>
{form->validate_script form="formWtab"}
</body>
</html>
