Voici une petite modification qui va permettre d'utiliser n'importe quel éditeur de xoops pour les articles de ce module à partir de la version 2.3 de xoops.
En bref, considérez cette modification comme un correctif de smartsection ^^
Il vous suffira de modifier que deux fichiers.
1- Modification du "xoops_version.php"
--- Emplacement : votresite/modules/smartsection/xoops_version.php
--- L'ouvrir et aller à la ligne 467:
$modversion['config'][$i]['options'] = array('DHTML-Editor' => 'default',
'Koivi Editor' => 'koivi',
'TinyEditor' => 'tiny',
'FCKEditor' => 'fckeditor',
'InBetween' => 'inbetween',
'HTMLArea' => 'htmlarea',
'Spaw Editor' => 'spaw');
$modversion['config'][$i]['default'] ='default';
--- Apporter la modification comme suit :
/*$modversion['config'][$i]['options'] = array('DHTML-Editor' => 'default',
'Koivi Editor' => 'koivi',
'TinyEditor' => 'tiny',
'FCKEditor' => 'fckeditor',
'InBetween' => 'inbetween',
'HTMLArea' => 'htmlarea',
'Spaw Editor' => 'spaw');
$modversion['config'][$i]['default'] ='default';
*/
xoops_load('XoopsEditorHandler');
$modversion['config'][$i]['options'] = array_flip( XoopsEditorHandler::getList() );
$modversion['config'][$i]['default'] ='dhtmltexarea';
--- Sauvegarder le fichier
2- Modification de "functions.php"
--- Emplacement : votresite/modules/smartsection/include/functions.php
--- L'ouvrir et aller à la ligne 293 (définition de la fonction "smartsection_getEditor")
--- Supprimer les lignes du switch
--- Coller ce qui suit
if( substr( XOOPS_VERSION , 6 , 3 ) < 2.3 ) {
switch ($smartConfig['use_wysiwyg']) {
case 'tiny' :
if (!$xoops22) {
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'));
} else {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}
} else {
$editor = new XoopsFormEditor($caption, "tinyeditor", $editor_configs);
}
break;
case 'inbetween' :
if (!$xoops22) {
if ( is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/inbetween/forminbetweentextarea.php")) {
include_once(XOOPS_ROOT_PATH . "/class/xoopseditor/inbetween/forminbetweentextarea.php");
$editor = new XoopsFormInbetweenTextArea(array('caption'=> $caption, 'name'=>$name, 'value'=>$value, 'width'=>'100%', 'height'=>'300px'),true);
} else {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}
} else {
$editor = new XoopsFormEditor($caption, "inbetween", $editor_configs);
}
break;
case 'fckeditor' :
if (!$xoops22) {
if ( is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/fckeditor/formfckeditor.php")) {
include_once(XOOPS_ROOT_PATH . "/class/xoopseditor/fckeditor/formfckeditor.php");
$editor = new XoopsFormFckeditor($editor_configs,true);
} else {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}
} else {
$editor = new XoopsFormEditor($caption, "fckeditor", $editor_configs);
}
break;
case 'koivi' :
if (!$xoops22) {
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 {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}
} else {
$editor = new XoopsFormEditor($caption, "koivi", $editor_configs);
}
break;
case "spaw":
if(!$xoops22) {
if (is_readable(XOOPS_ROOT_PATH . "/class/spaw/formspaw.php")) {
include_once(XOOPS_ROOT_PATH . "/class/spaw/formspaw.php");
$editor = new XoopsFormSpaw($caption, $name, $value);
} else {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}
} else {
$editor = new XoopsFormEditor($caption, "spaw", $editor_configs);
}
break;
case "htmlarea":
if(!$xoops22) {
if ( is_readable(XOOPS_ROOT_PATH . "/class/htmlarea/formhtmlarea.php")) {
include_once(XOOPS_ROOT_PATH . "/class/htmlarea/formhtmlarea.php");
$editor = new XoopsFormHtmlarea($caption, $name, $value);
} else {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}
} else {
$editor = new XoopsFormEditor($caption, "htmlarea", $editor_configs);
}
break;
default :
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
break;
}
}
else {
$editor = new XoopsFormEditor($caption, $smartConfig["use_wysiwyg"], $editor_configs, false);
}
--- Sauvegarder le fichier
3- Mettre à jour le module via l'interface admin de xoops
4- Allez dans les préférences de smartsection et sélectionner l'éditeur voulu.
N'oubliez pas que si vous ajoutez un nouvel éditeur après coups, il vous faudra mettre à jour smartsection pour la prise en compte de cet ajout.