Of course it is possible. You can turn any dhtml-textarea into WYSIWYG. In fact it is not so hard to realize. I post here a few lines of code. Of course you have to adapt it to catads. It's not too complicated.
Step 1: Edit xoops_version.php. Look where $modversion['config'] is located. I don't know if an array for config is used (like my example) or it is numbered.
$modversion['config'][] = array(
'name' => 'use_wysiwyg',
'title' => '_MI_DEBASER_FORM_OPTIONS',
'description' => '',
'formtype' => 'select',
'valuetype' => 'text',
'default' => 'textarea',
'options' => array( 'Plain Editor' => 'textarea', 'XoopsEditor' => 'dhtmltextarea', 'TinyMCE' => 'tinymce', 'FCK Editor' => 'FCKeditor', 'Koivi Editor' => 'koivi', 'Spaw' => 'spaw', 'TinyEditor' => 'tinyeditor' ));
Step 2: catads has a functions.php? If not, create it and insert the following code
function &get_wysiwygcatads($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental='')
{
global $xoopsModuleConfig, $xoopsConfig;
$editor = false;
$editor_configs = array();
$editor_configs['name'] = $name;
$editor_configs['value'] = $value;
$editor_configs['rows'] = 35;
$editor_configs['cols'] = 60;
$editor_configs['width'] = '100%';
$editor_configs['height'] = '400px';
switch($xoopsModuleConfig['use_wysiwyg']) {
case 'spaw':
if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/spaw/formspaw.php')) {
include_once(XOOPS_ROOT_PATH . '/class/xoopseditor/spaw/formspaw.php');
$editor = new XoopsFormSpaw($caption, $name, $value);
}
break;
case 'FCKeditor':
if ( is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/fckeditor/formfckeditor.php')) {
include_once(XOOPS_ROOT_PATH . '/class/xoopseditor/fckeditor/formfckeditor.php');
$editor = new XoopsFormFckeditor($caption, $name, $value);
}
break;
case 'htmlarea':
if ( is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/htmlarea/formhtmlarea.php')) {
include_once(XOOPS_ROOT_PATH . '/class/xoopseditor/htmlarea/formhtmlarea.php');
$editor = new XoopsFormHtmlarea($caption, $name, $value);
}
break;
case 'dhtmltextarea':
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 10, 50, $supplemental);
break;
case 'textarea':
$editor = new XoopsFormTextArea($caption, $name, $value);
break;
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;
case 'tinymce':
if ( is_readable(XOOPS_ROOT_PATH.'/class/xoopseditor/tinymce/formtinymce.php')) {
include_once XOOPS_ROOT_PATH.'/class/xoopseditor/tinymce/formtinymce.php';
$editor = new XoopsFormTinymce(array('caption'=> $caption, 'name'=>$name, 'value'=>$value, 'width'=>'100%', 'height'=>'400px'));
}
break;
case 'koivi':
if ( is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/koivi/formkoivi.php')) {
include_once(XOOPS_ROOT_PATH . '/class/xoopseditor/koivi/formkoivi.php');
$editor = new XoopsFormKoivi($caption, $name, $value, '100%', '450px', '');
}
break;
}
return $editor;
}
Step 3: locate any place in catads where XoopsFormDhtmlTextArea occurs. Could look like this:
$pmform->addElement(new XoopsFormDhtmlTextArea('', 'message', $message, 8, 37), true);
and replace it with:
$pmform->addElement(get_wysiwygcatads('', 'message', $message, 15, 60), true);
Make sure, that the functions.php is included and adapt the variables and formelement names.
Step 4: Update the module, go to preferences and pick up the editor of your choice.
good luck
oops: forgot something. You also have to locate the places where the output is rendered, normally this done with displayTarea. Have a look at this function and change the code according in catads.
I added some extra code to the header.php for my module to make it easier to change the settings for displayTarea automatically depending on the selected editor:
$wysiwyg_editor = array('tinymce', 'tinyeditor', 'koivi', 'FCKeditor', 'spaw');
if (!in_array($xoopsModuleConfig['use_wysiwyg'], $wysiwyg_editor)) {
$html = 0;
$dobr = 1;
} else {
$html = 1;
$dobr = 0;
}