| Index
» Projekty
» phpMyEdit
» Fórum
» FCKeditor and phpMyEdit |
 |
Rod
Založený: 28.06.2005
Príspevky: 4
Zaslal: 2005-12-08 00:29
Návrat hore
Odpovedať s citátom
|
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
Založený: 17.12.2003
Príspevky: 236
Zaslal: 2005-12-08 14:22
Návrat hore
Odpovedať s citátom
|
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
Založený: 28.06.2005
Príspevky: 4
Zaslal: 2005-12-08 15:46
Návrat hore
Odpovedať s citátom
|
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 Napísal: |
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
Založený: 17.03.2009
Príspevky: 9
Zaslal: 2009-03-19 14:23
Návrat hore
Odpovedať s citátom
|
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.
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|