Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-21-2008, 09:28 PM
Junior Member
 
Join Date: Mar 2008
Posts: 15
Default FCKEditor in ZF installation problem

Hi,

I was trying to install the fckeditor with ZF. But I got an exception , looks like ZF is looking for a controller for that...

Unexpected Exception:
XXXController::editorAction() does not exist and was not trapped in __call()


Thanks for any help!

Last edited by iroy2000 : 03-21-2008 at 09:33 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-21-2008, 09:35 PM
Junior Member
 
Join Date: Mar 2008
Posts: 15
Default

LOL. I replied my own post.

The problem was solved, you need to turn off the rewrite engine in your fckeditor directory, and then specify your basepath when creating the fckeditor object. And it should work like a champ!!

So I leave the answer here just in case someone need it in the future ~~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-24-2008, 03:32 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

Thanks for coming back and adding the resolution. I'm sure others will find it very useful when google returns this thread for them.
__________________
- xentek
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-15-2008, 01:51 AM
Junior Member
 
Join Date: May 2008
Posts: 2
Default

Don't turn off the rewrite engine.
use this.
Step 1.
PHP Code:
RewriteEngine on
RewriteCond 
%{SCRIPT_FILENAME} !-f
RewriteCond 
%{SCRIPT_FILENAME} !-d
RewriteRule 
^(.*)$ index.php/$
if the file or directory exists on the server, the link will not be sent to index.php (mapping with controller or action will not be done if file/directory exists on server)

step .2
copy fckeditor to
/js/fckeditor
the str. will be
webroot/js/fckeditor/editor
where webroot (or public_html or htdocs or www) is root directory for external files

step. 3

in view.phtml (view file)
PHP Code:
<?php $this->headScript()->prependFile($this->baseUrl().'/js/fckeditor/fckeditor.js',$type='text/javascript'); ?>

<script type="text/javascript" >
    window.onload = function()
    {
        if(document.getElementById('content_text')) {
            var oFCKeditor = new FCKeditor('content_text') ;
            oFCKeditor.BasePath = "<?=$this->baseUrl()?>/js/fckeditor/" ;
            oFCKeditor.Height = 500;
            oFCKeditor.ReplaceTextarea() ;
        }
    }
</script>
step. 4

In layout.phtml you need to echo the headscript because we have added a headscript prepend file method.
PHP Code:
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?= $this->headTitle() ?>
   <link rel="stylesheet" type="text/css" media="screen"
             href="<?php echo $this->baseUrl();?>/css/style.css" />



<?= $this->headScript() ?>
</head>
caution:
document.getElementById('content_text')
in the view, the textarea has name='content_text' and id='content_text'
look for the name of text area which is to be replaced. You will know this as you give the name for textarea in zend_form.

The javascript will search of this id,
if found it will replace the textarea with fckeditor.

I find this useful because fckeditor.js is loaded only when required.


Step.5
for uploading images be sure to change the directory path in fckeditor/editor/filemanager/connectors/php/config.php

PHP Code:
// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/images/uploads/' 


I have tried to be as explanatory as possible.
If you encounter any problem, do ask.

Also, there are many different ways to do this. Don't get confused if you see any other method.

Last edited by zeus : 06-15-2008 at 01:53 AM. Reason: typo error
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:41 PM.