<?php
class makehtml_linkAction extends security_login {
	
	function action(){
		ModuleLimit(__CLASS__);
		$miceSession = new session();
		$miceSession->set('makehtml','miceCMS');

		$smarty = new Smarty();
		$smarty->load_filter('pre','micePreCompileIndex');

		//将内容写入至一个静态文件
		$content = $smarty->fetch('index/link.php'); 
		$fp = fopen(MICE_DIR.'link.html', 'w'); 
		fwrite($fp, $content); 
		fclose($fp);
		$miceSession->set('makehtml','');

		$jsstring='Dialog.alert(\'成功更新友情链接HTML：html/link.html<br><br><a href="'.MICE_URL.'html/link.html" target="_blank">预览</a>\',function(){window.location.href="'.MICE_URL.'index.php/makehtml/index";window.event.returnValue = false;},300,100,"生成HTML结果");';
		MessageBox($jsstring);

		exit;
	}	
}
?>