<h3 class="page"><a href="<?php echo $tpl['link']($_GET['q_pageless']); ?>"><?php echo $tpl['gallery_page']['custom']['title']; ?></a></h3>

<form action="<?php echo $tpl['current_url_pageless']; ?>" method="post">
	<p class="field">
		<label for="page_title"><?php echo __('Titre :'); ?></label>
		<input autofocus required class="large" value="<?php echo ($_GET['section'] == 'new-page' && !$_POST) ? '' : $tpl['gallery_page']['custom']['title']; ?>" maxlength="32" id="page_title" name="page_title" size="30" type="text">
	</p>
	<p class="field">
		<label for="page_content"><?php echo __('Contenu (2000 caractères maximum) :'); ?></label>
		<span class="html_outer">
			<span class="html_inner">
				<textarea class="large" maxlength="2000" name="page_content" rows="15" cols="50" id="page_content"><?php echo $tpl['gallery_page']['custom']['content']; ?></textarea>
				<span>HTML</span>
			</span>
		</span>
	</p>
	<p class="field">
		<?php echo __('OU'); ?>
	</p>
	<p class="field">
		<input<?php if ($tpl['gallery_page']['custom']['file']) : ?> checked="checked"<?php endif; ?> id="page_file" name="page_file" type="checkbox">
		<label for="page_file"><?php echo __('Utiliser ce fichier :'); ?></label>
	</p>
	<div class="field_sublvl">
		<p class="field">
			<label for="page_filename">files/pages/</label>
			<select id="page_filename" name="page_filename" data-help-icon="pages_custom_file">
<?php foreach ($tpl['gallery_page']['custom']['files'] as $f) : ?>
				<option<?php if ($f['selected']) : ?> selected<?php endif; ?> value="<?php echo $f['filename']; ?>"><?php echo $f['filename']; ?></option>
<?php endforeach; ?>
			</select>
		</p>
	</div>
	<div id="submit">
		<div>
			<input name="anticsrf" type="hidden" value="<?php echo $tpl['anticsrf'](); ?>">
			<input type="submit" value="<?php echo __('Enregistrer'); ?>">
		</div>
	</div>
</form>