/** * Prepare HTML for output * * @return string HTML */ public function render() { global $icmsConfigPlugins, $icmsConfigMultilang; $editor = FALSE; if ($this->htmlEditor && is_object($this->htmlEditor)) { if (!isset($this->htmlEditor->isEnabled) || $this->htmlEditor->isEnabled) { $editor = TRUE; } } if ($editor) { return $this->htmlEditor->render(); } $name = $this->getName(); $ele_name = $name . '_tarea'; $ret = "<a name='moresmiley'></a>" . "<img onmouseover='style.cursor=\"pointer\"' src='" . ICMS_URL . "/images/url.gif' alt='url' onclick='xoopsCodeUrl(\"" . $ele_name . "\", \"" . htmlspecialchars(_ENTERURL, ENT_QUOTES) . "\", \"" . htmlspecialchars(_ENTERWEBTITLE, ENT_QUOTES) . "\");' /> " . "<img onmouseover='style.cursor=\"pointer\"' src='" . ICMS_URL . "/images/email.gif' alt='email' onclick='javascript:xoopsCodeEmail(\"" . $ele_name . "\", \"" . htmlspecialchars(_ENTEREMAIL, ENT_QUOTES) . "\");' /> " . "<img onclick='javascript:xoopsCodeImg(\"" . $ele_name . "\", \"" . htmlspecialchars(_ENTERIMGURL, ENT_QUOTES) . "\", \"" . htmlspecialchars(_ENTERIMGPOS, ENT_QUOTES) . "\", \"" . htmlspecialchars(_IMGPOSRORL, ENT_QUOTES) . "\", \"" . htmlspecialchars(_ERRORIMGPOS, ENT_QUOTES) . "\");' onmouseover='style.cursor=\"pointer\"' src='" . ICMS_URL . "/images/imgsrc.gif' alt='imgsrc' /> " . "<img onmouseover='style.cursor=\"pointer\"' onclick='javascript:openWithSelfMain(\"" . ICMS_URL . "/modules/system/admin/images/browser.php?target=" . $ele_name . "&type=iman\",\"imgmanager\",985,470);' src='" . ICMS_URL . "/images/image.gif' alt='image' /> "; $jscript = ''; foreach ($icmsConfigPlugins['sanitizer_plugins'] as $key) { $extension = icms_core_DataFilter::loadExtension($key); $func = "render_{$key}"; if (function_exists($func)) { @(list($encode, $js) = $func($ele_name)); if (empty($encode)) { continue; } $ret .= $encode; } } $ret .= "<img src='" . ICMS_URL . "/images/code.gif' onmouseover='style.cursor=\"pointer\"' alt='code' onclick='javascript:xoopsCodeCode(\"" . $ele_name . "\", \"" . htmlspecialchars(_ENTERCODE, ENT_QUOTES) . "\");' /> " . "<img onclick='javascript:xoopsCodeQuote(\"" . $ele_name . "\", \"" . htmlspecialchars(_ENTERQUOTE, ENT_QUOTES) . "\");' onmouseover='style.cursor=\"pointer\"' src='" . ICMS_URL . "/images/quote.gif' alt='quote' /><br />\n"; $easiestml_exist = $icmsConfigMultilang['ml_enable'] == '1' && defined('EASIESTML_LANGS') && defined('EASIESTML_LANGNAMES'); if ($easiestml_exist) { $easiestml_langs = explode(',', EASIESTML_LANGS); $langlocalnames = explode(',', EASIESTML_LANGNAMES); $langnames = explode(',', $icmsConfigMultilang['ml_names']); $code = ''; $javascript = ''; foreach ($easiestml_langs as $l => $lang) { $ret .= "<img onclick='javascript:icmsCode_languages(\"" . $ele_name . "\", \"" . htmlspecialchars(sprintf(_ENTERLANGCONTENT, $langlocalnames[$l]), ENT_QUOTES) . "\", \"" . $lang . "\");' onmouseover='style.cursor=\"pointer\"' src='" . ICMS_URL . "/images/flags/" . $langnames[$l] . ".gif' alt='" . $langlocalnames[$l] . "' /> "; } $ret .= "<br />\n"; } $sizearray = array("xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"); $ret .= "<select id='" . $ele_name . "Size' onchange='setVisible(\"" . $this->_hiddenText . "\");setElementSize(\"" . $this->_hiddenText . "\",this.options[this.selectedIndex].value);'>\n"; $ret .= "<option value='SIZE'>" . _SIZE . "</option>\n"; foreach ($sizearray as $size) { $ret .= "<option value='{$size}'>{$size}</option>\n"; } $ret .= "</select>\n"; $fontarray = array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Tahoma", "Verdana"); $ret .= "<select id='" . $ele_name . "Font' onchange='setVisible(\"" . $this->_hiddenText . "\");setElementFont(\"" . $this->_hiddenText . "\",this.options[this.selectedIndex].value);'>\n"; $ret .= "<option value='FONT'>" . _FONT . "</option>\n"; foreach ($fontarray as $font) { $ret .= "<option value='{$font}'>{$font}</option>\n"; } $ret .= "</select>\n"; $colorarray = array("00", "33", "66", "99", "CC", "FF"); $ret .= "<select id='" . $ele_name . "Color' onchange='setVisible(\"" . $this->_hiddenText . "\");setElementColor(\"" . $this->_hiddenText . "\",this.options[this.selectedIndex].value);'>\n"; $ret .= "<option value='COLOR'>" . _COLOR . "</option>\n"; foreach ($colorarray as $color1) { foreach ($colorarray as $color2) { foreach ($colorarray as $color3) { $ret .= "<option value='" . $color1 . $color2 . $color3 . "' style='background-color:#" . $color1 . $color2 . $color3 . ";color:#" . $color1 . $color2 . $color3 . ";'>#" . $color1 . $color2 . $color3 . "</option>\n"; } } } $ret .= "</select><span id='" . $this->_hiddenText . "'>" . _EXAMPLE . "</span>\n"; $ret .= "<br />\n"; $ret .= "<img onclick='javascript:xoopsmake" . _GLOBAL_LEFT . "(\"" . $ele_name . "\", \"" . htmlspecialchars(defined('_ADM_USE_RTL') && _ADM_USE_RTL ? _ALRIGHTCON : _ALLEFTCON, ENT_QUOTES) . "\");' onmouseover='style.cursor=\"pointer\"' src='" . ICMS_URL . "/images/align" . _GLOBAL_LEFT . ".gif' alt='align" . _GLOBAL_LEFT . "' /> " . "<img onclick='javascript:xoopsmakecenter(\"" . $ele_name . "\", \"" . htmlspecialchars(_ALCENTERCON, ENT_QUOTES) . "\");' onmouseover='style.cursor=\"pointer\"' src='" . ICMS_URL . "/images/aligncenter.gif' alt='aligncenter' /> " . "<img onclick='javascript:xoopsmake" . _GLOBAL_RIGHT . "(\"" . $ele_name . "\", \"" . htmlspecialchars(defined('_ADM_USE_RTL') && _ADM_USE_RTL ? _ALLEFTCON : _ALRIGHTCON, ENT_QUOTES) . "\");' onmouseover='style.cursor=\"pointer\"' src='" . ICMS_URL . "/images/align" . _GLOBAL_RIGHT . ".gif' alt='align" . _GLOBAL_RIGHT . "' /> " . "<img onclick='javascript:setVisible(\"" . $this->_hiddenText . "\");makeBold(\"" . $this->_hiddenText . "\");' onmouseover='style.cursor=\"pointer\"' src='" . ICMS_URL . "/images/bold.gif' alt='bold' /> <img onclick='javascript:setVisible(\"" . $this->_hiddenText . "\");makeItalic(\"" . $this->_hiddenText . "\");' onmouseover='style.cursor=\"pointer\"' src='" . ICMS_URL . "/images/italic.gif' alt='italic' /> <img onclick='javascript:setVisible(\"" . $this->_hiddenText . "\");makeUnderline(\"" . $this->_hiddenText . "\");' onmouseover='style.cursor=\"pointer\"' src='" . ICMS_URL . "/images/underline.gif' alt='underline' /> <img onclick='javascript:setVisible(\"" . $this->_hiddenText . "\");makeLineThrough(\"" . $this->_hiddenText . "\");' src='" . ICMS_URL . "/images/linethrough.gif' alt='linethrough' onmouseover='style.cursor=\"pointer\"' /> <input type='text' id='" . $ele_name . "Addtext' size='20' /> <input type='button' onclick='xoopsCodeText(\"" . $ele_name . "\", \"" . $this->_hiddenText . "\", \"" . htmlspecialchars(_ENTERTEXTBOX, ENT_QUOTES) . "\")' class='formButton' value='" . _ADD . "' /><br /><br />" . "<textarea id='" . $ele_name . "" . "' name='" . $name . "' onselect=\"xoopsSavePosition('" . $ele_name . "');\"" . "' onclick=\"xoopsSavePosition('" . $ele_name . "');\"" . "' onkeyup=\"xoopsSavePosition('" . $ele_name . "');\"" . "' cols='" . $this->getCols() . "' rows='" . $this->getRows() . "'" . $this->getExtra() . ">" . $this->getValue() . "</textarea><br />\n"; $ret .= $this->_renderSmileys(); return $ret; }
/** * Starts HTML Purifier (from icms.htmlpurifier class) * * @param string $name Name of the extension to load * @return bool */ public function icmsloadExtension($name) { icms_core_Debug::setDeprecated('icms_core_DataFilter::loadExtension', sprintf(_CORE_REMOVE_IN_VERSION, '1.4')); return icms_core_DataFilter::loadExtension($name); }