use strict;return sub{my $this = shift;my $C = $this->{C};$this->out("<!-- <goth:include tmpl=\"/headfoot/inc_tinymce.html\"> -->\n\n<script language=\"JavaScript\">\n	\$(document).ready(function() {\n        \$(\'.summernote\').summernote({height: 150,});\n    });\n\nfunction loadTemplate()\n{\n	if (document.forms[\'Editor\'].template_parent.value)\n	{\n		if (confirm(\"Are you sure you want to load that template into the edit area?\\nThe current data in the edit area will be lost\"))\n		{\n			atkGoActionEditor(\'loadsel\');\n		}\n	}\n	else\n	{\n		alert(\'Please select a template\');\n	}\n}\n\nfunction switchTemplate(tmpl_type)\n{\n	var f = document.forms[\'Editor\'];\n	f.ObjectID.value = \'\';\n	f.TabCustom3.value = tmpl_type;\n	atkGoActionEditor(\'edit\');\n}\n\n</script>\n\n<div class=\"jinHeader\">\n");if ( $C->{Object}{group_title} ) {$this->out("		$C->{Object}{group_title}\n");} else {$this->out("		$C->{TemplatesGroupTitle}: adding new template\n");}$this->out("</div>\n\n");if ( @{$C->{TemplatesGroup}} > 1 ) {$this->out("s\n<div>\n");my $in = $C->{TemplatesGroup};my $loop = ref($in) eq "ARRAY" ? $in : ref($in) eq "CODE" ? &{$in} : [];$C->{ITERATION}{t} = -1;for my $f (@$loop) {$C->{ITERATION}{t}++;$C->{t} = $f;$this->out("");if ( $C->{t}{name} eq $C->{Object}{tmpl_type} ) {$this->out("			<a style=\"font-weight:bold\">$C->{t}{title}</a>\n");} else {$this->out("			<a class=\"jinTableLink\" href=\"#\" onClick=\"switchTemplate(\'$C->{t}{name}\')\">$C->{t}{title}</a>\n");}$this->out("");if ( $C->{t}{title} ne $C->{LastTitle} ) {$this->out("&nbsp;|&nbsp;");}$this->out("");}$this->out("</div>\ns\n");}$this->out("\n");if ( $C->{Form}{errors} ) {$this->out("	<div class=\"card mb-4 py-3 border-left-danger\"><div class=\"card-body\">\n");my $in = $C->{Form}{errors};my $loop = ref($in) eq "ARRAY" ? $in : ref($in) eq "CODE" ? &{$in} : [];$C->{ITERATION}{error} = -1;for my $f (@$loop) {$C->{ITERATION}{error}++;$C->{error} = $f;$this->out("		 $C->{error}{message}\n");}$this->out("	</div></div>\n");} elsif ( $C->{INPUT}{just_saved} ) {$this->out("	<div style=\"color: blue; font-size: 120\%; margin-bottom: 20px\">Your data has been saved</div>\n");} else {$this->out("");}$this->out("\n<form name=Editor method=POST action=\"$C->{SELF_URL_NO_QS}\" enctype=\"multipart/form-data\">\n<input type=\"hidden\" name=\"TabAct\">\n<input type=\"hidden\" name=\"cgi_ret\" value=\"$C->{INPUT}{cgi_ret}\">\n<input type=\"hidden\" name=\"ObjectID\" value=\"$C->{INPUT}{ObjectID}\">\n");my $in = $C->{KeepFields};my $loop = ref($in) eq "ARRAY" ? $in : ref($in) eq "CODE" ? &{$in} : [];$C->{ITERATION}{kf} = -1;for my $f (@$loop) {$C->{ITERATION}{kf}++;$C->{kf} = $f;$this->out("<input type=\"hidden\" name=\"$C->{kf}\" value=\"$C->{INPUT}{$C->{kf}}\">\n");}$this->out("\n$C->{Form}{group_id}\n$C->{Form}{group_type}\n$C->{Form}{tmpl_type}\n$C->{Form}{scope}\n\n<div class=\"card shadow mb-4\">\n	<div class=\"card-header py-3\">\n		<h6 class=\"m-0 font-weight-bold text-primary\">\n			$C->{View}{TmplTypeTitle}\n		</h6>\n	</div>\n	<div class=\"card-body\">\n\n		<div class=\"btn-group mb-4\">\n			<button type=\"button\" class=\"btn btn-primary\" onclick=\"atkGoActionEditor(\'save\')\">Save</button>\n			<button type=\"button\" class=\"btn btn-primary dropdown-toggle dropdown-toggle-split\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n				<span class=\"sr-only\">Toggle Dropdown</span>\n			</button>\n			<div class=\"dropdown-menu\">\n");{my $G = (ref $this)->get("$C->{TabActCfg}{template_controls}", $this->{param}) or die "no skel $C->{TabActCfg}{template_controls}";my $ctx = $this->{C};my $out = $G->execute($ctx);$this->out(@$out) if $out;}$this->out("			</div>\n		</div>\n\n");if ( $C->{INPUT}{TabCustom1} eq 'global' || $C->{Object}{scope} eq 'global' ) {$this->out("<div class=\"form-group row\">\n	<label class=\"col-sm-12 col-md-4 col-form-label\">Template title</label>\n	<div class=\"col-sm-12 col-md-8\">$C->{Form}{group_title}</div>\n</div>\n");}$this->out("<div class=\"form-group row\">\n	<label class=\"col-sm-12 col-md-4 col-form-label\">HTML header</label>\n	<div class=\"col-sm-12 col-md-8\">$C->{Form}{html_head}</div>\n</div>\n<div class=\"form-group row\">\n	<label class=\"col-sm-12 col-md-4 col-form-label\">BODY tag attributes</label>\n	<div class=\"col-sm-12 col-md-8\">$C->{Form}{body_attr}</div>\n</div>\n<div class=\"form-group row\">\n	<label class=\"col-sm-12 col-md-4 col-form-label\">Delavo &trade; tags</label>\n	<div class=\"col-sm-12 col-md-8\">$C->{Form}{tags_help}</div>\n</div>\n\n<div class=\"form-group\">\n	<label>Template</label>\n	$C->{Form}{template}\n</div>\n<div class=\"form-group row\">\n	<label class=\"col-sm-12 col-md-4 col-form-label\">Load another template into the edit area</label>\n	<div class=\"col-4\">\n		$C->{Form}{template_parent}\n		<input type=\"button\" class=\"btn btn-primary\" value=\"Load\" onClick=\"loadTemplate();\">\n	</div>\n</div>\n\n</div></div>\n\n</form>\n");}