<h1>{{$lang.Pages}}</h1>

{{if count( $aPages ) > 0}}
	<form action="?p={{$_GET.p}}" method="post">
		<fieldset>
			<table class="list" id="pages">
				<thead>
					<tr>
						<th class="del">{{$lang.Delete}}</th>
						<th class="id">{{$lang.Id}}</th>
						<th class="name">{{$lang.Name}}</th>
						<th class="position">{{$lang.Position}}</th>
						<th class="enabled">{{$lang.Enabled}}</th>
						<th class="margin">{{$lang.Margin}}</th>
						<th class="actions">{{$lang.Actions}}</th>
					</tr>
				</thead>
				<tfoot>
					<tr class="actions"><td colspan="3">&nbsp;</td><td colspan="3" class="save float"><div class="floatcontainer"><input type="submit" class="submit" name="sDeleteOption" value="{{$lang.delete_selected}}" /> <input type="submit" class="submit" name="sOption" value="{{$lang.Save}}" /></div></td></tr>
				</tfoot>
				<tbody>
					{{$iType = 0}}
					{{foreach from=$aPages item=aPage}}
						{{if $aPage.iType != $iType}}
							<tr class="type"><th colspan="7">{{$lang.Menu}}: {{$aMenuTypes[$aPage.iType]}}</th></tr>
						{{$iType = $aPage.iType}}
						{{/if}}
						<tr class="l{{$aPage.iDepth}}">
							<td class="del"><input type="checkbox" name="aDelete[]" value="{{$aPage.iPage}}" /></td>
							<td class="id">{{$aPage.iPage}}<a href="#" class="Show_levels"></a></td>
							<td class="name"><a href="?p=p-form&amp;iPage={{$aPage.iPage}}">{{$aPage.sName}}</a></td>
							<td class="position"><input type="text" name="aPositions[{{$aPage.iPage}}]" value="{{$aPage.iPosition}}"  size="2" maxlength="3" /></td>
							<td class="enabled"><input type="checkbox" name="aStatus[{{$aPage.iPage}}]" {{if $aPage.iStatus}}checked="checked"{{/if}} value="1" /></td>
							<td class="margin">{{if !empty( $aPage.sMargin )}}{{$aPage.sMargin}} <a href="?p={{$aActions.f}}-margin_ajax&amp;iPage={{$aPage.iPage}}" class="colorbox"><img src="{{$config.dir_templates}}admin/images/ico/margin-category.png" alt="page" title="{{$lang.Update_all_margins_page}}" /></a>{{/if}}</td>
							<td class="actions">
								<a href="?p=comments-list&amp;iPage={{$aPage.iPage}}" class="page-comments"><img src="{{$config.dir_templates}}admin/images/ico/{{if $aPage.iNewCommentsCount > 0}}comment-new.png{{else}}comment.png{{/if}}" alt="{{$lang.Pages_comment}}" title="{{$lang.Pages_comment}}" /></a>
								<a href="?p={{$aActions.f}}-form&amp;iPage={{$aPage.iPage}}" class="page-edit"><img src="{{$config.dir_templates}}admin/images/ico/edit.png" alt="{{$lang.Edit}}" title="{{$lang.Edit}}" /></a>
								<input class="clone_quantity" type="text" value="1" /> <a href="?p={{$aActions.f}}-clone&amp;iPage={{$aPage.iPage}}&amp;iQuantity=1" class="page-clone"><img src="{{$config.dir_templates}}admin/images/ico/clone.png" alt="{{$lang.Clone_page}}" title="{{$lang.Clone_page}}" /></a>
								<a href="?p={{$aActions.f}}-delete&amp;iPage={{$aPage.iPage}}" class="page-delete delete"><img src="{{$config.dir_templates}}admin/images/ico/delete.png" alt="{{$lang.Delete}}" title="{{$lang.Delete}}"/></a>
							</td>
						</tr>
					{{/foreach}}
				</tbody>
			</table>
		</fieldset>
	</form>
{{else}}

{{/if}}