block2tmpl.html 2.1 KB
 <ul class="top_nav">
		<li ><a  href="/" >Сайт</a></li>
		<li ><a  href="/admin.html" >Административный раздел</a></li>
		<li ><a  href="/?p_name=admin_control_blocks" >Блоки</a></li>
		<li class="current" > Блок  &laquo;${b_name}&raquo; задействован в следующих шаблонах</li>
	</ul>

<div style="padding:10px;padding-top:0px;" > 
	<table  class="data" width="100%" align="left" >

	<tr>
	  	<td colspan="8" style="padding:5px;text-align:right">
	  		<a style="color:#F8A720;font-size:14px;" act="add_link" row_id="0" >Добавить&nbsp;новый&nbsp;блок</a>
	  	</td>
	</tr>
	<tr class="header">
	 	<td width="15%">Шаблон</td>
	  <td width="5%" >Переменная</td>
	  <td width="5%">Настройки</td>
	 	<td width="1%" colspan="2"></td>
	</tr>
	
	
	 <tbody id="table_content">
		<tal:block metal:use-macro="inc/row_block2tmpl.html/row_block2tmpl">
			подключаем шаблон из файла inc/row_block2tmpl.html
		</tal:block>
	</tbody>
	</table>
	
	
</div>
<script>/*<![CDATA[*/

t = new HL.controls.table("${MAIN_URL}/?p_name=admin_control_blocks");
t.data['b_id']=${b_id};

$('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) );
});

t.setAction('updateKey',function(t,link){
	 $.ajax( {
	 			'beforeSend' : function(){
	 				$(link).css('color','red');
	 			},
        'dataType':'xml',
        'type'    : "POST",
        'url'     : t.server+'&act=updateKey', 
        'data'    : {'id':$(link).attr('row_id'),'key':$(link).attr('name'),'value':$(link).val()},
        'success' : function(xml){ 
        	$(link).css('color','green');
          $(link).prop('disabled',false);
        },
   })
})

$('input[name]').blur( function(e){
	t.setWhere('key',$(this).attr('name') );
	t.setWhere('value',$(this).val() );
	t.execute('updateKey', $(this) );
});


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




/*]]>*/</script>