Quote:
irmtfan wrote:
i bookmark this thread.
now the next question it how to change all textarea to tinyeditor?
Does this makes sense? To change ALL textarea to tinyeditor?
Here a short hack (not tested) which turns plain textareas to a reduced tinyeditor (reduced means has the same features as the standard dthml-editor):
Edit class/xoopsform/formtextarea.php and replace function render with this new function render:
le="color: #000000"><?php function render(){ $ret = ' <script language="javascript" type="text/javascript" src="'.XOOPS_URL.'/modules/tinyeditor/editor/tiny_mce.js"></script><script language="javascript" type="text/javascript"> tinyMCE.init({ mode : "textareas", editor_selector : "mceEditor", theme : "advanced", language : "en", convert_urls : false, theme_advanced_toolbar_align : "left", plugins : "ximagemanager,xcode,xquote,emotions", theme_advanced_toolbar_location : "top", theme_advanced_buttons1 : "link,unlink,image,ximagemanager,xcode,xquote,forecolor,bold,italic,strikethrough,emotions", theme_advanced_buttons2 : "fontsizeselect,fontselect", theme_advanced_buttons3 : "", valid_elements : "a[href|target=_blank],b,i,u,strike,font[face|size|color],img[src|align],p", width: "100%", height: "400px", cleanup: "true", debug : "false" });</script>'; $ret .= "<textarea name='".$this->getName()."' id='".$this->getName()."' rows='".$this->getRows()."' cols='".$this->getCols()."'".$this->getExtra()." style='width:100%; height:400px;' class='mceEditor'>".$this->getValue()." </textarea>"; return $ret; }
You can add more plugins and button. Good luck!