public function render() { // $this->initHeader(); $ret = ' <script type="text/javascript"> $(document).ready(function() { $("#' . $this->getName() . '").rheditor()[0].focus(); }); </script> '; $ret .= parent::render(); return $ret; }
/** * Prepare HTML for output * * @return string HTML */ public function render() { if ($this->htmlEditor && is_object($this->htmlEditor)) { if (!isset($this->htmlEditor->isEnabled) || $this->htmlEditor->isEnabled) { return $this->htmlEditor->render(); } } static $js_loaded; $xoops = \Xoops::getInstance(); $extra = $this->getExtra() != '' ? " " . $this->getExtra() : ''; $ret = ""; // actions $ret .= $this->codeIcon() . "<br />\n"; // fonts $ret .= $this->fontArray(); // length checker $ret .= "<input type='button' class='btn' onclick=\"XoopsCheckLength('" . $this->getName() . "', '" . @$this->configs['maxlength'] . "', '" . \XoopsLocale::F_CURRENT_TEXT_LENGTH . "', '" . \XoopsLocale::MAXIMUM_LENGTH . "');\" value=' ? ' title='" . \XoopsLocale::CHECK_TEXT_LENGTH . "' />"; $ret .= "<br />\n"; // the textarea box $this->suppressRender(['value']); $this->themeDecorateElement(); $attributes = $this->renderAttributeString(); $ret .= '<textarea ' . $attributes . $extra . '>' . $this->getValue() . "</textarea><br />\n"; if (empty($this->skipPreview)) { if (!$xoops->theme()) { $this->js .= implode("", file($xoops->path('media/xoops/image.js'))); } else { $xoops->theme()->addScript('media/xoops/image.js', array('type' => 'text/javascript')); } $button = "<input id='" . $this->getName() . "_preview_button' " . "type='button' " . "class='btn' value='" . \XoopsLocale::A_PREVIEW . "' " . "onclick=\"form_instantPreview('" . XOOPS_URL . "', '" . $this->getName() . "','" . XOOPS_URL . "/images', " . (int) $this->doHtml . ", '" . $xoops->security()->createToken() . "')\"" . " />"; $ret .= "<br />" . "<div id='" . $this->getName() . "_hidden' style='display: block;'> " . "<fieldset>" . "<legend>" . $button . "</legend>" . "<div id='" . $this->getName() . "_hidden_data'>" . \XoopsLocale::CLICK_PREVIEW_TO_SEE_CONTENT . "</div>" . "</fieldset>" . "</div>"; } // Load javascript if (empty($js_loaded)) { $javascript = ($this->js ? '<script type="text/javascript">' . $this->js . '</script>' : '') . '<script type="text/javascript" src="' . \XoopsBaseConfig::get('url') . '/include/formdhtmltextarea.js"></script>'; $ret = $javascript . $ret; $js_loaded = true; } return $ret; }
/** * prepare HTML for output * * @return string HTML */ public function render() { $ret = $this->editor->render(); $ret .= parent::render(); return $ret; }