Ok, after hours of searching and trying out different things, I don't have any more clue why this isn't working:
On a page, I have two sections. First, a WYSIWYG section, where I put in a page title and some text.
After that, I inserted a section of a module I have written myself, where I have a textfield which I want to edit also with a WYSIWYG editor.
The problem is, that the second WYSIWYG editor is not loaded onto the textfield.
In my module, the code to instantiate the WYSIWYG editor looks like this:
<?php
if(!isset($wysiwyg_editor_loaded)) {
$wysiwyg_editor_loaded=true;
if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) {
function show_wysiwyg_editor($name,$id,$content,$width,$height) {
echo '<textarea name="'.$name.'" id="'.$id.'" rows="10" cols="1" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
}
} else {
if (!isset($id_list)) {
$id_list = array();
}
array_push($id_list,'beschreibung');
require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
}
}
?>
Then I want to load the editor with the following:
<?php
show_wysiwyg_editor('astBeschreibung','beschreibung',$row['astBeschreibung'],'300px','300px');
?>
I have already done this with other modules and it worked just fine. I think it's because of the first section, where the WYSIWYG editor is loaded, that it doesn't want to work.
I made a print_r(); on the $id_list and there wasn't any "beschreibung" in the array.
So I took the array_push($id_list,'beschreibung'); out of the the if:
<?php
if(!isset($wysiwyg_editor_loaded)) {
$wysiwyg_editor_loaded=true;
if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) {
function show_wysiwyg_editor($name,$id,$content,$width,$height) {
echo '<textarea name="'.$name.'" id="'.$id.'" rows="10" cols="1" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
}
} else {
if (!isset($id_list)) {
$id_list = array();
}
array_push($id_list,'beschreibung');
require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
}
}
array_push($id_list,'beschreibung');
print_r($id_list);
?>
and then the result of $id_list was the following:
Array( [0] => content56 [1] => beschreibung )
I think that's fine, but the second WYSIWYG editor still doesn't load.
There are no javascript errors. I'm currently using TinyMCE 3.393 and Websitebaker 2.8.1.
Anyone can help?
Thanks in advance.