<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-module" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
		<button id="apply" data-toggle="tooltip" data-loading-text="<i class='fa fa-spin fa-cog'></i>" title="" class="btn btn-success" data-original-title="<?php echo $button_save_stay; ?>"><i class="fa fa-save"></i></button>
        <a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
      <h1><?php echo $heading_title; ?></h1>
      <ul class="breadcrumb">
		<?php foreach ($breadcrumbs as $breadcrumb) { ?>
			<li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
		<?php } ?>
	</ul>
    </div>
  </div>
  <div class="container-fluid">
    <?php if($error_warning){ ?>
    <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_edit; ?></h3>
      </div>
      <div class="panel-body">
        <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-module" class="form-horizontal">
			<ul id="main-nav-tabs" class="nav nav-tabs">
				<li class="active"><a href="#tab-general" data-toggle="tab"><?php echo $tab_general; ?></a></li>
				<li><a href="#tab-products" data-toggle="tab"><?php echo $tab_products_effect; ?></a></li>
				<li><a href="#tab-theme" data-toggle="tab"><?php echo $tab_theme; ?></a></li>
			</ul>
			<div class="tab-content">
				<div id="tab-general" class="tab-pane active">
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_status; ?></label>
						<div class="col-sm-10">
							<input data-toggle-fade=".dc-pages" name="digitcart_load_products_status" value="1" class="tgl tgl-light" id="digitcart_load_products_status" type="checkbox" <?php if($digitcart_load_products_status){ ?>checked="checked"<?php } ?>/>
							<label class="tgl-btn" for="digitcart_load_products_status"></label>
						</div>
					</div>
					<div class="form-group dc-pages">
						<label class="col-sm-2"><?php echo $entry_pages; ?></label>
						<div class="col-sm-10 clearfix">
							<div class="col-sm-3 clearfix">
								<div class="col-sm-6 text-right">Category</div>
								<div class="col-sm-6">
									<input name="digitcart_load_products_pages[]" value="product/category" class="tgl tgl-light" id="digitcart_load_products_pages_category" type="checkbox" <?php if (in_array('product/category', $digitcart_load_products_pages)) { ?>checked="checked"<?php } ?>/>
									<label class="tgl-btn" for="digitcart_load_products_pages_category"></label>
								</div>
							</div>
							<div class="col-sm-3 clearfix">
								<div class="col-sm-6 text-right">Search</div>
								<div class="col-sm-6">
									<input name="digitcart_load_products_pages[]" value="product/search" class="tgl tgl-light" id="digitcart_load_products_pages_search" type="checkbox" <?php if (in_array('product/search', $digitcart_load_products_pages)) { ?>checked="checked"<?php } ?>/>
									<label class="tgl-btn" for="digitcart_load_products_pages_search"></label>
								</div>
							</div>
							<div class="col-sm-3 clearfix">
								<div class="col-sm-6 text-right">Special</div>
								<div class="col-sm-6">
									<input name="digitcart_load_products_pages[]" value="product/special" class="tgl tgl-light" id="digitcart_load_products_pages_special" type="checkbox" <?php if (in_array('product/special', $digitcart_load_products_pages)) { ?>checked="checked"<?php } ?>/>
									<label class="tgl-btn" for="digitcart_load_products_pages_special"></label>
								</div>
							</div>
							<div class="col-sm-3 clearfix">
								<div class="col-sm-6 text-right">Manufacturer</div>
								<div class="col-sm-6">
									<input name="digitcart_load_products_pages[]" value="product/manufacturer/info" class="tgl tgl-light" id="digitcart_load_products_pages_manufacturer" type="checkbox" <?php if (in_array('product/manufacturer/info', $digitcart_load_products_pages)) { ?>checked="checked"<?php } ?>/>
									<label class="tgl-btn" for="digitcart_load_products_pages_manufacturer"></label>
								</div>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_custom_html_status; ?></label>
						<div class="col-sm-10">
							<input data-toggle-fade=".dc-custom-html" name="digitcart_load_products_custom_html_status" value="1" class="tgl tgl-light" id="digitcart_load_products_custom_html_status" type="checkbox" <?php if ($digitcart_load_products_custom_html_status) { ?>checked="checked"<?php } ?>/>
							<label class="tgl-btn" for="digitcart_load_products_custom_html_status"></label>
						</div>
					</div>
					<div class="form-group dc-custom-html">
						<label class="col-sm-2"><?php echo $entry_loading_icon; ?></label>
						<div class="col-sm-10">
							<ul id="loading-nav-tabs" class="nav nav-tabs">
								<?php foreach($languages as $language) { ?>
									<li><a href="#language<?php echo $language['language_id']; ?>-loading" data-toggle="tab"><?php echo $language['name']; ?></a></li>
								<?php } ?>
							</ul>
							<div class="tab-content">
								<?php foreach($languages as $language) { ?>
									<div class="tab-pane" id="language<?php echo $language['language_id']; ?>-loading">
										<textarea name="digitcart_load_products_loading_icon[<?php echo $language['language_id']; ?>]" class="form-control summernote" id="digitcart_load_products_loading_icon"><?php echo isset($digitcart_load_products_loading_icon[$language['language_id']]) ? $digitcart_load_products_loading_icon[$language['language_id']] : ''; ?></textarea>
									</div>
								<?php } ?>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_finished_text; ?></label>
						<div class="col-sm-10">
							<ul id="finished-nav-tabs" class="nav nav-tabs">
								<?php foreach($languages as $language) { ?>
									<li><a href="#language<?php echo $language['language_id']; ?>-finished" data-toggle="tab"><?php echo $language['name']; ?></a></li>
								<?php } ?>
							</ul>
							<div class="tab-content">
								<?php foreach($languages as $language) { ?>
									<div class="tab-pane" id="language<?php echo $language['language_id']; ?>-finished">
										<textarea name="digitcart_load_products_finished_text[<?php echo $language['language_id']; ?>]" class="form-control summernote" id="digitcart_load_products_finished_text"><?php echo isset($digitcart_load_products_finished_text[$language['language_id']]) ? $digitcart_load_products_finished_text[$language['language_id']] : ''; ?></textarea>
									</div>
								<?php } ?>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_pagination_status; ?></label>
						<div class="col-sm-10">
							<input name="digitcart_load_products_pagination_status" value="1" class="tgl tgl-light" id="digitcart_load_products_pagination_status" type="checkbox" <?php if($digitcart_load_products_pagination_status){ ?>checked="checked"<?php } ?>/>
							<label class="tgl-btn" for="digitcart_load_products_pagination_status"></label>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_button_load; ?></label>
						<div class="col-sm-10">
							<input data-toggle-fade=".dc-more-text" name="digitcart_load_products_button_load" value="1" class="tgl tgl-light" id="digitcart_load_products_button_load" type="checkbox" <?php if($digitcart_load_products_button_load){ ?>checked="checked"<?php } ?>/>
							<label class="tgl-btn" for="digitcart_load_products_button_load"></label>
						</div>
					</div>
					<div class="form-group dc-more-text">
						<label class="col-sm-2"><?php echo $entry_load_more_text; ?></label>
						<div class="col-sm-10">
							<ul id="more-nav-tabs" class="nav nav-tabs">
								<?php foreach($languages as $language) { ?>
									<li><a href="#language<?php echo $language['language_id']; ?>-more" data-toggle="tab"><?php echo $language['name']; ?></a></li>
								<?php } ?>
							</ul>
							<div class="tab-content">
								<?php foreach($languages as $language) { ?>
									<div class="tab-pane" id="language<?php echo $language['language_id']; ?>-more">
										<textarea name="digitcart_load_products_load_more_text[<?php echo $language['language_id']; ?>]" class="form-control summernote" id="digitcart_load_products_load_more_text"><?php echo isset($digitcart_load_products_load_more_text[$language['language_id']]) ? $digitcart_load_products_load_more_text[$language['language_id']] : ''; ?></textarea>
									</div>
								<?php } ?>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_disable_mobile; ?></label>
						<div class="col-sm-10">
							<input name="digitcart_load_products_disable_mobile" value="1" class="tgl tgl-light" id="digitcart_load_products_disable_mobile" type="checkbox" <?php if($digitcart_load_products_disable_mobile){ ?>checked="checked"<?php } ?>/>
							<label class="tgl-btn" for="digitcart_load_products_disable_mobile"></label>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_threshold; ?></label>
						<div class="col-sm-10">
							<input name="digitcart_load_products_threshold" value="<?php echo $digitcart_load_products_threshold; ?>" class="form-control" id="digitcart_load_products_threshold" type="number"/>
						</div>
					</div>
				</div>
				<div id="tab-products" class="tab-pane">
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_css_class; ?></label>
						<div class="col-sm-10">
							<input name="digitcart_load_products_css_class" value="<?php echo $digitcart_load_products_css_class; ?>" class="form-control" id="digitcart_load_products_css_class" type="text"/>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_effect_status; ?></label>
						<div class="col-sm-10">
							<input data-toggle-fade=".dc-effects" name="digitcart_load_products_effect_status" value="1" class="tgl tgl-light" id="digitcart_load_products_effect_status" type="checkbox" <?php if($digitcart_load_products_effect_status){ ?>checked="checked"<?php } ?>/>
							<label class="tgl-btn" for="digitcart_load_products_effect_status"></label>
						</div>
					</div>
					<div class="dc-effects">
						<div class="form-group">
							<label class="col-sm-2"><?php echo $entry_animation_delay; ?></label>
							<div class="col-sm-10">
								<input name="digitcart_load_products_animation_delay" value="<?php echo $digitcart_load_products_animation_delay; ?>" class="form-control" id="digitcart_load_products_animation_delay" type="text"/>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-12"><label><?php echo $select_effects; ?></label><br><small><?php echo $text_effects_help; ?></small><br></div>
							<div class="col-sm-12" id="all-effects">
								<?php foreach($all_effects as $effects_group_title => $effects){ ?>
									<div>
										<strong><?php echo $effects_group_title; ?></strong>
										<?php foreach($effects as $effect){ ?>
											<span>
												<div><?php echo $effect; ?></div>
												<input name="digitcart_load_products_effects[]" value="<?php echo $effect; ?>" class="tgl tgl-light" id="digitcart_load_products_effects_<?php echo $effect; ?>" type="checkbox" <?php if (in_array($effect, $digitcart_load_products_effects)) { ?>checked="checked"<?php } ?>/>
												<label class="tgl-btn" for="digitcart_load_products_effects_<?php echo $effect; ?>"></label>
											</span>
										<?php } ?>
									</div>
								<?php } ?>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-2">
								<div><?php echo $text_preview; ?></div>
								<hr>
								<a class="btn btn-success" onclick="previewEffect(lastSelectedEffect);"><?php echo $text_preview_again; ?></a>
							</div>
							<div class="col-sm-10 clearfix" id="digitcart-load-products-preview">
								<div class="col-sm-4"><img style="margin:auto;max-width:100%" src="view/stylesheet/digitcart_load_products_assest/digitcart_load_products.png"></div>
								<div class="col-sm-4"><img style="margin:auto;max-width:100%" src="view/stylesheet/digitcart_load_products_assest/digitcart_load_products.png"></div>
								<div class="col-sm-4"><img style="margin:auto;max-width:100%" src="view/stylesheet/digitcart_load_products_assest/digitcart_load_products.png"></div>
							</div>
						</div>
					</div><!-- /.dc-effects -->
				</div>
				<div id="tab-theme" class="tab-pane">
					<p class="alert alert-info"><?php echo $text_theme_note; ?></p>
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_selector; ?></label>
						<div class="col-sm-10">
							<input name="digitcart_load_products_selector" value="<?php echo $digitcart_load_products_selector; ?>" class="form-control" id="digitcart_load_products_selector" type="text" placeholder="<?php echo $entry_selector_default; ?>"/>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_pagination_row; ?></label>
						<div class="col-sm-10">
							<input name="digitcart_load_products_pagination_row" value="<?php echo $digitcart_load_products_pagination_row; ?>" class="form-control" id="digitcart_load_products_pagination_row" type="text" placeholder="<?php echo $entry_pagination_row_default; ?>"/>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_wrap_status; ?></label>
						<div class="col-sm-10">
							<input data-toggle-fade=".dc-wrap" name="digitcart_load_products_wrap_status" value="1" class="tgl tgl-light" id="digitcart_load_products_wrap_status" type="checkbox" <?php if($digitcart_load_products_wrap_status){ ?>checked="checked"<?php } ?>/>
							<label class="tgl-btn" for="digitcart_load_products_wrap_status"></label>
						</div>
					</div>
					<div class="form-group dc-wrap">
						<label class="col-sm-2"><?php echo $entry_wrap_count; ?></label>
						<div class="col-sm-10">
							<input name="digitcart_load_products_wrap_count" value="<?php echo $digitcart_load_products_wrap_count; ?>" class="form-control" id="digitcart_load_products_wrap_count" type="number"/>
						</div>
					</div>
					<div class="form-group dc-wrap">
						<label class="col-sm-2"><?php echo $entry_wrapper_class; ?></label>
						<div class="col-sm-10">
							<input name="digitcart_load_products_wrapper_class" value="<?php echo $digitcart_load_products_wrapper_class; ?>" class="form-control" id="digitcart_load_products_wrapper_class" type="text"/>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2"><?php echo $entry_custom_js; ?></label>
						<div class="col-sm-10">
							<textarea name="digitcart_load_products_custom_js" class="form-control" id="digitcart_load_products_custom_js"><?php echo $digitcart_load_products_custom_js; ?></textarea>
						</div>
					</div>
				</div>
			</div><!-- /.tab-content -->
        </form>
      </div>
    </div>
  </div>
</div>
<style>
	.nav-tabs { border-bottom: 2px solid #DDD; }
	.nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover { border-width: 0; }
	.nav-tabs > li > a { border: none; color: #666; }
	.nav-tabs > li.active > a, .nav-tabs > li > a:hover { border: none; color: #4285F4 !important; background: transparent; }
	.nav-tabs > li > a::after { content: ""; background: #4285F4; height: 2px; position: absolute; width: 100%; left: 0px; bottom: -1px; transition: all 250ms ease 0s; transform: scale(0); }
	.nav-tabs > li.active > a::after, .nav-tabs > li:hover > a::after { transform: scale(1); }
	.tab-nav > li > a::after { background: #21527d none repeat scroll 0% 0%; color: #fff; }
	body{ background: #EDECEC;}
	.nav-tabs li a:focus {outline: none;}
	.tgl {
	display: none;
	}
	.tgl, .tgl:after, .tgl:before, .tgl *, .tgl *:after, .tgl *:before, .tgl + .tgl-btn {
	box-sizing: border-box;
	}
	.tgl::-moz-selection, .tgl:after::-moz-selection, .tgl:before::-moz-selection, .tgl *::-moz-selection, .tgl *:after::-moz-selection, .tgl *:before::-moz-selection, .tgl + .tgl-btn::-moz-selection {
	background: none;
	}
	.tgl::selection, .tgl:after::selection, .tgl:before::selection, .tgl *::selection, .tgl *:after::selection, .tgl *:before::selection, .tgl + .tgl-btn::selection {
	background: none;
	}
	.tgl + .tgl-btn {
	outline: 0;
	display: block;
	width: 4em;
	height: 2em;
	position: relative;
	cursor: pointer;
	-webkit-user-select: none;
	 -moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	}
	.tgl + .tgl-btn:after, .tgl + .tgl-btn:before {
	position: relative;
	display: block;
	content: "";
	width: 50%;
	height: 100%;
	}
	.tgl + .tgl-btn:after {
	left: 0;
	}
	.tgl + .tgl-btn:before {
	display: none;
	}
	.tgl:checked + .tgl-btn:after {
	left: 50%;
	}
	.tgl-light + .tgl-btn {
	background: #f0f0f0;
	border-radius: 2em;
	padding: 2px;
	-webkit-transition: all .4s ease;
	transition: all .4s ease;
	}
	.tgl-light + .tgl-btn:after {
	border-radius: 50%;
	background: #fff;
	-webkit-transition: all .2s ease;
	transition: all .2s ease;
	}
	.tgl-light:checked + .tgl-btn {
	background: #9FD6AE;
	}
#all-effects span {
  background-color: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  display: inline-block;
  margin: 2px;
  padding: 3px 10px;
  vertical-align: top;
}
#all-effects > div {
  border-bottom: 1px solid #000;
  padding: 2px 0;
}
#all-effects span label {
    margin: 0;
}
#all-effects strong {
  background-color: #f0f0f0;
  border-radius: 4px;
  display: inline-block;
  line-height: 30px;
  min-width: 116px;
  padding: 0 5px;
  vertical-align: middle;
}
#all-effects span > div, #all-effects span > label {
  display: inline-block;
  vertical-align: middle;
}
.dc-fade {
  opacity: 0.3;
}
</style>
<script type="text/javascript">
	$('.summernote').summernote({height: 300});
	$('body').on('click', '#apply', function(){
		$.ajax({
			type: 'post',
			url: $('form').attr('action') + '&save',
			data: $('form').serialize(),
			beforeSend: function() {
				$('form').fadeTo('slow', 0.3);
				$('#apply').button('loading');
				$('#dc-admin-notification').remove();
			},
			complete: function() {
				$('form').fadeTo('slow', 1);
				$('#apply').button('reset');
			},
			success: function(response) {
				$('body').append('<p id="dc-admin-notification" class="alert alert-success" style="position: fixed; z-index: 999; bottom: 0px; right: 0px; left: 0px; margin: auto; display: inline-block; width: 200px; text-align: center;"><?php echo $text_saved; ?></p>');
				setTimeout(function(){
					$('#dc-admin-notification').fadeOut();
				}, 2000);
			}
		});
	});
	$('#loading-nav-tabs a:first').tab('show');
	$('#finished-nav-tabs a:first').tab('show');
	$('#more-nav-tabs a:first').tab('show');
	if (typeof(Storage) !== "undefined") {
		$('#main-nav-tabs a').on('click', function(){
			localStorage.setItem("digitcart-load-products-active-tab-main-nav-tabs", $(this).attr('href'));
		});
		if(localStorage.getItem("digitcart-load-products-active-tab-main-nav-tabs")){
			$('#main-nav-tabs a[href="' + localStorage.getItem("digitcart-load-products-active-tab-main-nav-tabs") + '"]').trigger('click');
		}
		$('#loading-nav-tabs a').on('click', function(){
			localStorage.setItem("digitcart-load-products-active-tab-loading-nav-tabs", $(this).attr('href'));
		});
		if(localStorage.getItem("digitcart-load-products-active-tab-loading-nav-tabs")){
			$('#loading-nav-tabs a[href="' + localStorage.getItem("digitcart-load-products-active-tab-loading-nav-tabs") + '"]').trigger('click');
		}
		$('#finished-nav-tabs a').on('click', function(){
			localStorage.setItem("digitcart-load-products-active-tab-finished-nav-tabs", $(this).attr('href'));
		});
		if(localStorage.getItem("digitcart-load-products-active-tab-finished-nav-tabs")){
			$('#finished-nav-tabs a[href="' + localStorage.getItem("digitcart-load-products-active-tab-finished-nav-tabs") + '"]').trigger('click');
		}
		$('#more-nav-tabs a').on('click', function(){
			localStorage.setItem("digitcart-load-products-active-tab-more-nav-tabs", $(this).attr('href'));
		});
		if(localStorage.getItem("digitcart-load-products-active-tab-more-nav-tabs")){
			$('#more-nav-tabs a[href="' + localStorage.getItem("digitcart-load-products-active-tab-more-nav-tabs") + '"]').trigger('click');
		}
	}
	function previewEffect(effect){
		addDelay();
		$('#digitcart-load-products-preview img').removeAttr('class');
		setTimeout(function(){
			$('#digitcart-load-products-preview img').attr('class', 'animated ' + effect);
		}, 100);
	}
	function addDelay(){
		if($('[name="digitcart_load_products_animation_delay"]').val()){
			var delay = $('[name="digitcart_load_products_animation_delay"]').val();
			for(i = 0; i < 3; i++){
				$('#digitcart-load-products-preview div:nth-child('+ (i + 1) +') img').css({
					animationDelay: i * delay + 'ms'
				});
			}
		}
	}
	var lastSelectedEffect = 'fadeIn';
	addDelay();
	$('[name="digitcart_load_products_effects[]"]').on('change', function(){
		if($(this).is(':checked')){
			lastSelectedEffect = $(this).val();
			$('#digitcart-load-products-preview img').attr('class', 'animated ' + $(this).val());
		} else {
			$('#digitcart-load-products-preview img').removeAttr('class');
		}
	});
	$('[data-toggle-fade]').change(function(){
		if($(this).is(':checked')){
			$($(this).attr('data-toggle-fade')).removeClass('dc-fade');
		} else {
			$($(this).attr('data-toggle-fade')).addClass('dc-fade');
		}
	});
	$('[data-toggle-fade]').trigger('change');
</script>
<?php echo $footer; ?>