📄 _fckeditor.php
字号:
<?php
require_once("HTML/QuickForm/element.php");
class HTML_QuickForm_fckeditor extends HTML_QuickForm_element
{
var $_value = null;
function HTML_QuickForm_fckeditor($elementName=null, $elementLabel=null,$attributes=null)
{
HTML_QuickForm_element::HTML_QuickForm_element($elementName,$elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'fckeditor';
} //end constructor
function setName($name)
{
$this->updateAttributes(array('name'=>$name));
} //end func setName
//--------------------------------------
function getName()
{
return $this->getAttribute('name');
} //end func getName
//---------------------------------------------
function setValue($value)
{
$this->_value = $value;
}
//---------------------------------------------------------------
function getValue()
{
return $this->_value;
}
//----------------------------------------------------------------
function toHtml()
{
if ($this->_flagFrozen)
{
return $this->getFrozenHtml();
}
else
{
require_once("./fckeditor/fckeditor.php");
$fck = new FCKeditor('FCKeditor1');
if(isset($this->_attributes['basepath'])) $fck->BasePath =
$this->_attributes['basepath'];
//if(isset($this->_attributes['skin'])) $fck->Config['SkinPath'] =
$fck->BasePath."editor/skins/".$this->_attributes['skin']."/";
if(isset($this->_attributes['toolbarset']))
$fck->ToolbarSet=$this->_attributes['toolbarset'];
if(isset($this->_attributes['height']))
$fck->Height=$this->_attributes['height'];
else
$fck->Height="200";
if(isset($this->_attributes['width']))
$fck->Width=$this->_attributes['width'];
else
$fck->Width="100%";
$fck->Value=$this->_value;
$output = $fck->CreateHtml();
return $this->_getTabs() .$output;
}
} //end func toHtml
function getFrozenHtml()
{
$value = htmlspecialchars($this->getValue());
if ($this->getAttribute('wrap') == 'off')
{
$html = $this->_getTabs() . '<pre>' . $value."</pre>\n";
}
else
{
$html = nl2br($value)."\n";
}
return $html . $this->_getPersistantData();
} //end func getFrozenHtml
}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -