<?php 
function tpl_4ef0a6fb_main__n6Z1yvuHkVbI8z0lRmnuWg($tpl, $ctx) {
$_thistpl = $tpl ;
$_translator = $tpl->getTranslator() ;
?>
<ul class="top_nav">
		<li><a href="/">Сайт</a></li>
		<li><a href="/admin.html">Административный раздел</a></li>
		<li class="current">Блоки</li>
	</ul>

<div style="padding:10px;padding-top:0px;"> 
	<table class="data" width="100%" align="left">
	<tr>
		
		<td colspan="8" style="padding:5px;">
	  		<div style="font-size:10px;padding-left:10px;">
	  			<select style="width:150px" id="filter_module"><?php 
$ctx->noThrow(true) ;
if (!phptal_isempty($_tmp_1 = $ctx->module_list)):  ;
echo phptal_tostring($_tmp_1) ;
endif ;
$ctx->noThrow(false) ;
?>
</select>
	  				&nbsp; 
	  				<b>Фильтровать по модулю</b>
	  		</div>	
		</td>
	</tr>
	<tr>
		
	  	<td colspan="8" style="padding:5px;text-align:right">
	  
	  				
	  					<a style="color:#F8A720;font-size:14px;" act="edit" row_id="0">Создать&nbsp;новый&nbsp;блок</a>
	  		

	  	</td>
	</tr>
	<tr class="header">
	 	<td width="15%">Название</td>
	  <td width="10%">Переменная</td>
	  <td width="10%">Шаблон</td>
	 	<td width="7%">Модуль</td>
	 	<td width="5%">Ссылки</td>
	 	<td width="1%">Свободный доступ</td>
	 	<td width="10%" colspan="2"></td>
	</tr>
	
	
	 <tbody id="table_content">
		<?php 
$ctx->pushSlots() ;
$tpl->_executeMacroOfTemplate('inc/row.html/row', $_thistpl) ;
$ctx->popSlots() ;
?>

	</tbody>
	</table>
	
	
</div>
<script>/*<![CDATA[*/

t = new HL.controls.table("<?php echo strtr(phptal_tostring($ctx->MAIN_URL) ,array(']]>'=>']]]]><![CDATA[>','</'=>'<\/')) ?>/?p_name=admin_control_blocks");


$('td input[type=checkbox]').change( function(e){
	if ( $(this).attr('checked')=='checked'){
			t.setWhere('access',1 )
	}else{
		t.setWhere('access',0 )
	}
	t.execute('freeAccess', $(this) );
});

$('#filter_module').change( function(e){
	t.setWhere('filter_module',$(this).val() )
	t.execute('reload', $(this) );
});



/*
table = {'server' :"<?php echo strtr(phptal_tostring($ctx->MAIN_URL) ,array(']]>'=>']]]]><![CDATA[>','</'=>'<\/')) ?>/?p_name=admin_blocks",'filter_module':false}

table.access = function(value,id)
{
	r = new request(  table.server+'&act=ajax_access' );
	r.error = function(e){
		alert(e);
	}
	r.send({'id':id,'access':value} )
}
//	фильтр по модулю
table.where_module = function(box){

	table.filter_module = box.options[box.selectedIndex].value;
	table.page = 1;
	table.reload(true);
}

table.lock = function(){
	wnd.onload = false;
	wnd.set_title('');
	wnd.set_content('<?php echo strtr(phptal_tostring($ctx->WAIT) ,array(']]>'=>']]]]><![CDATA[>','</'=>'<\/')) ?>');
	wnd.show();
}
table.unlock = function(){
	wnd.close();
}

table.del = function(mid){

	r = new request(  table.server+'&act=ajax_delete' );
	r.onrequest = function(){ 
		table.lock();
	};
	r.onload = function(rst){ 
		table.reload();
		table.unlock();	
	};
	r.error = function(e){
		table.unlock();	
		alert(e);
	}
	r.send({'id':mid} )
	
	
	
}


table.create = function(){
	wnd.open(this.server+'&act=ajax_form');	
}

table.edit = function(id){

	wnd.open(this.server+'&act=ajax_form&id='+id);	
}


table.save = function(){
	r = new request(  table.server+'&act=ajax_save' );
	r.onrequest = function(){ 
	 // o.msg.system('<?php echo strtr(phptal_tostring($ctx->E_GO_SAVE) ,array(']]>'=>']]]]><![CDATA[>','</'=>'<\/')) ?>',300);
		
	}
	r.onload = function(rst){
			o.msg.system(rst.msg)
			o.$('save_b').disabled = false;
			wnd.close();
			table.reload();
		
		
	}
	r.error = function(e){
		o.msg.error(e,0)
		o.$('save_b').disabled = false
		
	}
	r.form( o.$('form_page') );
}

table.reload = function(){
	
	r = new request(  table.server+'&act=ajax_reload' );
	r.onload = function(rst){ 
		o.$('table_content').innerHTML =rst.content;	
	};
	r.error = function(e){
		alert(e);
	}
	r.send( {'filter_module':table.filter_module} )
	
}*/

/*]]>*/</script><?php 
/* end */ ;

}

?><?php /* 
*** DO NOT EDIT THIS FILE ***

Generated by PHPTAL from /home/shasha/www/pr25_autocatalog/autolife/source/modules/admin/tmpl/control_blocks/main.html (edit that file instead) */; ?>