<div id="admin_settings_main">
	<h1>Настройки сайта</h1>
	{if !$_cfg.core.separate_config}
		<ul class="nav nav-tabs">
			<li class="active"><a href="{url}" title="Настройки сайта"><img src="/skins/default/images/icons/settings.png" alt="Настройки сайта" /></a></li>
			<li><a href="{url action="modules"}" title="Настройки модулей"><img src="/skins/default/images/icons/module.png" alt="Настройки модулей" /></a></li>
		</ul>
	{/if}
	<form method="post" action="#"  style="margin-top: 10px;">
		<p><input type="hidden" name="token" value="{$_user->token}" /></p>
		<div id="accordian" >
			{foreach $core_cfg as $id=>$group}
				<div class="panel panel-primary">
					<div class="panel-heading">{$group.name|escape}</div>
					<div class="panel-body">
						<table class="table table-striped">
							{foreach $group.config as $key=>$cfg}
								<tr>
									<td>
										{$cfg.title}
										<small class="help-block">{$cfg.describe}</small>
									</td>
									<td>
										{if $cfg.type=='integer' || $cfg.type=='string'}
											<input class="form-control" type="text" name="core[{$key}]" value="{$smarty.post.core.$key|default:$cfg.val|escape}" />
										{elseif $cfg.type=='password'}
											<input class="form-control" type="password" name="core[{$key}]" value="{$smarty.post.core.$key|default:$cfg.val|escape}" />
										{elseif $cfg.type=='select'}
											<select class="form-control" name="core[{$key}]">
												{html_options options=$group.values.$key selected=$cfg.val}
											</select>
										{elseif $cfg.type=='boolean'}
											<input type="checkbox" name="core[{$key}]"{if $cfg.val} checked="checked"{/if} />
										{elseif $cfg.type=='select_multiple'}
											<select class="form-control" multiple="multiple" name="core[{$key}][]">
												{html_options options=$group.values.$key selected=$cfg.val}
											</select>
										{/if}
									</td>
								</tr>
							{/foreach}
							<tr><td colspan="2">
								<input class="btn btn-default" type="submit" value="Сохранить" />
							</td></tr>
						</table>
					</div>
				</div>
			{/foreach}
		</div>
	</form>
	<script type="text/javascript">
		$('#accordian').accordion({ header: 'div.panel-heading', autoheight: false, fillSpace:false, alwaysOpen: true });
	</script>
</div>