<!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>
		<title>[%$ESPCMS_SOFT_TITLE%]</title>
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_public.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_all.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_framework.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_select.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/pageload.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/file.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery-ui.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.cookie.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/md5.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/json.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/bootstrap.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/lngpack_cn.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_form.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_function.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tool.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_page.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_batch.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tab.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/nprogress.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/iframeResizer.contentWindow.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_multiple.js"></script>
		<link href="[%ESPCMS_ADMIN_URL%]js/codemirror/lib/codemirror.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/codemirror/lib/codemirror.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/codemirror/mode/groovy/groovy.js"></script>
		<link rel="stylesheet" href="[%ESPCMS_ADMIN_URL%]js/codemirror/theme/lucario.css"/>
		<script type="text/javascript">
			$(document).ready(function () {
				banpageKey();
				$("[placeholder]").tooltip();
				$('input[type=checkbox],input[type=radio]').espcms_checkbox();
				$("#espcms_saveInfo").espcms_formvalidation({focusName: "#filename", verifyURL: "[%$link.verify%]", verifyField: "filename", verifyQueryString: "open_path=[%$read.open_path%]&open_type=[%$read.open_type%]&open_file=[%$read.open_file%]"});
				$('#espcms_saveInfo').ajaxForm({
					type: 'POST',
					url: '[%$link.save%]',
					dataType: 'json',
					beforeSubmit: function () {
						parent.espcms_are_loading();
					},
					success: function (data) {
						parent.$("#espcms_are_loading").dialog("close");

						parent.$("body").append(data.data);
						if (data.code === 'true') {
							parent.$.espcms_sticky(data.message, {'autoclose': 3000});
							parent.frames['[%$par_iframes_name%]'].refresh('ajax_list');
							parent.$(this).espcms_window_tab('close', {'iframeName': '[%$iframes_name%]'});
						} else {
							var botton = [
								{
									text: "[%pack:botton_pack-espcms_botton_colse%]",
									class: "btn btn-lightgray",
									click: function () {
										parent.$(this).dialog("close");
										parent.$(this).espcms_window_tab('close', {'iframeName': '[%$iframes_name%]'});
									}
								}
							];
							parent.espcms_public_dialog(data.domid_name, botton, 600);
						}
						$(window).unbind('beforeunload');
					}
				});
				$('.espcms_save_cancel').espcms_window_tab('closeTab');
			});
		</script>
	</head>
	<body class="espcms_style_all">
		<div class="main">
			<div class="espcms_center_content_list">
				<div class="panel">
					<div class="panel-body form_bottom_page">
						<form class="form-horizontal admin-form" id="espcms_saveInfo" action="[%$link.save%]">
							<input type="hidden" name="token_key" id="token_key" value="[%$token.token_key%]"/>
							<input type="hidden" name="token_name" id="token_name" value="[%$token.token_name%]"/>
							<input type="hidden" name="open_path" id="open_path" value="[%$read.open_path%]"/>
							<input type="hidden" name="open_type" id="open_type" value="[%$read.open_type%]"/>
							<input type="hidden" name="open_file" id="open_file" value="[%$read.open_file%]"/>
							[%if $type=='edit'%]
							<input type="hidden" name="savetype" value="edit"/>
							<div class="section-divider mb40"><span>[%pack:templates_pack-espcms_templates_file_button_edit%]</span></div>
							[%/if%]
							[%if $type=='copy'%]
							<input type="hidden" name="savetype" value="copy"/>
							<div class="section-divider mb40"><span>[%pack:templates_pack-espcms_templates_file_button_copy%]</span></div>
							[%/if%]
							[%if $type=='edit'%]
							<div class="form-group">
								<label class="col-sm-2 control-label">[%pack:templates_pack-espcms_templates_file_filename%]</label>
								<div class="col-sm-9 pt7">[%$read.open_name%]</div>
							</div>
							[%/if%]
							[%if $type=='copy'%]
							<div class="form-group">
								<label class="col-sm-2 control-label">[%pack:templates_pack-espcms_templates_file_filename_old%]</label>
								<div class="col-sm-9 pt7">[%$read.open_name%]</div>
							</div>
							<div class="form-group addtype1">
								<label class="col-sm-2 control-label">[%pack:templates_pack-espcms_templates_file_filename%]</label>
								<div class="col-sm-9">
									<input type="text" name="filename" class="form-control" id="filename" maxlength="50" data-validation="^[\w]{2,50}$" placeholder="[%pack:templates_pack-espcms_templates_file_filename_title%]" title="[%pack:templates_pack-espcms_templates_file_filename_title%]" data-validation-msg="[%pack:templates_pack-espcms_templates_file_filename_validation_msg%]" validation-warning="[%pack:templates_pack-espcms_templates_file_filename_warning_msg%]"/>
								</div>
							</div>
							[%/if%]
							<div class="form-group">
								<label class="col-sm-2 control-label">[%pack:templates_pack-espcms_templates_file_content%]</label>
								<div class="col-sm-9 pt10">
									<textarea class="form-control" style="width:100%;height:760px" name="content" id="content" placeholder="[%pack:templates_pack-espcms_templates_file_content_title%]" title="[%pack:templates_pack-espcms_templates_file_content_title%]">[%$read.content%]</textarea>
								</div>
							</div>
							[%if $type=='edit'%]
							<div class="form_button">
								<button type="submit" class="btn btn-green min-w-150" formmethod="POST">[%pack:botton_pack-espcms_botton_save_ok%]</button>
								<button type="button" class="btn btn-lightgray min-w-150 espcms_save_cancel">[%pack:botton_pack-espcms_botton_save_cancel_edit%]</button>
							</div>
							[%/if%]
							[%if $type=='copy'%]
							<div class="form_button">
								<button type="submit" class="btn btn-green min-w-150" formmethod="POST">[%pack:botton_pack-espcms_botton_save_ok_copy%]</button>
								<button type="button" class="btn btn-lightgray min-w-150 espcms_save_cancel">[%pack:botton_pack-espcms_botton_save_cancel_copy%]</button>
							</div>
							[%/if%]
						</form>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			var editor = CodeMirror.fromTextArea(document.getElementById("content"), {

				lineNumbers: true,

				lineWrapping: false,
				indentUnit: 4,
				theme: "lucario",
				foldGutter: true
			});

			editor.setSize('100%', '650px');
		</script>
		[%link file="public/load.html"%]
		[%link file="public/load_height.html"%]
	</body>
</html>
