__section__
default
__description__
the form that edits the templates. 
If you break this form, you'll have to use the template-tool to fix it

template editor

* templatedelete_flag = whether to display the template delete form or not
* tpid = template ID
* templateref = hash ref containing template specifics
* section_select = form select containing sections
* page_select = form select contain pages
* template_select = form select containing templates
* templateform_flag = display template form or not
* templateedit_flag = editing a template or not
* savepage_select = form select containing pages, this is used to determine page of template
* savesection_select = form select containing sections, used to determine section

__title__
template editor template
__page__
admin
__lang__
en_US
__name__
templateEdit
__template__
[% PROCESS titlebar width='100%' %]

<FORM ACTION="[% env.script_name %]" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="op" VALUE="templates">

[% IF templatedelete_flag && seclev_flag %]

<INPUT TYPE="HIDDEN" NAME="deletetpid" VALUE="[% tpid %]">
<INPUT TYPE="HIDDEN" NAME="deletename" VALUE="[% templateref.name %]">
<TABLE BORDER="0">
	<TR>
		<TD><B>Do you really want to delete Template [% templateref.name %], tpid [% tpid %]?</B></TD>
		<TD><INPUT TYPE="SUBMIT" VALUE="Cancel Delete of [% templateref.name %], tpid [% tpid %]" NAME="templatedelete_cancel"></TD>
		<TD><INPUT TYPE="SUBMIT" VALUE="Really Delete [% templateref.name %], tpid [% tpid %]!" NAME="templatedelete_confirm"></TD>
	</TR>
</TABLE>

[% ELSE %]

<P>Select a template to edit.
</P>
<TABLE>
	<TR>
		<TD><B>Section</B></TD>
		<TD>[% section_select %]</TD>
		<TD><INPUT TYPE="SUBMIT" VALUE="Select section" NAME="templatesection">
		</TD>
	</TR>
	<TR>
		<TD><B>Page</B></TD>
		<TD>[% page_select %]</TD>
		<TD><INPUT TYPE="SUBMIT" VALUE="Select page" NAME="templatepage"></TD>
	</TR>
	<TR>
		<TD><B>Templates</B></TD>
		<TD>[% template_select %]</TD>
		<TD><INPUT TYPE="SUBMIT" VALUE="Edit Template" NAME="templateed"></TD>
		<TD><INPUT TYPE="SUBMIT" VALUE="Delete Template" NAME="templatedelete"></TD>
	</TR>
[% IF ! form.templatenew %]
	<TR>
		<td><b>Create a new template:</b></td>
		<TD>
		<INPUT TYPE="SUBMIT" VALUE="Create a new template" NAME="templatenew"></P>
		</TD>
	</TR>
[% END %]
</TABLE>
[% END %]

[% IF templateform_flag && seclev_flag %]
<TABLE BORDER="0">
	[% IF templateref.description %]
	<TR>
		<TD COLSPAN="3">
		<TABLE BORDER="2" CELLPADDING="4" CELLSPACING="0" BGCOLOR="[% user.fg.1 %]" WIDTH="80%">
			<TR>
				<TD BGCOLOR="[% user.bg.2 %]"><BR><B>Template ID: [% tpid %],
					[% templateref.name %], [% templateref.page %], [% templateref.section %]</B><BR>
				<P>[% FILTER strip_extrans %][% templateref.description %][% END %]</P><BR>
				</TD>
			</TR>
		</TABLE>
		<BR>
		</TD>
	</TR>
	[% END %]

	[% IF templateedit_flag %]
	<TR>
		<TD><b>Save template in section: </b></td>
		<td>[% savesection_select %]</TD>
	</TR>
	[% END %]	

	<tr>
		<td><B>Template section </b> ( new template section? <input type="checkbox" name="newS"> )</td>
		<TD><INPUT TYPE="TEXT" NAME="newsection" VALUE="[% form.section %]"></TD>
	</tr>
	
	[% IF templateedit_flag %]
	<tr>	
		<TD><b>Save template in page: </b></td>
		<td>[% savepage_select %]</td>
	</tr>
	[% END %]
	
	<tr>
		<td><b>Template page </b> (new template page? <input type="checkbox" name="newP"> )</td>
		<TD><INPUT TYPE="TEXT" NAME="newpage" VALUE="[% form.page %]"></TD>
	</tr>

	<TR>
		<TD><B>Template Name</B></TD>
		<TD><INPUT TYPE="TEXT" NAME="name" VALUE="[% templateref.name %]"><INPUT TYPE="HIDDEN" NAME="thistpid" VALUE="[% tpid %]"></TD>
	</TR>
	<TR>
		<TD><B>Title</B></TD>
		<TD COLSPAN="2"><INPUT TYPE="TEXT" SIZE="70" NAME="title" VALUE="[% FILTER strip_attribute %][% templateref.title %][% END %]"></TD>
	</TR>
	<TR>
		<TD><B>Seclev</B></TD><TD><INPUT TYPE="TEXT" NAME="seclev" VALUE="[% templateref.seclev %]" SIZE="6"></TD>
	</TR>

	[% IF templateedit_flag %]
		<INPUT TYPE="HIDDEN" NAME="save_existing" VALUE="1">
	[% ELSE %]
		<INPUT TYPE="HIDDEN" NAME="save_new" VALUE="1">
	[% END %]

	<TR>
		<TD VALIGN="TOP"><B>Description</B></TD>
		<TD ALIGN="left" COLSPAN="2">
		<TEXTAREA ROWS="6" COLS="70" NAME="description">[% templateref.description | strip_literal %]</TEXTAREA>
		</TD>
	</TR>
	<TR>
		<TD VALIGN="TOP"><B>Template</B><BR>
		<P>
			<INPUT TYPE="SUBMIT" VALUE="Save Template" NAME="templatesave"><BR>
		</P>
		</TD>
		<TD ALIGN="left" COLSPAN="2">

		<TEXTAREA ROWS="15" COLS="100" NAME="template">[% templateref.template | strip_literal %]</TEXTAREA>
		</TD>
	</TR>
[% ELSIF seclev_flag == 0 %]
You don't have privileges to edit the template [% templateref.name %], TPID [% templateref.tpid %].
[% END %]

[% IF form.templatedelete_cancel %]
	<TR>
		<TD COLSPAN="3">
		<INPUT TYPE="SUBMIT" VALUE="Delete template" NAME="templatedelete"></P>
		</TD>
	</TR>
[% END %]

[% IF ! form.templatenew && templateform_flag %]
	<TR>
		<td><b>Create a new template:</b></td>
		<TD>
		<INPUT TYPE="SUBMIT" VALUE="Create a new template" NAME="templatenew"></P>
		</TD>
	</TR>
[% END %]


</TABLE>
</FORM>
<B>

__seclev__
500
