<?php echo $header; ?>





<?php 
	if(empty($tg_themeglobal_pro_background_color)) $tg_themeglobal_pro_background_color ="45484B";
?>
<style type="text/css">
	.customhelp { color: #666; font-size:0.9em; }
	.color { border:1px solid #AAA; }
	.pttrn {width:32px; display: inline-block; text-align: center;}
</style>

<div id="content">
	<div class="breadcrumb">
		<?php foreach ($breadcrumbs as $breadcrumb) { ?>
		<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
		<?php } ?>
	</div>
	<?php if ($error_warning) { ?>
	<div class="warning"><?php echo $error_warning; ?></div>
	<?php } ?>

<div class="box">

	<div class="heading">
		<h1><img src="view/image/module.png" alt="" /> <?php echo $heading_title; ?></h1>
		<div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><?php echo $button_cancel; ?></a></div>
	</div>

	<div class="content">

	<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">

		<div style="margin-bottom: 10px">
			<label><?php echo $entry_status; ?></label>
			<select name="tg_themeglobal_pro_status">
				<?php if ($tg_themeglobal_pro_status) { ?>
				<option value="1" selected="selected"><?php echo $text_enabled; ?></option>
				<option value="0"><?php echo $text_disabled; ?></option>
				<?php } else { ?>
				<option value="1"><?php echo $text_enabled; ?></option>
				<option value="0" selected="selected"><?php echo $text_disabled; ?></option>
				<?php } ?>
			</select>
		</div>

		<div id="settings_tabs" class="htabs clearfix">
			<a href="#layout_settings"><?php echo $entry_tab_layout; ?></a>
		</div>

		<div id="layout_settings" class="divtab">

			<table class="form">

				<tr>
					<td colspan="2">
						<h3><?php echo $entry_pattern_sub; ?></h3>
					</td>
				</tr>
				
				<tr>
					<td><?php echo $entry_background_color; ?></td>
					<td><input type="text" name="tg_themeglobal_pro_background_color" value="<?php echo $tg_themeglobal_pro_background_color; ?>" size="6" class="color {required:false,hash:true}"  /></td>
				</tr>

				<tr>
					<td><?php echo $entry_pattern_overlay; ?></td>
					<td>
						<div>
							<?php for ($i = 1; $i <= 36; $i++) { ?>
								<div class="pttrn"><span class="customhelp"><?php echo $i; ?></span><img src="view/image/patterns/<?php echo $i; ?>.png" alt="pattern <?php echo $i; ?>"></div>
								<?php if(!($i%12)): ?>
									<br />
								<?php endif ?>
							<?php } ?>
						</div> <br />
						<select name="tg_themeglobal_pro_pattern_overlay">
							<option value="none"selected="selected">none</option>
							<?php for ($i = 1; $i <= 36; $i++) { 
									($this->config->get('tg_themeglobal_pro_pattern_overlay')== $i) ? $currentpat = 'selected' : $currentpat = '';
								?>
								<option value="<?php echo $i; ?>" <?php echo $currentpat; ?>><?php echo $i; ?></option>'; 
								<?php } ?>
						</select>
						<span class="customhelp"><?php echo $entry_pattern_overlay_help; ?></span>
					</td>
				</tr>
				
				<tr>
					<td><?php echo $entry_custom_pattern; ?></td>
					<td>
						<input type="hidden" name="tg_themeglobal_pro_custom_pattern" value="<?php echo $tg_themeglobal_pro_custom_pattern; ?>" id="tg_themeglobal_pro_custom_pattern" />
						<img src="<?php echo $tg_themeglobal_pro_pattern_preview; ?>" id="tg_themeglobal_pro_pattern_preview" />
						<br /><a onclick="image_upload('tg_themeglobal_pro_custom_pattern', 'tg_themeglobal_pro_pattern_preview');"><?php echo $text_select; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#tg_themeglobal_pro_pattern_preview').attr('src', '<?php echo $no_image; ?>'); $('#tg_themeglobal_pro_custom_pattern').attr('value', '');"><?php echo $text_clear; ?></a>
					</td>
				</tr>

				<tr>
					<td>
						<?php echo $entry_custom_image; ?> <br />
						<span class="customhelp"><?php echo $entry_custom_image_help; ?></span>
					</td>
					<td>
						<input type="hidden" name="tg_themeglobal_pro_custom_image" value="<?php echo $tg_themeglobal_pro_custom_image; ?>" id="tg_themeglobal_pro_custom_image" />
						<img src="<?php echo $tg_themeglobal_pro_image_preview; ?>" alt="" id="tg_themeglobal_pro_image_preview" />
						<br /><a onclick="image_upload('tg_themeglobal_pro_custom_image', 'tg_themeglobal_pro_image_preview');"><?php echo $text_select; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#tg_themeglobal_pro_image_preview').attr('src', '<?php echo $no_image; ?>'); $('#tg_themeglobal_pro_custom_image').attr('value', '');"><?php echo $text_clear; ?></a>
					</td>
				</tr>

				<tr>
					<td><?php echo $entry_display_shadows; ?></td>
					<td>
						<input type="checkbox" name="tg_themeglobal_pro_display_shadows"<?php if ($tg_themeglobal_pro_display_shadows) echo 'checked="checked"';?>>
						<?php echo $entry_display_shadows_help; ?>
					</td>
				</tr>

			</table>
			
		</div>

		</form>

	</div>

</div>


<script type="text/javascript">

	$('#settings_tabs a').tabs();
	$('#functions_tabs a').tabs();
	$('#footer_settings_tabs a').tabs();

</script>

<script type="text/javascript" src="view/javascript/jscolor/jscolor.js"></script> 

<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script>

<script type="text/javascript">
	CKEDITOR.replace('tg_themeglobal_pro_footer_info_text', {
		filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
		filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
		filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
		filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
		filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'
	});  

	CKEDITOR.replace('tg_themeglobal_pro_copyright', {
		filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
		filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
		filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
		filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
		filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'
	});  
</script>

<script type="text/javascript"><!--

$(document).ready(function() {

	$('	#tg_themeglobal_pro_background_color').ColorPicker({
		onSubmit: function(hsb, hex, rgb, el) {
			$(el).val(hex);
			$(el).ColorPickerHide();
		},
		onBeforeShow: function () {
			$(this).ColorPickerSetColor(this.value);
		}
	})
	.bind('keyup', function(){
		$(this).ColorPickerSetColor(this.value);
	});

});

//--></script>

<script type="text/javascript"><!--
function image_upload(field, preview) {
	$('#dialog').remove();
	
	$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
	
	$('#dialog').dialog({
		title: '<?php echo $text_image_manager; ?>',
		close: function (event, ui) {
			if ($('#' + field).attr('value')) {
				$.ajax({
					url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).val()),
					dataType: 'text',
					success: function(data) {
						$('#' + preview).replaceWith('<img src="' + data + '" alt="" id="' + preview + '" />');
					}
				});
			}
		},	
		bgiframe: false,
		width: 700,
		height: 400,
		resizable: false,
		modal: false
	});
};
//--></script> 