{if $ajax eq 0}{include file="$admingentemplates/admin_top.tpl"}
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_modules.php">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$header.razdel_name}</div>
<div class="cr">&nbsp;</div>
<div class="help_text" style="display:block;">
    <div class="close_help">
        <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
    </div>
    <div class="help_body">
        <span class="help_title">{$lang.help}:</span>{$help.chat_module}
    </div>
</div>
<div class="cr">&nbsp;</div>
<div style="float:right;"><a href="{$site_url}{$site_root}/flash_chat/flashchat.php" target="_blank">{$lang.admin_menu.chat_login}</a></div>
<div class="cr">&nbsp;</div>
<ul class="tabs">
    <li>
        <a href="msglist.php">{$lang.admin_menu.chat_messages}</a>
    </li>
    <li>
        <a href="roomlist.php">{$lang.admin_menu.chat_rooms}</a>
    </li>
    <li>
        <a href="connlist.php">{$lang.admin_menu.chat_connections}</a>
    </li>
    <li>
        <a href="banlist.php">{$lang.admin_menu.chat_bans}</a>
    </li>
    <li>
        <a href="ignorelist.php">{$lang.admin_menu.chat_ignoring}</a>
    </li>
    <li>
        <a href="botlist.php">{$lang.admin_menu.chat_bots}</a>
    </li>
    <li>
        <a href="modlist.php">{$lang.admin_menu.chat_moderators}</a>
    </li>
    <li>
        <a class="current">{$lang.admin_menu.chat_modules}</a>
    </li>
{*    <li>
        <a href="{$site_url}{$site_root}/flash_chat/flashchat.php" target="_blank">{$lang.admin_menu.chat_login}</a>
    </li>*}
</ul>{/if}
		<div class="user_operation_line" style="height:4px;">

		</div>
    <div class="user_status_line" style="margin-bottom:0px;width:100%;">
        <div id="tab_news" class="user_status_elem" onclick="links_load('roomlist.php?');">
            <a>{$lang.admin_menu.chat_rooms}</a>
        </div>
        <div id="tab_feeds" class="user_status_elem" onclick="links_load('connlist.php?');">
            <a>{$lang.admin_menu.chat_connections}</a>
        </div>
        <div class="user_status_elem" onclick="links_load('banlist.php?');">
            <a>{$lang.admin_menu.chat_bans}</a>
        </div>
        <div class="user_status_elem_active">
            {$lang.admin_menu.chat_modules}
        </div>
	</div>
<div style="float:left;width:99.7%;">
<form name="modules" id="modules" action="modules.php" method="post" style="margin: 0px;">
<input type="hidden" name="sel" value="save">
<input type="hidden" name="ajax" value="1">
<table border=0 cellspacing=0 cellpadding=0 width="100%">
<tr class="table_header">
	<td class="main_header_text" align="center" width="10%">{$header.modules_title.num}</td>
	<td class="main_header_text" align="left" width="70%">{$header.modules_title.name}</td>
	<td class="main_header_text" align="center" width="10%">{$header.modules_title.status}</td>
	<td class="main_header_text" align="right" width="10%">{$lang.button.action}</td>
</tr>
{foreach item=item from=$modules name=i}
<tr {if $smarty.section.i.iteration mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
	<td class="main_content_text" align="center">{$item.num}</td>
	<td class="main_content_text" align="left">{$item.title}</td>
	<td class="main_content_text" align="center"><input type="checkbox" name="status[]" value="{$item.id}" {if $item.status eq 1} checked {/if}></td>
	<td class="main_content_text" align="center">
{*		<a class="admin_button" onclick="document.location.href='modules.php?sel=edit&id_module={$item.id}'">{$lang.button.edit}<span>&nbsp;</span></a>*}
		<div class="block_action fr" style="display: none;">
			<div class="action_edit" style="display: block;">
				<img width="16" alt="" src="{$site_root}{$template_root}/images/edit.png" onclick="document.location.href='modules.php?sel=edit&id_module={$item.id}'">
			</div>
		</div>			
	</td>
</tr>
{foreachelse}
<tr height="40">
	<td class="main_error_text" align="left" colspan="4" bgcolor="#FFFFFF">{$header.err_no_modules_found}</td>
</tr>
{/foreach}
<tr class="table_header"><td colspan="4"></td></tr></table>
<script type="text/javascript">
{literal}
function Save_status(){
var options = {
	  success: function() {
			ajaxLoadingImage(0, 'aff_ads_div');
		},
	beforeSubmit: function() { 
		ajaxLoadingImage(1, 'aff_ads_div');
	}
	};
	$("#modules").ajaxSubmit(options); }	
{/literal}
</script>
<table style="margin-top:15px;">
<tr bgcolor="#FFFFFF">
	<td align="left"><a class="admin_button_major" onclick="Save_status();">{$lang.button.save}<span>&nbsp;</span></a></td>	
</tr>
</table>
</form>
</div>{if $ajax eq 0}
{*<p align="right" class="main_header_text">&copy;<a href="http://tufat.com/" target="_blank">TUFaT.com</a> </p>*}
{include file="$admingentemplates/admin_bottom.tpl"}{/if}