<div id="admin_settings_main">
	<h1>Настройки модулей</h1>
	{if !$core_config.separate_config}<a href="{url}" title="Настройки сайта"><img src="/skins/default/images/icons/settings.png" alt="Настройки сайта" /></a> <a href="{url action="modules"}" title="Настройки модулей"><img src="/skins/default/images/icons/module.png" alt="Настройки модулей" /></a> {/if}
	<form method="post" action="">
	<div id="basic-accordian" ><!--Parent of the Accordion-->
		<input type="hidden" name="token" value="{$_user->token}" />
		{foreach $modules as $module_id=>$module}
		<div {if !$module.config}style="display:none"{/if} id="module{$module_id}-header"  class="accordion_headings{if $module@first} header_highlight{/if}">{$module.name|escape}</div>
		<div {if !$module.config}style="display:none"{/if} id="module{$module_id}-content">
			<table class="accordion_child">
				{foreach $module.access as $permis=>$access}
				<tr class="row" style="display:none;"><td class="lRow">{$access.title|escape} <span class="small">{$access.describe|escape}{if $access.group}<br />Права наследуются от группы "{$access.group|escape}"{/if}&nbsp;</span></td><td class="rRow">
				<input type="checkbox" name="access[{$module_id}][{$permis}]"{if $access.val || $smarty.post.access.$module_id.$permis} checked="checked"{/if}{if $access.group} disabled="disabled"{/if} /> 
				</td></tr>
				{/foreach}
			
			{foreach $module.config as $conf=>$config}
			<tr class="row"><td class="lRow">{$config.title|escape}<span class="small">{$config.describe|escape}&nbsp;</span></td><td class="rRow">
				{if $config.type=='integer' || $config.type=='string'}
				<input type="text" name="config[{$module_id}][{$conf}]" value="{$smarty.post.config.$module_id.$conf|default:$config.val|escape}" /> 
				{elseif $config.type=='password'}
				<input type="password" name="config[{$module_id}][{$conf}]" value="{$smarty.post.config.$module_id.$conf|default:$config.val|escape}" /> 
				{elseif $config.type=='select'}
				{html_options options=$module.values.$conf selected=$config.val name="config[$module_id][$conf]"}
				{elseif $config.type=='boolean'}
				<input type="checkbox" name="config[{$module_id}][{$conf}]"{if $config.val} checked="checked"{/if} />
				{elseif $config.type=='select_multiple'}
				<select multiple="multiple" name="config[{$module_id}][{$conf}][]">
				{html_options options=$module.values.$conf selected=$config.val}
				</select>
				{/if}
			</td></tr>	
			{/foreach}
			<tr><td colspan="2"><input type="submit" value="Сохранить" /></td></tr>
			</table>
		</div>
		{/foreach}
	</div>
	</form>

	<script type="text/javascript">
		new Accordian('basic-accordian',2,'header_highlight');
	</script>
</div>