{{function name="selectOptions" aOptions=0 mOption=0}}
	{{foreach from=$aOptions item=sOption}}
		<option value="{{$sOption@key}}" {{if ( is_array( $mOption ) && in_array( $sOption@key, $mOption ) ) || ( $sOption@key == $mOption )}}selected="selected"{{/if}}>{{$sOption}}</option>
	{{/foreach}}
{{/function}}

<h1>{{$lang.Languages}}</h1>
<a href="?p=lang-form" class="new_element">{{$lang.New_language}}</a>
{{if count($aLanguages) > 0}}
	<form action="?p={{$_GET.p}}" method="post">
		<fieldset>
		<table class="details">
			<tr>
				<th class="name">{{$lang.Google_translate_on}}</th><td class="value"><select name="google_translate_on">{{selectOptions aOptions=$aYesNo mOption=$config.google_translate_on}}</select></td><td class="help"><img class="tTip info" src="templates/images/info.png"  title="{{$lang.help_google_translate_on}}" /></td>
			</tr>
		</table>
		<table class="list">
			<thead>
				<tr>
					<th class="enabled">{{$lang.Active}}</th>
					<th class="name">{{$lang.Name}}</th>
					<th class="actions">{{$lang.Actions}}</th>
				</tr>
			</thead>
			<tbody>
				{{foreach from=$aLanguages item=sLanguage}}
					<tr>
						<td><input type="checkbox" value="1" name="aEnabledLangs[{{$sLanguage}}]" {{if in_array( $sLanguage, $aEnabledLangs )}}checked="checked"{{/if}} /></td>
						<td class="name"><a href="?p={{$aActions.f}}-translations&amp;sLanguage={{$sLanguage}}">{{$sLanguage}}</a></td>
						<td class="actions">
							<a href="?p={{$aActions.f}}-translations&amp;sLanguage={{$sLanguage}}"><img src="{{$config.dir_templates}}admin/images/ico/edit.png" alt="{{$lang.Edit}}" title="{{$lang.Edit}}" /></a>
							<a href="?p={{$aActions.f}}-delete&amp;sLanguage={{$sLanguage}}" class="delete" onclick="return del( );"><img src="{{$config.dir_templates}}admin/images/ico/delete.png" alt="{{$lang.Delete}}" title="{{$lang.Delete}}"/></a>
						</td>
					</tr>
				{{/foreach}}
				<tr><td></td><td class="name"><a href="?p={{$aActions.f}}-translations&amp;sLanguage=admin">admin</a></td><td class="actions"><a href="?p={{$aActions.f}}-translations&amp;sLanguage=admin"><img src="{{$config.dir_templates}}admin/images/ico/edit.png" alt="{{$lang.Edit}}" title="{{$lang.Edit}}" /></a></td></tr>
				<tr><td></td><td class="name"><a href="?p={{$aActions.f}}-translations&amp;sLanguage=admin_help">admin - help</a></td><td class="actions"><a href="?p={{$aActions.f}}-translations&amp;sLanguage=admin_help"><img src="{{$config.dir_templates}}admin/images/ico/edit.png" alt="{{$lang.Edit}}" title="{{$lang.Edit}}" /></a></td></tr>
			</tbody>
		</table>
		<div class="save float"><div class="save floatcontainer">
			<input type="submit" class="submit" name="sOption" value="{{$lang.Save}}" />
		</div></div>
		</fieldset>
	</form>
{{else}}
	<div class="msg" id="error">
		<img src="{{$config.dir_templates}}admin/images/ico/msg_error.png" class="imgv" alt="" /> {{$lang.Data_not_found}}
	</div>
{{/if}}