Régulier
Inscrit: 22/09/2006 11:34
|
mon probleme n'est pas tout à fait identique....j'avais bien frameworks à jour...voilà ce qu'il y a dans l'onglet "aide "du module:
If you're using an "old" version of Xoops (< 2.2) you can still use tinyeditor with your modules In this case only a few changes to some of your module's files are required. Following is a sample of integration with an old News module: In your favourite text editor open the file XOOPS_ROOT_PATH/modules/news/include/storyform.inc.php about line 35 add the following line include_once XOOPS_ROOT_PATH . "/class/xoopseditor/tinyeditor/formtinyeditortextarea.php"; Make sure this is the last file to be included
Then move on and replace the lines which render the textareas with $sform->addElement(new XoopsFormtinyeditorTextArea(array('caption'=> _NW_THESCOOP, 'name'=>'hometext', 'value'=>$hometext, 'width'=>'100%', 'height'=>'400px'),true)); for the Scoop text and $sform->addElement(new XoopsFormtinyeditorTextArea(array('caption'=> _AM_EXTEXT, 'name'=>'bodytext', 'value'=>$bodytext, 'width'=>'100%', 'height'=>'400px'),false)); for the Extended text That's all! Unfortunately this is not all! Here is a short description of how to make "new" modules work with tinyeditor that were designed for the xoopseditor framework
We take the new news-module as example. Koivi was the first editor that was used for the xoopseditor framework. So lets search for occurrances of koivi to mimic this to make tinyeditor work
Open xoops_version.php and look for this array (may vary):
array(_MI_NEWS_FORM_DHTML=>'dhtml', _MI_NEWS_FORM_COMPACT=>'textarea', _MI_NEWS_FORM_SPAW=>'spaw', _MI_NEWS_FORM_HTMLAREA=>'htmlarea', _MI_NEWS_FORM_KOIVI=>'koivi', _MI_NEWS_FORM_FCK=>'fck'); and change this to:
array(_MI_NEWS_FORM_DHTML=>'dhtml', _MI_NEWS_FORM_COMPACT=>'textarea', _MI_NEWS_FORM_SPAW=>'spaw', _MI_NEWS_FORM_HTMLAREA=>'htmlarea', _MI_NEWS_FORM_KOIVI=>'koivi', _MI_NEWS_FORM_FCK=>'fck', 'tinyeditor'=>'tinyeditor'); Now open include/functions.php and look for:
case "koivi": if(!$x22) { if ( is_readable(XOOPS_ROOT_PATH . "/class/wysiwyg/formwysiwygtextarea.php")) { include_once(XOOPS_ROOT_PATH . "/class/wysiwyg/formwysiwygtextarea.php"); $editor = new XoopsFormWysiwygTextArea($caption, $name, $value, '100%', '400px', ''); } } else { $editor = new XoopsFormEditor($caption, "koivi", $editor_configs); } break; After this insert these lines:
case "tinyeditor": if ( is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/tinyeditor/formtinyeditortextarea.php")) { include_once(XOOPS_ROOT_PATH . "/class/xoopseditor/tinyeditor/formtinyeditortextarea.php"); $editor = new XoopsFormtinyeditorTextArea(array('caption'=>$caption, 'name'=>$name, 'value'=>$value, 'width'=>'100%', 'height'=>'400px')); } break; Update the news-module and you are done (hopefully). Now you have a good example on how to implement tinyeditor in other modules.
-------------------------------------------------------------------------------- a premiere vue faut modifier pas mal de fichiers.....où alots j'ai rien pigé..
Posté le : 21/10/2006 16:14
|