<?php
class Normal_HtmlEdit extends netsControl {
	public function Normal_HtmlEdit(){
		$this->netsControl();
	}
	public function Control($pColumn){
		$tmpControl=$pColumn['stcotName'].'Txt'.$pColumn['NameExtend'];
		$tmpIntroduct='';
		if(strlen($pColumn['stcoctUiIntroduct'])>0 && $pColumn['stcoctUiIntroduct']!='&nbsp;'){
			$tmpIntroduct='<div id="'.$tmpControl.'_Messagebox" class="ControlIntroduct">'.$pColumn['stcoctUiIntroduct'].'</div>';
		}else{
			$tmpIntroduct='<div id="'.$tmpControl.'_Messagebox" class="DHidden">'.$pColumn['stcoctUiIntroduct'].'</div>';
		}
?>
<!-- #<?php echo ($tmpControl); ?> -->
<?php if ($pColumn['stcoctSingleLine']==0) { ?><tr id="<?php echo($tmpControl); ?>_RowBox" class="<?php echo ($pColumn['LineStyle']); ?>"><?php } ?>
<td id="<?php echo ($tmpControl); ?>_Label" class="PanelTitle"><?php echo ($pColumn['stcoctUiName']); ?>：</td>
<td id="<?php echo ($tmpControl); ?>PanelBox" class="PanelBox <?php if ($pColumn['stcoctSingleLine']==1) { ?>PanelMultiColumn<?php } ?>" <?php if ($pColumn['stcoctSingleLine']==0 && $pColumn['stcoctColspan']>1) { ?>colspan="<?php echo($pColumn['stcoctColspan']); ?>"<?php } ?>>
<!--S.<?php echo ($tmpControl); ?>-->
<?php
		if($this->sysFileConfig['HtmlEditorType']==0){
			//TextArea
?><textarea id="<?php echo($tmpControl); ?>" name="<?php echo($tmpControl); ?>" type="text" class="SControl1 ControlTextarea"
onclick="tmpControl.onControlLight(this,'ControlTextarea');<?php echo($pColumn['Parameter_JS_Onclick']); ?>"
onblur="tmpControl.onControlBlur(this,'ControlTextarea');<?php echo($pColumn['Parameter_JS_Onblur']); ?>"
onfocus="tmpControl.chooseCall('<?php echo ($pColumn['Parameter']); ?>',this);<?php echo($pColumn['Parameter_JS_Onfocus']); ?>"
onchange="<?php echo($pColumn['Parameter_JS_Onchange']); ?>"
onmouseover="<?php echo($pColumn['Parameter_JS_Onmouseover']); ?>"
onmouseout="<?php echo($pColumn['Parameter_JS_Onmouseout']); ?>"
style="<?php echo ($pColumn['ControlStyle']); ?>"><?php echo ($pColumn['Value']); ?></textarea><?php
		}else if($this->sysFileConfig['HtmlEditorType']==1){
			//NetsEditor
			$tmpEditor=new netsEditor();
			$tmpEditor->sName=$tmpControl;
			$tmpEditor->sModel='Normal';
			$tmpEditor->sValue=$pColumn['Value'];
			$tmpEditor->sBasePath=$this->sysFileConfig['sysCoreRoot'];
			$tmpEditor->Create($pColumn);
		}else if($this->sysFileConfig['HtmlEditorType']==2){
			//FCKEditor
			require($this->sysFileConfig['FCKEditorPath']);
			$oFCKeditor=new FCKeditor($pColumn['stcotName'].'Txt');
			$oFCKeditor->BasePath=$this->sysFileConfig['FCKEditorBasePath'];
			$oFCKeditor->Height='400px';
			$oFCKeditor->Value=$pColumn['Value'];
			$oFCKeditor->Create();
		}else if($this->sysFileConfig['HtmlEditorType']==3){
			//KindEditor
			?>
<script charset="utf-8" src="<?php echo($this->sysFileConfig['KindEditorBasePath']); ?>kindeditor.js"></script>
<script type="text/javascript">
KE.show({
	id : '<?php echo($tmpControl); ?>',
	cssPath : '<?php echo($this->sysFileConfig['KindEditorBasePath']); ?>index.css',
	afterCreate : function(id) {
		KE.event.ctrl(document, 13, function() {
			KE.util.setData(id);
			document.forms['<?php echo($this->sysPhpForm); ?>'].submit();
		});
		KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
			KE.util.setData(id);
			document.forms['<?php echo($this->sysPhpForm); ?>'].submit();
		});
	}
});
</script>
<textarea id="<?php echo($tmpControl); ?>" name="<?php echo($tmpControl); ?>" style="width:100%; height:400px; "><?php echo ($pColumn['Value']); ?></textarea>
			<?php
			
		}else if($this->sysFileConfig['HtmlEditorType']==4){
			//CKEditor
?><script type="text/javascript" src="<?php echo($this->sysFileConfig['CKEditorBasePath']); ?>ckeditor_basic.js"></script>
<textarea id="<?php echo($tmpControl); ?>" name="<?php echo($tmpControl); ?>" rows="18"><?php echo ($pColumn['Value']); ?></textarea>
<script type="text/javascript"> CKEDITOR.replace("<?php echo($tmpControl); ?>"); </script><?php
		}
?>
<?php echo ($tmpIntroduct); ?>
<!--sendRequest--><!--E.<?php echo ($tmpControl); ?>--></td>
<td id="<?php echo ($tmpControl); ?>_ImgIntroduct" class="PanelImgIntroduct">
<?php if(strlen($pColumn['stcoctUiImgIntroduct'])>0 && $pColumn['stcoctUiImgIntroduct']!='&nbsp;'){ ?>
<a href="#Here"><img src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_4.jpg" title="<?php echo($pColumn['stcoctUiImgIntroduct']); ?>" /></a>
<?php }else{ ?>&nbsp;<?php } ?></td><?php if ($pColumn['stcoctSingleLine']==0) { ?></tr><?php } ?>
<?php
	}
}
?>