| Index
» Projects
» phpMyEdit
» Forum
» FCKeditor and phpMyEdit |
 |
Rod
Joined: 28 Jun 2005
Posts: 4
Posted: 2005-12-08 00:29
Back to top
Reply with quote
|
Don't know if this is of use, but I really wanted to integrate FCKeditor with phpMyEdit and found a nice quick way to do it.
1) Define a phpMyEdit HTML <textarea> as usual
2) Install FCKeditor
3) Use the JavaScript which instantiates the editor and replaces your textarea field:
<script type="text/javascript" src="FCKeditor/fckeditor.js"></script>
<script type="text/javascript">
var EditAb; EditAb = false;
window.onload = function() {
// test for <textarea> element before creating editor
if (document.getElementById('doc_body')) {
var oFCKeditor = new FCKeditor('doc_body') ;
oFCKeditor.ReplaceTextarea() ;
}
}
</script>
3) The textarea field here is called "doc_body". The trick is that phpMyEdit has to generate an ID tag called "doc_body" in the <textarea> element or it won't work. To fix this, I changed 2 lines in the library in the add and change textarea functions:
//echo '<textarea class="',$css_class_name,'" name="',$this->fds[$k],'"';
becomes:
echo '<textarea id="',$this->fds[$k],'" class="',$css_class_name,'" name="',$this->fds[$k],'"';
This adds an ID tag with the same name as the field name to the <textarea> element. The real solution would be to add "id" as an optional tag for <textarea> -- if not for all regular fields.
Anyhow this simple hack works, but an official change in the library would be better. What do you think? Apologies if this has been done before -- I couldn't find it on the site if it did.
Cheers,
Rod
|
ajh
Joined: 17 Dec 2003
Posts: 236
Posted: 2005-12-08 14:22
Back to top
Reply with quote
|
Have you looked at the mce_cal extension in the CVS? This integrates TinyMCE as an editor into phpMyEdit. I originally started out looking at FCKEditor, but it doesn't behave nicely when you use it with PME's tab feature.
Note...if you use the extension, you will need the CVS version of PME.
|
Rod
Joined: 28 Jun 2005
Posts: 4
Posted: 2005-12-08 15:46
Back to top
Reply with quote
|
Yes we started with TinyMCE, but I like some of the features in FCKEditor. This particular app doesn'n need tabs, but that is good to know for the future. Thanks.
| ajh wrote: |
Have you looked at the mce_cal extension in the CVS? This integrates TinyMCE as an editor into phpMyEdit. I originally started out looking at FCKEditor, but it doesn't behave nicely when you use it with PME's tab feature.
Note...if you use the extension, you will need the CVS version of PME. |
|
guppy
Joined: 17 Mar 2009
Posts: 9
Posted: 2009-03-19 14:23
Back to top
Reply with quote
|
I tested your solution but it didn't work for me.
In the records I tried everything was deleted if the field was textarea. I would prefer FCKeditor too because it is born with the file/image browser.
|
|
Post new topic
Reply to topic
|
|
|
|