<?php
/**
 *	Generated by miceCMS
 *	http://www.miceCMS.com/
 */
class templates_systemAction extends security_login {
	function action(){
		//接收参数
		ModuleLimit(__CLASS__);

		$iframe="";

		//将代码写入文档
		$code=$_POST['code'];
		$url=$_POST['url'];
		if($url!=""){
			$tpl=MICE_DIR.MICE_TPL."/index/tool_".$url.'.php';
			$fp = fopen($tpl, 'w'); 
			fwrite($fp, $code); 
			fclose($fp);
			$iframe="<iframe width='100%' height='150px' src='".MICE_URL."index.php/tool/".$url."'>";
		}
		$smarty = new Smarty();
		$smarty->load_filter('pre','micePreCompileAdmin');
		$smarty->assign('iframe', $iframe);
		$filename = new getTPLFileName(__CLASS__);
		$smarty->display($filename->TPLFileName);
	}
}
?>