{{function name="countPages" iPages=1 iPageNumber=1 sUrl="" sUrl2=""}}
	{{if $iPageNumber > 1}}
		<a href="{{$sUrl}}{{if $iPageNumber > 2}}&amp;iPage={{$iPageNumber - 1}}{{/if}}{{$sUrl2}}">&laquo;&nbsp;{{$lang.pages_prev}}</a>
	{{/if}}
	{{$iPaginationSpacer = false}}
	{{section name=pages start=1 loop=$iPages+1 step=1}}
		{{if $smarty.section.pages.index != $iPageNumber && (abs($smarty.section.pages.index - $iPageNumber) <= $config.pagination_counter_admin || $smarty.section.pages.index <= $config.pagination_counter_admin || $smarty.section.pages.index >=  + $iPages - $config.pagination_counter_admin + 1)}}
			<a href="{{$sUrl}}{{if $smarty.section.pages.index > 1}}&amp;iPage={{$smarty.section.pages.index}}{{/if}}{{$sUrl2}}">{{$smarty.section.pages.index}}</a>
		{{$iPaginationSpacer = false}}
		{{elseif $smarty.section.pages.index == $iPageNumber}}
			<strong>{{$smarty.section.pages.index}}</strong>
		{{else}}
			{{if $iPaginationSpacer === false}}
			<strong>...</strong>
			{{$iPaginationSpacer = true}}
			{{/if}}
		{{/if}}
	{{/section}}
	{{if $iPageNumber < $iPages}}
		<a href="{{$sUrl}}&amp;iPage={{$iPageNumber + 1}}{{$sUrl2}}">{{$lang.pages_next}}&nbsp;&raquo;</a>
	{{/if}}
{{/function}}

<form action="admin.php" method="get">
	<input type="hidden" name="p" value="files-productdir" />
	<fieldset><label>{{$lang.search}}: <input type="text" name="sPhrase" value="{{$_GET.sPhrase}}" /></label> <input class="submit" type="submit" value="{{$lang.search}}" /></fieldset>
</form>
<div id="file-list-server">
	<ul>
		{{foreach from=$aFiles.aFiles item=aFile}}
			{{if $aFile.iPhoto}}
				<li><a class="image" href="{{$config.dir_files}}{{$aFile.sFileName}}" target="_blank"><img alt="min" src="{{$config.dir_files}}40/{{$aFile.sFileName}}" /></a> <a class="choose" href="#">{{$aFile.sFileName}}</a></li>
			{{else}}
				<li><a class="file" href="{{$config.dir_files}}{{$aFile.sFileName}}" target="_blank"><img alt="ico" src="{{$config.dir_files}}ext/ico_nn.png" /></a> <a class="choose" href="#">{{$aFile.sFileName}}</a></li>
			{{/if}}
		{{/foreach}}
	</ul>
</div>
{{capture name=url1 assign=sUrl}}admin.php?p=files-productdir{{if !empty( $_GET.sPhrase )}}&amp;sPhrase={{$_GET.sPhrase}}{{/if}}{{/capture}}
{{if $aFiles.aPagesCountData.iCount > 1}}<p>{{$lang.Pages}}: {{countPages iPages=$aFiles.aPagesCountData.iCount iPageNumber=$aFiles.aPagesCountData.iPageNumber sUrl=$sUrl}}</p>{{/if}}