<h2>{{$lang.Files_and_images}}</h2>
<h2>{{$lang.Images_list}}</h2>
{{if count($aFiles) > 0}}
	<table id="images-list" class="list">
		<thead>
			<tr>
				<th class="selected"><input type="checkbox" class="checkall"/></th>
				<th class="photo">{{$lang.Photo}}</th>
				<th class="name">{{$lang.Name}}</th>
				<th class="thumb">{{$lang.Thumbnail}}</th>
				<th class="description">{{$lang.Description}}</th>
				<th class="position">{{$lang.Position}}</th>
				<th class="photo-place">{{$lang.Photo_place}}</th>
				<th class="actions">{{$lang.Actions}}</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td class="actions" colspan="6">
					<select class="actions">
						<option value="">{{$lang.Select_images_then}}...</option>
						<option value="del">{{$lang.Delete}}</option>
						{{foreach from=$config.pages_images_sizes item=iSize}}
							<option value="thumb-{{$iSize}}">{{$lang.Set_thumb_size_to}} {{$iSize}}</option>
						{{/foreach}}
						{{foreach from=$aGeneralInfo.aPhotoPosition item=sPlace}}
							<option value="place-{{$sPlace@key}}">{{$lang.Set_file_position_to}} {{$sPlace}}</option>
						{{/foreach}}
						<option value="fname2desc">{{$lang.Copy_filename_to_desc}}</option>
					</select>
					<a href="#" class="action-confirm">{{$lang.Confirm}}</a>
				</td>
			</tr>
		</tfoot>
		<tbody>
			{{foreach from=$aFiles item=aFile}}{{if $aFile.iPhoto == 1}}
				<tr class="file">
					<td class="selected"><input type="checkbox" class="check"/></td>
					<td class="photo"><a href="{{$config.dir_files}}{{$aFile.sFileName}}" {{if $aFile.iPhoto}}class="photo"{{else}}target="_blank"{{/if}}><div style="display: inline-block; height: 50px; width: 50px; vertical-align: middle; text-align: center;"><img style="vertical-align: middle; margin: auto;" src="{{$config.dir_files}}50/{{$aFile.sFileName}}" alt="{{$lang.Thumbnail}}" /></div></td> 
					<td class="name"><span class="name">{{$aFile.sFileName}}</span></a></td>
					<td class="thumb">{{if $aFile.iPhoto}}<select class="thumbS" name="aFilesSizes[{{$aFile.iFile}}]" title="{{$lang.Thumbnail}}">{{selectOptions aOptions=$config.pages_images_sizes mOption=$aFile.iSize}}</select>{{/if}}</td>
					<td class="description"><input type="text" name="aFilesDescription[{{$aFile.iFile}}]" value="{{$aFile.sDescription}}" class="input description" title="{{$lang.Description}}" /> <a href="#" class="additional"></a></td></td>
					<td class="position"><input class="iPos" type="text" name="aFilesPositions[{{$aFile.iFile}}]" value="{{$aFile.iPosition}}" title="{{$lang.Position}}" /></td>
					<td class="photo-place"><select name="aFilesTypes[{{$aFile.iFile}}]" class="placeS" title="{{$lang.Photo_place}}">{{selectOptions aOptions=$aGeneralInfo.aPhotoPosition mOption=$aFile.iType}}</select></td>
					<td class="actions">
						<span class="del" style="display:none"><input class="checkbox" type="checkbox" name="aFilesDelete[{{$aFile.iFile}}]" value="1" /></span>
						<a style="border: 1px solid #e1e1e1; display: inline-block; padding: 2px; vertical-align: middle;" href="admin.php?p=files-edit&amp;sFileName={{$aFile.sFileName}}&amp;iFile={{$aFile.iFile}}&amp;iType={{$aFile.iLinkType}}"><img src="templates/admin/images/ico/edit.png" alt="{{$lang.Edit}}" /></a>
						<a style="border: 1px solid #e1e1e1; display: inline-block; padding: 2px; vertical-align: middle;" href="#" title="{{$lang.More}}" class="additional"><img src="templates/admin/images/ico/ico_down.png" alt="{{$lang.More}}" /></a>
					</td>
				</tr>
				<tr class="hidden">
					<td colspan="8" class="full_description"><textarea name="aFilesTextSearch[{{$aFile.iFile}}]">{{$aFile.sTextSearch}}</textarea></td>
				</tr>
			{{/if}}{{/foreach}}
		</tbody>
	</table>
{{/if}}

<h2>{{$lang.Files_list}} </h2>
{{if count($aFiles) > 0}}
	<table id="files-list" class="list">
		<thead>
			<tr>
				<th class="selected"><input type="checkbox" class="checkall"/></th>
				<th class="name">{{$lang.Name}}</th>
				<th class="description">{{$lang.Description}}</th>
				<th class="position">{{$lang.Position}}</th>
				<th class="photo-place">{{$lang.File_place}}</th>
				<th class="actions"></th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td class="actions" colspan="5">
					<select class="actions">
						<option value="">{{$lang.Select_files_then}}...</option>
						<option value="del">{{$lang.Delete}}</option>
						{{foreach from=$aGeneralInfo.aFilePosition item=sPlace}}
							<option value="place-{{$sPlace@key}}">{{$lang.Set_file_position_to}} {{$sPlace}}</option>
						{{/foreach}}
						<option value="fname2desc">{{$lang.Copy_filename_to_desc}}</option>
					</select>
					<a href="#" class="action-confirm">{{$lang.Confirm}}</a>
				</td>
			</tr>
		</tfoot>
		<tbody>
			{{foreach from=$aFiles item=aFile}}{{if $aFile.iPhoto != 1}}
				<tr class="file">
					<td class="selected"><input type="checkbox" class="check"/></td>
					<td class="name"><a href="{{$config.dir_files}}{{$aFile.sFileName}}" target="_blank"><span class="name">{{$aFile.sFileName}}</span></a></td>
					<td class="description"><input type="text" name="aFilesDescription[{{$aFile.iFile}}]" value="{{$aFile.sDescription}}" class="input description" title="{{$lang.Description}}" /> <a href="#" class="additional"></a></td>
					<td class="position"><input class="iPos" type="text" name="aFilesPositions[{{$aFile.iFile}}]" value="{{$aFile.iPosition}}" title="{{$lang.Position}}" /></td>
					<td class="photo-place"><select name="aFilesTypes[{{$aFile.iFile}}]" class="placeS" title="{{$lang.Photo_place}}">{{selectOptions aOptions=$aGeneralInfo.aFilePosition mOption=$aFile.iType}}</select></td>
					<td class="actions"><span class="del" style="display: none;"><input class="checkbox" type="checkbox" name="aFilesDelete[{{$aFile.iFile}}]" value="1" /></span></td>
				</tr>
				<tr class="hidden">
					<td colspan="6" class="full_description"><textarea name="aFilesTextSearch[{{$aFile.iFile}}]">{{$aFile.sTextSearch}}</textarea></td>
				</tr>
			{{/if}}{{/foreach}}
		</tbody>
	</table>
{{/if}}
<div class="add_new" style="margin: 10px; padding: 10px; border: 1px solid #bababa; background-color: #eee;">
	<p class="help">{{$lang.help_files_intro}}</p>
	<div class="block30">
		<h2>{{$lang.Add_images}}</h2>
		<input type="file" name="aNewImages[]" value="" class="finput" multiple="multiple" accept="image/*" /> <img class="tTip info" src="templates/images/info.png"  title="{{$lang.help_files_image}}" /><br/>
		<label><input type="checkbox" name="iWatermark" {{if $config.iWatermark}}checked="checked"{{/if}} /> {{$lang.Add_watermark}}</label>
	</div>
	<div class="block30">
		<h2>{{$lang.Add_files}}</h2>
		<input type="file" name="aNewFiles[]" value="" class="finput" multiple="multiple" /> <img class="tTip info" src="templates/images/info.png"  title="{{$lang.help_files_file}}" />
	</div>
	<div class="block30">
		<h2>{{$lang.Files_on_server}}</h2>
		<p class="files-dir"></p>
		<a href="#" id="add-file-dir-link" class="new_element">{{$lang.Add_file_dir}}</a>
	</div>
</div>