<?php
/**
 *	Generated by miceCMS
 *	http://www.miceCMS.com/
 */
class comment_editAction extends security_login {
	function action(){
		ModuleLimit(__CLASS__);
		global $conn;
		$form_id=$this->_getParam('form_id');
		if($form_id){
			$form=new model_Form();
			$form->setSubsection('WHERE form_id='.$form_id);
			$results=$form->doSelectOne();
		}else{
			$results=new model_Form();
		}

		$editor='';
		//调用插件
		$plugin=new model_Plugin();
		$plugin->setSubsection('WHERE isopen=1 AND hook=\'editor\' ORDER BY orderid ASC,plugin_id DESC');
		$plugins=$plugin->doSelectOne();
		include_once MICE_DIR.'includes/plugin.php';
		if($plugins){
			if(file_exists(MICE_DIR.'plugins/'.$plugins->getName().'/index.php')){
				include_once MICE_DIR.'plugins/'.$plugins->getName().'/index.php';
				add_filter('editor', $plugins->getName());
				$editor=apply_filters('editor',1);
			}
		}

		if($editor==''){
			$editor='<textarea id="MCEname" name="MCEname" rows="15" cols="80" style="width: 100%">MCEcontent</textarea>';
		}

		$editor=str_replace('MCEname','content',$editor);
		$editor=str_replace('MCEcontent',MiceRestoreQuote('micefun',$results->getContent()),$editor);
			
		$smarty = new Smarty();
		$smarty->load_filter('pre','micePreCompileAdmin');
		$smarty->assign('results',$results);
		$smarty->assign('editor',$editor);
		$smarty->assign('index',MICE_URL.'admin.php/comment');
		$smarty->assign('formaction',MICE_URL.'admin.php/comment/update');
		$filename = new getTPLFileName(__CLASS__);
		$smarty->display($filename->TPLFileName);
	}
}
?>