{title}{tr}Admin HTML Page Dynamic Zones{/tr}{/title}

<h2>{tr}Page:{/tr} {$pageName}</h2>

<div class="t_navbar btn-group">
	{button href="tiki-admin_html_pages.php" class="btn btn-default" _icon_name="cog" _text="{tr}Admin HTML pages{/tr}"}
	{assign var='pname' value=$pageName|escape:"url"}
	{button href="tiki-admin_html_pages.php?pageName=$pname" class="btn btn-default" _icon_name="edit" _text="{tr}Edit this page{/tr}"}
	{button href="tiki-page.php?pageName=$pname" class="btn btn-default" _icon_name="view" _text="{tr}View page{/tr}"}
</div>

{if $zone}
	<h2>{tr}Edit zone{/tr}</h2>
	<form action="tiki-admin_html_page_content.php" method="post">
		<input type="hidden" name="pageName" value="{$pageName|escape}">
		<input type="hidden" name="zone" value="{$zone|escape}">
		<table class="formcolor">
			<tr>
				<td>{tr}Zone:{/tr}</td>
				<td>{$zone}</td>
			</tr>
			<tr>
				<td>{tr}Content:{/tr}</td>
				<td>
					{if $type eq 'ta'}
						<textarea rows="5" cols="60" name="content">{$content|escape}</textarea>
					{else}
						<input type="text" name="content" value="{$content|escape}">
					{/if}
				</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td><input type="submit" class="btn btn-primary btn-sm" name="save" value="{tr}Save{/tr}"></td>
			</tr>
		</table>
	</form>
{/if}

<h2>{tr}Dynamic zones{/tr}</h2>

{include file='find.tpl'}

<form action="tiki-admin_html_page_content.php" method="post">
	<input type="hidden" name="pageName" value="{$pageName|escape}">
	<input type="hidden" name="zone" value="{$zone|escape}">
	<table class="table normal table-striped table-hover">
		<tr>
			<th>
				<a href="tiki-admin_html_page_content.php?pageName={$pageName|escape:"url"}&amp;offset={$offset}&amp;sort_mode={if $sort_mode eq 'zone_desc'}zone_asc{else}zone_desc{/if}">{tr}zone{/tr}</a>
			</th>
			<th>
				<a href="tiki-admin_html_page_content.php?pageName={$pageName|escape:"url"}&amp;offset={$offset}&amp;sort_mode={if $sort_mode eq 'content_desc'}content_asc{else}content_desc{/if}">{tr}content{/tr}</a>
			</th>
			<th></th>
		</tr>

		{section name=user loop=$channels}
			<tr>
				<td class="text">{$channels[user].zone}</td>
				<td class="text">
					{if $channels[user].type eq 'ta'}
						<textarea name="{$channels[user].zone|escape}" cols="20" rows="4">{$channels[user].content|escape}</textarea>
					{else}
						<input type="text" name="{$channels[user].zone|escape}" value="{$channels[user].content|escape}">
					{/if}
				</td>
				<td class="action">
					<a title=":{tr}Edit{/tr}" class="tips" href="tiki-admin_html_page_content.php?pageName={$pageName|escape:"url"}&amp;offset={$offset}&amp;sort_mode={$sort_mode}&amp;zone={$channels[user].zone}">
						{icon name='edit'}
					</a>
				</td>
			</tr>
		{/section}
	</table>

	<div align="center">
		<input type="submit" class="btn btn-default btn-sm" name="editmany" value="{tr}Mass update{/tr}">
	</div>
</form>

{pagination_links cant=$cant_pages step=$prefs.maxRecords offset=$offset}{/pagination_links}
