<commit_before>{* $Id$ *}
{extends 'layout_edit.tpl'}

{block name=title}
{if $translation_mode eq 'n'}
	{title url="tiki-editpage.php?page=$page"}{if isset($hdr) && $prefs.wiki_edit_section eq 'y'}{tr}Edit Section:{/tr}{else}{tr}Edit:{/tr}{/if} {$page}{if $pageAlias ne ''} ({$pageAlias}){/if}{/title}
{else}
   {title}{tr}Update '{$page}'{/tr}{/title}
{/if}
{/block}

{block name=content}
{if $page|lower neq 'sandbox' and $prefs.feature_contribution eq 'y' and $prefs.feature_contribution_mandatory eq 'y'}
	{remarksbox type='tip' title="{tr}Tip{/tr}"}
		<strong class='mandatory_note'>{tr}Fields marked with a * are mandatory.{/tr}</strong>
	{/remarksbox}
{/if}
{if isset($customTip)}
	{remarksbox type='tip' title=$customTipTitle}
	{tr}{$customTip|escape}{/tr}
	{/remarksbox}
{/if}
{if isset($wikiHeaderTpl)}
	{include file="wiki:$wikiHeaderTpl"}
{/if}
	
{if $prefs.ajax_autosave eq "y"}
<div class="floatright">
	{self_link _icon="magnifier" _class="previewBtn" _ajax="n"}{tr}Preview your changes.{/tr}{/self_link}
</div>
{jq} $(".previewBtn").click(function(){
	if ($('#autosave_preview:visible').length === 0) {
		auto_save('editwiki', autoSaveId);
		if (!ajaxPreviewWindow) {
			$('#autosave_preview').slideDown('slow', function(){ ajax_preview( 'editwiki', autoSaveId, true );});
		}
	} else {
		$('#autosave_preview').slideUp('slow');
	}
	return false;
});{/jq}
{/if}
   
{if isset($data.draft)}
	{tr}Draft written on{/tr} {$data.draft.lastModif|tiki_long_time}<br/>
	{if $data.draft.lastModif < $data.lastModif}
		<b>{tr}Warning: new versions of this page have been made after this draft{/tr}</b>
	{/if}
{/if}
{if $page|lower eq 'sandbox'}
	{remarksbox type='tip' title="{tr}Tip{/tr}"}
		{tr}The SandBox is a page where you can practice your editing skills, use the preview feature to preview the appearance of the page, no versions are stored for this page.{/tr}
	{/remarksbox}
{/if}
{if $category_needed eq 'y'}
	{remarksbox type='Warning' title="{tr}Warning{/tr}"}
	<div class="highlight"><em class='mandatory_note'>{tr}A category is mandatory{/tr}</em></div>
	{/remarksbox}
{/if}
{if $contribution_needed eq 'y'}
	{remarksbox type='Warning' title="{tr}Warning{/tr}"}
	<div class="highlight"><em class='mandatory_note'>{tr}A contribution is mandatory{/tr}</em></div>
	{/remarksbox}
{/if}
{if isset($summary_needed) && $summary_needed eq 'y'}
	{remarksbox type='Warning' title="{tr}Warning{/tr}"}
	<div class="highlight"><em class='mandatory_note'>{tr}An edit summary is mandatory{/tr}</em></div>
	{/remarksbox}
{/if}
{if $likepages}
	<div>
		{tr}Perhaps you are looking for:{/tr}
		{if $likepages|@count < 0}
			<ul>
				{section name=back loop=$likepages}
					<li>
						<a href="{$likepages[back]|sefurl}" class="wiki">{$likepages[back]|escape}</a>
					</li>
				{/section}
			</ul>
		{else}
			<table class="table normal"><tr>
				{cycle name=table values=',,,,</tr><tr>' print=false advance=false}
				{section name=back loop=$likepages}
					<td><a href="{$likepages[back]|sefurl}" class="wiki">{$likepages[back]|escape}</a></td>{cycle name=table}
				{/section}
			</tr></table>
		{/if}
	</div>
{/if}

{if $preview or $prefs.ajax_autosave eq "y"}
	{include file='tiki-preview.tpl'}
{/if}
{if isset($diff_style)}
	<div id="diff_outer">
		{if $translation_mode == 'y'}
			<div class="translation_message">
				<h2>{tr}Translate from:{/tr} {$source_page|escape}</h2>
				{tr}Changes that need to be translated are highlighted below.{/tr}
			</div>
		{/if}
		<div id="diff_history">
			{include file='pagehistory.tpl' cant=0}
			{if $diff_summaries}
				<div class="wikitext" id="diff_versions">
					<ul>
						{foreach item=diff from=$diff_summaries}
							<li>
								{tr}Version:{/tr} {$diff.version|escape} - {$diff.comment|escape|default:"<em>{tr}No comment{/tr}</em>"}
								{if count($diff_summaries) gt 1}
									{assign var=diff_version value=$diff.version}
									{icon _id="arrow_right"  onclick="\$('input[name=oldver]').val($diff_version);\$('#editpageform').submit();return false;"  _text="{tr}View{/tr}" style="cursor: pointer"}
								{/if}
							</li>
						{/foreach}
						{button  _onclick="\$('input[name=oldver]').val(1);\$('#editpageform').submit();return false;"  _text="{tr}All Versions{/tr}" _ajax="n"}
					</ul>
				</div>
			{/if}
		</div>
	</div>
{/if}

{if $prompt_for_edit_or_translate == 'y'}
	{include file='tiki-edit-page-include-prompt_for_edit_or_translate.tpl'}
{/if}

<form  enctype="multipart/form-data" method="post" action="tiki-editpage.php?page={$page|escape:'url'}" id='editpageform' name='editpageform'>

	<input type="hidden" name="no_bl" value="y">
	{if !empty($smarty.request.returnto)}<input type="hidden" name="returnto" value="{$smarty.request.returnto}">{/if}
	{if isset($diff_style)}
		<select name="diff_style" class="wikiaction"title="{tr}Edit wiki page{/tr}|{tr}Select the style used to display differences to be translated.{/tr}">
			<option value="htmldiff"{if isset($diff_style) && $diff_style eq "htmldiff"} selected="selected"{/if}>{tr}html{/tr}</option>
			<option value="inlinediff"{if isset($diff_style) && $diff_style eq "inlinediff"} selected="selected"{/if} >{tr}text{/tr}</option>			  
			<option value="inlinediff-full"{if isset($diff_style) && $diff_style eq "inlinediff-full"} selected="selected"{/if} >{tr}text full{/tr}</option>			  
		</select>
		<input type="submit" class="wikiaction tips btn btn-default" title="{tr}Edit wiki page{/tr}|{tr}Change the style used to display differences to be translated.{/tr}" name="preview" value="{tr}Change diff styles{/tr}" onclick="needToConfirm=false;">
	{/if}
	
	{if $page_ref_id}<input type="hidden" name="page_ref_id" value="{$page_ref_id}">{/if}
	{if isset($hdr)}<input type="hidden" name="hdr" value="{$hdr}">{/if}
	{if isset($cell)}<input type="hidden" name="cell" value="{$cell}">{/if}
	{if isset($pos)}<input type="hidden" name="pos" value="{$pos}">{/if}
	{if $current_page_id}<input type="hidden" name="current_page_id" value="{$current_page_id}">{/if}
	{if $add_child}<input type="hidden" name="add_child" value="true">{/if}
	
	{if $preview or $prefs.wiki_actions_bar eq 'top' or $prefs.wiki_actions_bar eq 'both'}
		<div class='top_actions'>
			{include file='wiki_edit_actions.tpl'}
		</div>
	{/if}

	<table class="formcolor" width="100%">
		<tr>
			<td colspan="2">
				{if isset($page_badchars_display)}
					{if $prefs.wiki_badchar_prevent eq 'y'}
						{remarksbox type=errors title="{tr}Invalid page name{/tr}"}
							{tr _0=$page_badchars_display|escape}The page name specified contains unallowed characters. It will not be possible to save the page until those are removed: <strong>%0</strong>{/tr}
						{/remarksbox}
					{else}
						{remarksbox type=tip title="{tr}Tip{/tr}"}
							{tr _0=$page_badchars_display|escape}The page name specified contains characters that may render the page hard to access. You may want to consider removing those: <strong>%0</strong>{/tr}
						{/remarksbox}
					{/if}
						<p>{tr}Page name:{/tr} <input type="text" name="page" value="{$page|escape}">
							<input type="submit" class="btn btn-default" name="rename" value="{tr}Rename{/tr}">
						</p>
				{else}
					<input type="hidden" name="page" value="{$page|escape}"> 
					{* the above hidden field is needed for auto-save to work *}
				{/if}
				{tabset name='tabs_editpage' cookietab=1}
					{tab name="{tr}Edit page{/tr}"}
						{if $translation_mode == 'y'}
							<div class="translation_message">
								<h2>{tr}Translate to:{/tr} {$target_page|escape}</h2>
								{tr}Reproduce the changes highlighted on the left using the editor below{/tr}.
							</div>
						{/if}
						{textarea codemirror='true' syntax='tiki'}{$pagedata}{/textarea}
						{if $prefs.wiki_freetags_edit_position eq 'edit'}
								{if $prefs.feature_freetags eq 'y' and $tiki_p_freetags_tag eq 'y'}
									<fieldset>
										<legend>{tr}Freetags{/tr}</legend>
										<table>
											{include file='freetag.tpl'}
										</table>
									</fieldset>
								{/if}
						{/if}
						{if $page|lower neq 'sandbox'}
							<fieldset>
								<label for="comment">{tr}Describe the change you made:{/tr} {help url='Editing+Wiki+Pages' desc="{tr}Edit comment: Enter some text to describe the changes you are currently making{/tr}"}</label>
								<input style="width:98%;" class="wikiedit" type="text" id="comment" name="comment" value="{$commentdata|escape}">
								{if isset($show_watch) && $show_watch eq 'y'}
									<label for="watch">{tr}Monitor this page:{/tr}</label>
									<input type="checkbox" id="watch" name="watch" value="1"{if $watch_checked eq 'y'} checked="checked"{/if}>
								{/if}
							</fieldset>
							{if $prefs.feature_contribution eq 'y'}
								<fieldset>
									<legend>{tr}Contributions{/tr}</legend>
									<table>
										{include file='contribution.tpl'}
									</table>
								</fieldset>
							{/if}
							{if (!isset($wysiwyg) || $wysiwyg neq 'y') and $prefs.feature_wiki_pictures eq 'y' and $tiki_p_upload_picture eq 'y' and $prefs.feature_filegals_manager neq 'y'}
								<fieldset>
									<legend>{tr}Upload picture:{/tr}</legend>
									<input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
									<input type="hidden" name="hasAlreadyInserted" value="">
									<input type="hidden" name="prefix" value="/img/wiki_up/{if $tikidomain}{$tikidomain}/{/if}">
									<input name="picfile1" type="file" onchange="javascript:insertImgFile('editwiki','picfile1','hasAlreadyInserted','img')">
									<div id="new_img_form"></div>
									<a href="javascript:addImgForm()" onclick="needToConfirm = false;">{tr}Add another image{/tr}</a>
								</fieldset>
							{/if}
				
						{/if}
					{/tab}
					{if $prefs.feature_categories eq 'y' and $tiki_p_modify_object_categories eq 'y' and count($categories) gt 0}
						{tab name="{tr}Categories{/tr}"}
							{if $categIds}
								{remarksbox type="note" title="{tr}Note:{/tr}"}
								<strong>{tr}Categorization has been preset for this edit{/tr}</strong>
								{/remarksbox}
								{section name=o loop=$categIds}
									<input type="hidden" name="cat_categories[]" value="{$categIds[o]}">
								{/section}
								<input type="hidden" name="cat_categorize" value="on">
								
								{if $prefs.feature_wiki_categorize_structure eq 'y'}
									{tr}Categories will be inherited from the structure top page{/tr}
								{/if}
							{else}
								{if $page|lower ne 'sandbox'}
									{include file='categorize.tpl' notable='y'}
								{/if}{* sandbox *}
							{/if}
						{/tab}
					{/if}
					{if $prefs.wiki_freetags_edit_position eq 'freetagstab'}
						{if $prefs.feature_freetags eq 'y' and $tiki_p_freetags_tag eq 'y'}
							{tab name="{tr}Freetags{/tr}"}
								<fieldset>
									<legend>{tr}Freetags{/tr}</legend>
									<table>
										{include file='freetag.tpl'}
									</table>
								</fieldset>
							{/tab}
						{/if}
					{/if}
					{if !empty($showPropertiesTab)}
						{tab name="{tr}Properties{/tr}"}
							{if $prefs.feature_wiki_templates eq 'y' and $tiki_p_use_content_templates eq 'y'}
								<fieldset>
									<legend>{tr}Apply template:{/tr}</legend>
									<select id="templateId" name="templateId" onchange="javascript:document.getElementById('editpageform').submit();" onclick="needToConfirm = false;">
										<option value="0">{tr}none{/tr}</option>
										{section name=ix loop=$templates}
										<option value="{$templates[ix].templateId|escape}" {if $templateId eq $templates[ix].templateId}selected="selected"{/if}>{tr}{$templates[ix].name|escape}{/tr}</option>
										{/section}
									</select>
									{if $tiki_p_edit_content_templates eq 'y'}
										<a style="align=right;" href="tiki-admin_content_templates.php" class="link" onclick="needToConfirm = true;">{tr}Admin Content Templates{/tr}</a>
									{/if}
								</fieldset>
							{/if}
							{if $prefs.feature_wiki_usrlock eq 'y' && ($tiki_p_lock eq 'y' || $tiki_p_admin_wiki eq 'y')}
								<fieldset>
									<legend>{tr}Lock this page{/tr}</legend>
									<input type="checkbox" id="lock_it" name="lock_it" {if $lock_it eq 'y'}checked="checked"{/if}>
								</fieldset>
							{/if}
							{if $prefs.wiki_comments_allow_per_page neq 'n'}
								<fieldset>
									<legend>{tr}Allow comments on this page{/tr}</legend>
									<input type="checkbox" id="comments_enabled" name="comments_enabled" {if $comments_enabled eq 'y'}checked="checked"{/if}>
								</fieldset>
							{/if}
				
							{if $prefs.feature_wiki_allowhtml eq 'y' and $tiki_p_use_HTML eq 'y' and ($wysiwyg neq 'y' or $prefs.wysiwyg_htmltowiki eq 'y')}
								<fieldset>
									<legend>{tr}Allow HTML:{/tr}</legend>
									<input type="checkbox" name="allowhtml" {if $allowhtml eq 'y'}checked="checked"{/if}>
								</fieldset>
								{if $prefs.ajax_autosave eq "y"}{jq}
$("input[name=allowhtml]").change(function() {
	auto_save( "editwiki", autoSaveId );
});
								{/jq}{/if}
							{else}
								<input type="hidden" name="allowhtml" value="{if $allowhtml eq 'y'}on{/if}">
							{/if}
							{if $prefs.feature_wiki_import_html eq 'y'}
								<fieldset>
									<legend>{tr}Import HTML:{/tr}</legend>
									<input class="wikiedit" type="text" id="suck_url" name="suck_url" value="{$suck_url|escape}">&nbsp;
									<input type="submit" class="wikiaction btn btn-default" name="do_suck" value="{tr}Import{/tr}" onclick="needToConfirm=false;">&nbsp;
									<label><input type="checkbox" name="parsehtml" {if $parsehtml eq 'y'}checked="checked"{/if}>&nbsp;
									{tr}Try to convert HTML to wiki{/tr}. </label>
								</fieldset>
							{/if}
							
							{if $tiki_p_export_wiki eq 'y' && $prefs.feature_wiki_import_page eq 'y'}
								<fieldset>
									<legend>{tr}Import page:{/tr}</legend>
									<input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
									<input id="userfile1" name="userfile1" type="file">
                                    <input type="submit" class="wikiaction btn btn-default" name="attach" value="{tr}Import{/tr}" onclick="javascript:needToConfirm=false;insertImgFile('editwiki','userfile2','hasAlreadyInserted2','file', 'page2', 'attach_comment'); return true;">
                                </fieldset>
									{if $prefs.feature_wiki_export eq 'y' and $tiki_p_export_wiki eq 'y'}
                                <fieldset>
									<legend>{tr}Export pages:{/tr}</legend>
									<a href="tiki-export_wiki_pages.php?page={$page|escape:"url"}&amp;all=1" class="link">{tr}export all versions{/tr}</a>
									{/if}									
								</fieldset>
							{/if}
							
							{if !isset($wysiwyg) || $wysiwyg neq 'y'}
								{if $prefs.feature_wiki_attachments == 'y' and ($tiki_p_wiki_attach_files eq 'y' or $tiki_p_wiki_admin_attachments eq 'y')}
									<fieldset>
										<legend>{tr}Upload file:{/tr}</legend>
										<input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
										<input type="hidden" name="hasAlreadyInserted2" value="">
										<input type="hidden" id="page2" name="page2" value="{$page}">
										<input name="userfile2" type="file" id="attach-upload">
										 <label>{tr}Comment:{/tr}<input type="text" name="attach_comment" maxlength="250" id="attach-comment"></label>
										<input type="submit" class="wikiaction btn btn-default" name="attach" value="{tr}Attach{/tr}" onclick="javascript:needToConfirm=false;insertImgFile('editwiki','userfile2','hasAlreadyInserted2','file', 'page2', 'attach_comment'); return true;">
									</fieldset>
								{/if}
	
							{/if}
							{* merged tool and property tabs for tiki 6 *}
							{if $page|lower neq 'sandbox'}
								{if $prefs.wiki_feature_copyrights  eq 'y'}
									<fieldset>
										<legend>{tr}Copyright:{/tr}</legend>
										<table class="formcolor" border="0"><commit_msg>[FIX] editpage: Completely split up import and export fieldsets on the properties tab, ensuring tags are always closed correctly.<commit_after>{* $Id$ *}
{extends 'layout_edit.tpl'}

{block name=title}
{if $translation_mode eq 'n'}
	{title url="tiki-editpage.php?page=$page"}{if isset($hdr) && $prefs.wiki_edit_section eq 'y'}{tr}Edit Section:{/tr}{else}{tr}Edit:{/tr}{/if} {$page}{if $pageAlias ne ''} ({$pageAlias}){/if}{/title}
{else}
   {title}{tr}Update '{$page}'{/tr}{/title}
{/if}
{/block}

{block name=content}
{if $page|lower neq 'sandbox' and $prefs.feature_contribution eq 'y' and $prefs.feature_contribution_mandatory eq 'y'}
	{remarksbox type='tip' title="{tr}Tip{/tr}"}
		<strong class='mandatory_note'>{tr}Fields marked with a * are mandatory.{/tr}</strong>
	{/remarksbox}
{/if}
{if isset($customTip)}
	{remarksbox type='tip' title=$customTipTitle}
	{tr}{$customTip|escape}{/tr}
	{/remarksbox}
{/if}
{if isset($wikiHeaderTpl)}
	{include file="wiki:$wikiHeaderTpl"}
{/if}
	
{if $prefs.ajax_autosave eq "y"}
<div class="floatright">
	{self_link _icon="magnifier" _class="previewBtn" _ajax="n"}{tr}Preview your changes.{/tr}{/self_link}
</div>
{jq} $(".previewBtn").click(function(){
	if ($('#autosave_preview:visible').length === 0) {
		auto_save('editwiki', autoSaveId);
		if (!ajaxPreviewWindow) {
			$('#autosave_preview').slideDown('slow', function(){ ajax_preview( 'editwiki', autoSaveId, true );});
		}
	} else {
		$('#autosave_preview').slideUp('slow');
	}
	return false;
});{/jq}
{/if}
   
{if isset($data.draft)}
	{tr}Draft written on{/tr} {$data.draft.lastModif|tiki_long_time}<br/>
	{if $data.draft.lastModif < $data.lastModif}
		<b>{tr}Warning: new versions of this page have been made after this draft{/tr}</b>
	{/if}
{/if}
{if $page|lower eq 'sandbox'}
	{remarksbox type='tip' title="{tr}Tip{/tr}"}
		{tr}The SandBox is a page where you can practice your editing skills, use the preview feature to preview the appearance of the page, no versions are stored for this page.{/tr}
	{/remarksbox}
{/if}
{if $category_needed eq 'y'}
	{remarksbox type='Warning' title="{tr}Warning{/tr}"}
	<div class="highlight"><em class='mandatory_note'>{tr}A category is mandatory{/tr}</em></div>
	{/remarksbox}
{/if}
{if $contribution_needed eq 'y'}
	{remarksbox type='Warning' title="{tr}Warning{/tr}"}
	<div class="highlight"><em class='mandatory_note'>{tr}A contribution is mandatory{/tr}</em></div>
	{/remarksbox}
{/if}
{if isset($summary_needed) && $summary_needed eq 'y'}
	{remarksbox type='Warning' title="{tr}Warning{/tr}"}
	<div class="highlight"><em class='mandatory_note'>{tr}An edit summary is mandatory{/tr}</em></div>
	{/remarksbox}
{/if}
{if $likepages}
	<div>
		{tr}Perhaps you are looking for:{/tr}
		{if $likepages|@count < 0}
			<ul>
				{section name=back loop=$likepages}
					<li>
						<a href="{$likepages[back]|sefurl}" class="wiki">{$likepages[back]|escape}</a>
					</li>
				{/section}
			</ul>
		{else}
			<table class="table normal"><tr>
				{cycle name=table values=',,,,</tr><tr>' print=false advance=false}
				{section name=back loop=$likepages}
					<td><a href="{$likepages[back]|sefurl}" class="wiki">{$likepages[back]|escape}</a></td>{cycle name=table}
				{/section}
			</tr></table>
		{/if}
	</div>
{/if}

{if $preview or $prefs.ajax_autosave eq "y"}
	{include file='tiki-preview.tpl'}
{/if}
{if isset($diff_style)}
	<div id="diff_outer">
		{if $translation_mode == 'y'}
			<div class="translation_message">
				<h2>{tr}Translate from:{/tr} {$source_page|escape}</h2>
				{tr}Changes that need to be translated are highlighted below.{/tr}
			</div>
		{/if}
		<div id="diff_history">
			{include file='pagehistory.tpl' cant=0}
			{if $diff_summaries}
				<div class="wikitext" id="diff_versions">
					<ul>
						{foreach item=diff from=$diff_summaries}
							<li>
								{tr}Version:{/tr} {$diff.version|escape} - {$diff.comment|escape|default:"<em>{tr}No comment{/tr}</em>"}
								{if count($diff_summaries) gt 1}
									{assign var=diff_version value=$diff.version}
									{icon _id="arrow_right"  onclick="\$('input[name=oldver]').val($diff_version);\$('#editpageform').submit();return false;"  _text="{tr}View{/tr}" style="cursor: pointer"}
								{/if}
							</li>
						{/foreach}
						{button  _onclick="\$('input[name=oldver]').val(1);\$('#editpageform').submit();return false;"  _text="{tr}All Versions{/tr}" _ajax="n"}
					</ul>
				</div>
			{/if}
		</div>
	</div>
{/if}

{if $prompt_for_edit_or_translate == 'y'}
	{include file='tiki-edit-page-include-prompt_for_edit_or_translate.tpl'}
{/if}

<form  enctype="multipart/form-data" method="post" action="tiki-editpage.php?page={$page|escape:'url'}" id='editpageform' name='editpageform'>

	<input type="hidden" name="no_bl" value="y">
	{if !empty($smarty.request.returnto)}<input type="hidden" name="returnto" value="{$smarty.request.returnto}">{/if}
	{if isset($diff_style)}
		<select name="diff_style" class="wikiaction"title="{tr}Edit wiki page{/tr}|{tr}Select the style used to display differences to be translated.{/tr}">
			<option value="htmldiff"{if isset($diff_style) && $diff_style eq "htmldiff"} selected="selected"{/if}>{tr}html{/tr}</option>
			<option value="inlinediff"{if isset($diff_style) && $diff_style eq "inlinediff"} selected="selected"{/if} >{tr}text{/tr}</option>			  
			<option value="inlinediff-full"{if isset($diff_style) && $diff_style eq "inlinediff-full"} selected="selected"{/if} >{tr}text full{/tr}</option>			  
		</select>
		<input type="submit" class="wikiaction tips btn btn-default" title="{tr}Edit wiki page{/tr}|{tr}Change the style used to display differences to be translated.{/tr}" name="preview" value="{tr}Change diff styles{/tr}" onclick="needToConfirm=false;">
	{/if}
	
	{if $page_ref_id}<input type="hidden" name="page_ref_id" value="{$page_ref_id}">{/if}
	{if isset($hdr)}<input type="hidden" name="hdr" value="{$hdr}">{/if}
	{if isset($cell)}<input type="hidden" name="cell" value="{$cell}">{/if}
	{if isset($pos)}<input type="hidden" name="pos" value="{$pos}">{/if}
	{if $current_page_id}<input type="hidden" name="current_page_id" value="{$current_page_id}">{/if}
	{if $add_child}<input type="hidden" name="add_child" value="true">{/if}
	
	{if $preview or $prefs.wiki_actions_bar eq 'top' or $prefs.wiki_actions_bar eq 'both'}
		<div class='top_actions'>
			{include file='wiki_edit_actions.tpl'}
		</div>
	{/if}

	<table class="formcolor" width="100%">
		<tr>
			<td colspan="2">
				{if isset($page_badchars_display)}
					{if $prefs.wiki_badchar_prevent eq 'y'}
						{remarksbox type=errors title="{tr}Invalid page name{/tr}"}
							{tr _0=$page_badchars_display|escape}The page name specified contains unallowed characters. It will not be possible to save the page until those are removed: <strong>%0</strong>{/tr}
						{/remarksbox}
					{else}
						{remarksbox type=tip title="{tr}Tip{/tr}"}
							{tr _0=$page_badchars_display|escape}The page name specified contains characters that may render the page hard to access. You may want to consider removing those: <strong>%0</strong>{/tr}
						{/remarksbox}
					{/if}
						<p>{tr}Page name:{/tr} <input type="text" name="page" value="{$page|escape}">
							<input type="submit" class="btn btn-default" name="rename" value="{tr}Rename{/tr}">
						</p>
				{else}
					<input type="hidden" name="page" value="{$page|escape}"> 
					{* the above hidden field is needed for auto-save to work *}
				{/if}
				{tabset name='tabs_editpage' cookietab=1}
					{tab name="{tr}Edit page{/tr}"}
						{if $translation_mode == 'y'}
							<div class="translation_message">
								<h2>{tr}Translate to:{/tr} {$target_page|escape}</h2>
								{tr}Reproduce the changes highlighted on the left using the editor below{/tr}.
							</div>
						{/if}
						{textarea codemirror='true' syntax='tiki'}{$pagedata}{/textarea}
						{if $prefs.wiki_freetags_edit_position eq 'edit'}
								{if $prefs.feature_freetags eq 'y' and $tiki_p_freetags_tag eq 'y'}
									<fieldset>
										<legend>{tr}Freetags{/tr}</legend>
										<table>
											{include file='freetag.tpl'}
										</table>
									</fieldset>
								{/if}
						{/if}
						{if $page|lower neq 'sandbox'}
							<fieldset>
								<label for="comment">{tr}Describe the change you made:{/tr} {help url='Editing+Wiki+Pages' desc="{tr}Edit comment: Enter some text to describe the changes you are currently making{/tr}"}</label>
								<input style="width:98%;" class="wikiedit" type="text" id="comment" name="comment" value="{$commentdata|escape}">
								{if isset($show_watch) && $show_watch eq 'y'}
									<label for="watch">{tr}Monitor this page:{/tr}</label>
									<input type="checkbox" id="watch" name="watch" value="1"{if $watch_checked eq 'y'} checked="checked"{/if}>
								{/if}
							</fieldset>
							{if $prefs.feature_contribution eq 'y'}
								<fieldset>
									<legend>{tr}Contributions{/tr}</legend>
									<table>
										{include file='contribution.tpl'}
									</table>
								</fieldset>
							{/if}
							{if (!isset($wysiwyg) || $wysiwyg neq 'y') and $prefs.feature_wiki_pictures eq 'y' and $tiki_p_upload_picture eq 'y' and $prefs.feature_filegals_manager neq 'y'}
								<fieldset>
									<legend>{tr}Upload picture:{/tr}</legend>
									<input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
									<input type="hidden" name="hasAlreadyInserted" value="">
									<input type="hidden" name="prefix" value="/img/wiki_up/{if $tikidomain}{$tikidomain}/{/if}">
									<input name="picfile1" type="file" onchange="javascript:insertImgFile('editwiki','picfile1','hasAlreadyInserted','img')">
									<div id="new_img_form"></div>
									<a href="javascript:addImgForm()" onclick="needToConfirm = false;">{tr}Add another image{/tr}</a>
								</fieldset>
							{/if}
				
						{/if}
					{/tab}
					{if $prefs.feature_categories eq 'y' and $tiki_p_modify_object_categories eq 'y' and count($categories) gt 0}
						{tab name="{tr}Categories{/tr}"}
							{if $categIds}
								{remarksbox type="note" title="{tr}Note:{/tr}"}
								<strong>{tr}Categorization has been preset for this edit{/tr}</strong>
								{/remarksbox}
								{section name=o loop=$categIds}
									<input type="hidden" name="cat_categories[]" value="{$categIds[o]}">
								{/section}
								<input type="hidden" name="cat_categorize" value="on">
								
								{if $prefs.feature_wiki_categorize_structure eq 'y'}
									{tr}Categories will be inherited from the structure top page{/tr}
								{/if}
							{else}
								{if $page|lower ne 'sandbox'}
									{include file='categorize.tpl' notable='y'}
								{/if}{* sandbox *}
							{/if}
						{/tab}
					{/if}
					{if $prefs.wiki_freetags_edit_position eq 'freetagstab'}
						{if $prefs.feature_freetags eq 'y' and $tiki_p_freetags_tag eq 'y'}
							{tab name="{tr}Freetags{/tr}"}
								<fieldset>
									<legend>{tr}Freetags{/tr}</legend>
									<table>
										{include file='freetag.tpl'}
									</table>
								</fieldset>
							{/tab}
						{/if}
					{/if}
					{if !empty($showPropertiesTab)}
						{tab name="{tr}Properties{/tr}"}
							{if $prefs.feature_wiki_templates eq 'y' and $tiki_p_use_content_templates eq 'y'}
								<fieldset>
									<legend>{tr}Apply template:{/tr}</legend>
									<select id="templateId" name="templateId" onchange="javascript:document.getElementById('editpageform').submit();" onclick="needToConfirm = false;">
										<option value="0">{tr}none{/tr}</option>
										{section name=ix loop=$templates}
										<option value="{$templates[ix].templateId|escape}" {if $templateId eq $templates[ix].templateId}selected="selected"{/if}>{tr}{$templates[ix].name|escape}{/tr}</option>
										{/section}
									</select>
									{if $tiki_p_edit_content_templates eq 'y'}
										<a style="align=right;" href="tiki-admin_content_templates.php" class="link" onclick="needToConfirm = true;">{tr}Admin Content Templates{/tr}</a>
									{/if}
								</fieldset>
							{/if}
							{if $prefs.feature_wiki_usrlock eq 'y' && ($tiki_p_lock eq 'y' || $tiki_p_admin_wiki eq 'y')}
								<fieldset>
									<legend>{tr}Lock this page{/tr}</legend>
									<input type="checkbox" id="lock_it" name="lock_it" {if $lock_it eq 'y'}checked="checked"{/if}>
								</fieldset>
							{/if}
							{if $prefs.wiki_comments_allow_per_page neq 'n'}
								<fieldset>
									<legend>{tr}Allow comments on this page{/tr}</legend>
									<input type="checkbox" id="comments_enabled" name="comments_enabled" {if $comments_enabled eq 'y'}checked="checked"{/if}>
								</fieldset>
							{/if}
				
							{if $prefs.feature_wiki_allowhtml eq 'y' and $tiki_p_use_HTML eq 'y' and ($wysiwyg neq 'y' or $prefs.wysiwyg_htmltowiki eq 'y')}
								<fieldset>
									<legend>{tr}Allow HTML:{/tr}</legend>
									<input type="checkbox" name="allowhtml" {if $allowhtml eq 'y'}checked="checked"{/if}>
								</fieldset>
								{if $prefs.ajax_autosave eq "y"}{jq}
$("input[name=allowhtml]").change(function() {
	auto_save( "editwiki", autoSaveId );
});
								{/jq}{/if}
							{else}
								<input type="hidden" name="allowhtml" value="{if $allowhtml eq 'y'}on{/if}">
							{/if}
							{if $prefs.feature_wiki_import_html eq 'y'}
								<fieldset>
									<legend>{tr}Import HTML:{/tr}</legend>
									<input class="wikiedit" type="text" id="suck_url" name="suck_url" value="{$suck_url|escape}">&nbsp;
									<input type="submit" class="wikiaction btn btn-default" name="do_suck" value="{tr}Import{/tr}" onclick="needToConfirm=false;">&nbsp;
									<label><input type="checkbox" name="parsehtml" {if $parsehtml eq 'y'}checked="checked"{/if}>&nbsp;
									{tr}Try to convert HTML to wiki{/tr}. </label>
								</fieldset>
							{/if}
							
							{if $prefs.feature_wiki_import_page eq 'y'}
								<fieldset>
									<legend>{tr}Import page:{/tr}</legend>
									<input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
									<input id="userfile1" name="userfile1" type="file">
                                    <input type="submit" class="wikiaction btn btn-default" name="attach" value="{tr}Import{/tr}" onclick="javascript:needToConfirm=false;insertImgFile('editwiki','userfile2','hasAlreadyInserted2','file', 'page2', 'attach_comment'); return true;">
                                </fieldset>
							{/if}
							{if $prefs.feature_wiki_export eq 'y' and $tiki_p_export_wiki eq 'y'}
								<fieldset>
									<legend>{tr}Export pages:{/tr}</legend>
									<a href="tiki-export_wiki_pages.php?page={$page|escape:"url"}&amp;all=1" class="link">{tr}export all versions{/tr}</a>
								</fieldset>
							{/if}

							{if !isset($wysiwyg) || $wysiwyg neq 'y'}
								{if $prefs.feature_wiki_attachments == 'y' and ($tiki_p_wiki_attach_files eq 'y' or $tiki_p_wiki_admin_attachments eq 'y')}
									<fieldset>
										<legend>{tr}Upload file:{/tr}</legend>
										<input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
										<input type="hidden" name="hasAlreadyInserted2" value="">
										<input type="hidden" id="page2" name="page2" value="{$page}">
										<input name="userfile2" type="file" id="attach-upload">
										 <label>{tr}Comment:{/tr}<input type="text" name="attach_comment" maxlength="250" id="attach-comment"></label>
										<input type="submit" class="wikiaction btn btn-default" name="attach" value="{tr}Attach{/tr}" onclick="javascript:needToConfirm=false;insertImgFile('editwiki','userfile2','hasAlreadyInserted2','file', 'page2', 'attach_comment'); return true;">
									</fieldset>
								{/if}
	
							{/if}
							{* merged tool and property tabs for tiki 6 *}
							{if $page|lower neq 'sandbox'}
								{if $prefs.wiki_feature_copyrights  eq 'y'}
									<fieldset>
										<legend>{tr}Copyright:{/tr}</legend>
										<table class="formcolor" border="0">
{'fraction_non_alphanumeric': 0.18669014970436532, 'fraction_numerical': 0.00459177255000629, 'mean_word_length': 3.7915913200723326, 'pattern_counts': {'":': 0, '<': 401, '<?xml version=': 0, '>': 397, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5654245', 'n_tokens_mistral': 14141, 'n_tokens_neox': 11131, 'n_words': 2250}