tpl_4f0d967d_main__EtYXYDQwDhXLUzJstdM1mg.php 3.91 KB
<?php 
function tpl_4f0d967d_main__EtYXYDQwDhXLUzJstdM1mg($tpl, $ctx) {
$_thistpl = $tpl ;
$_translator = $tpl->getTranslator() ;
?>
<ul class="top_nav">
		<li><a href="/"><?php echo phptal_escape($ctx->SITE) ?></a></li>
		<li><a href="<?php echo phptal_escape($ctx->URL_ADMIN) ?>"><?php echo phptal_escape($ctx->ADMIN_PAGE) ?></a></li>
		<li class="current"><?php echo phptal_escape($ctx->M_ADMIN_SP) ?></li>
</ul>

<div style="padding:10px;padding-top:0px;">
	
	<table class="data" width="100%" align="left" id="table">
	<tr>
		<td colspan="6" style="text-align:right"><b><a style="color:#F8A720;font-size:14px;" onclick="table.edit(0,'<?php echo phptal_escape($ctx->MAIN_LANG) ?>')"><?php echo phptal_escape($ctx->M_ADMIN_SP_ADD_PAGE) ?></a></b></td>
	</tr>
	<tr class="header">
	  <td width="1%"></td>
	  <td width="10%">Название</td>
	  <td width="15%"><?php echo phptal_escape($ctx->M_ADMIN_SP_ADDRESS) ?></td>
	  <td width="10%"><?php echo phptal_escape($ctx->M_ADMIN_SP_TMPL) ?></td>
	  <?php if ($ctx->MAIN_MULTILANG): ; ?>
<td width="3%">Язык</td><?php endif; ?>

	  <td width="7%"></td>
	  </tr>
	
	<tbody id="table_content">
		<?php 
$ctx->pushSlots() ;
$tpl->_executeMacroOfTemplate('inc/tmpl_row.html/tmpl_row', $_thistpl) ;
$ctx->popSlots() ;
?>

	</tbody>
	</table>
</div>



<script>/*<![CDATA[*/
	/*	клиентская часть, отвечает за аякс	*/
table = {
	'server' :"<?php echo strtr(phptal_tostring($ctx->URL_ADMIN_STAT_PAGES) ,array(']]>'=>']]]]><![CDATA[>','</'=>'<\/')) ?>",
	'orderby_key' : false,
	'orderby_value'   : false,
	
}
table.lock = function(){
  
	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){
		alert(e);
	}
	r.send( {'id':mid} )
	
}
table.editor = function(){

		HL.wysiwyg();
	
}

	//	форма редактирования
table.edit = function(fid){
  
	wnd.onload = function(){table.editor()};
	wnd.open(table.server+'&act=ajax_edit&id='+fid);	
}
	//	форма добавления
	
table.create = function(){  wnd.onload = function(){table.editor()};
	table.edit(0)	;
}

	//	функция сохранения изменений формы
table.save = function(){

	r = new request(  table.server+'&act=ajax_save' );
	r.onrequest = function(){ 
	  o.msg.system('Идёт сохранение...');
		
	}
	r.onload = function(rst){
		o.$('save_b').disabled = false;
		o.msg.hidden()
		table.reload();
		wnd.close();
	}
	r.error = function(e){
	  
		o.$('save_b').disabled = false;
		o.msg.error(e)
	}
	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({'orderby_key':table.orderby_key, 'orderby_value':table.orderby_value});	
	
}

	//	перезагружаем таблицу страниц согласно соортировке и фильтрам
table.lang = function(id,lang){
	wnd.onload = function(){table.editor()};
	wnd.open(table.server+'&act=ajax_lang_edit&id='+id+'&lang='+lang);
}

table.changeEditor = function(name)
{

	HL.editor.remove( $('#p_content') )
	if ( name ){
		$('#p_content').attr('wysiwyg',true);
		$('#p_content').attr('type',name);
		HL.wysiwyg();
	}
	return false;
}

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

}

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

Generated by PHPTAL from /var/www/autolifeX/auto-life.ua/mobile/source/modules/admin/tmpl/control_stat_pages/main.html (edit that file instead) */; ?>