/** * Constructor * * @access public * @param object Registry object * @return @e void */ public function __construct() { return parent::__construct(); }
/** * Takes content from the DB and processes before it gets to the editor * * @param string $html * @return string */ public function htmlToEditor($html) { $html = $this->_processNoParseCodes($html, 1, true); /* Don't attempt to convert manually entered CODE and QUOTE as this can come from a preview where someone has entered * manual tags in the RTE and breaks because this below fires up the legacy parser which expects <br> and not PRE linebreaks, etc * And also they can retain the manual tags they entered. */ if (!$this->lang->isRtl()) { /* RTL tries to move square brakcets around */ $html = str_ireplace('[code', '<!--open:code-->', $html); $html = str_ireplace('[quote', '<!--open:quote-->', $html); $html = str_ireplace('[url', '<!--open:url-->', $html); $html = str_ireplace('[img', '<!--open:img-->', $html); } /* Editing an older post? */ if ($this->isBBCode($html)) { self::$NoBBCodeAutoLinkify = true; $html = $this->BBCodeToHtml($html); self::$NoBBCodeAutoLinkify = false; } $html = str_replace('<!--open:code-->', '[code', $html); $html = str_replace('<!--open:quote-->', '[quote', $html); $html = str_replace('<!--open:url-->', '[url', $html); $html = str_replace('<!--open:img-->', '[img', $html); /* Dollar signs confuse CKEditor */ $html = str_replace('$', '$', $html); /* We want to restore CODE boxes */ if (preg_match('#<pre\\s+?class=["\']_prettyXprint#i', $html) and self::$Perms['parseHtml']) { $html = $this->preToCode($html); } /* ARGH MY EYES ARGH MY EYES SOMEONE DID A BAD WORD */ $html = $this->parseBadWords($html); /* Make sure no parse tags are correct */ $html = $this->_processNoParseCodes($html, 2); $html = $this->_processNoParseCodes($html, 3); return $html; }