_persistantFreeze = true;
$this->_type = 'html_editor';
//$editor = Container::getHtmlEditor();
$editor = new CkEditor();
if ($editor) {
$this->editor = $editor;
$this->editor->setName($name);
$this->editor->processConfig($config);
}
}
/**
* Return the HTML editor in HTML
* @return string
*/
public function toHtml()
{
$value = $this->getValue();
if ($this->editor) {
if ($this->editor->getConfigAttribute('fullPage')) {
if (strlen(trim($value)) == 0) {
// TODO: To be considered whether here to be added DOCTYPE,
// language and character set declarations.
$value = '
';
$this->setValue($value);
}
}
}
if ($this->isFrozen()) {
return $this->getFrozenHtml();
} else {
$styleCss = $this->editor->getConfigAttribute('style');
if ($styleCss) {
$style = true;
} else {
$style = false;
}
return $this->buildEditor($style);
}
}
/**
* Returns the html area content in HTML
* @return string
*/
public function getFrozenHtml()
{
return $this->getValue();
}
/**
* @param bool $style
*
* @return string
*/
public function buildEditor($style = false)
{
$result = '';
if ($this->editor) {
$this->editor->value = $this->getValue();
$this->editor->setName($this->getName());
if ($style == true) {
$result = $this->editor->createHtmlStyle();
} else {
$result = $this->editor->createHtml();
}
}
return $result;
}
}