+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: FCKEditor in ZF installation problem

  1. #1
    iroy2000 is offline Junior Member
    Join Date
    Mar 2008
    Posts
    16

    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.

  2. #2
    iroy2000 is offline Junior Member
    Join Date
    Mar 2008
    Posts
    16

    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 ~~

  3. #3
    xentek is offline 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.

  4. #4
    zeus is offline Junior Member
    Join Date
    May 2008
    Posts
    2

    Default

    Don't turn off the rewrite engine.
    use this.
    Step 1.
    [PHP]
    RewriteEngine on
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1
    [/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]
    <?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>

    [/PHP]

    step. 4

    In layout.phtml you need to echo the headscript because we have added a headscript prepend file method.
    [PHP]
    <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>
    [/PHP]

    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]// Path to user files relative to the document root.
    $Config['UserFilesPath'] = '/images/uploads/' ;[/PHP]



    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

  5. #5
    raghuvaran is offline Junior Member
    Join Date
    Sep 2008
    Posts
    3

    Question Not getting Answer

    hi Zeus

    I have followed ur steps. but, still i am having doubts and getting errors.

    1)as like step 1. i used ur code in .htacess file.

    2)i have put the fckeditor inside js folder (C:\xampp\htdocs\js\fckeditor)Note i am using "xamp"

    3)In step 5. i am getting doubts. In config.php file i have given like this:

    $Config['Enabled'] = true ;
    $Config['UserFilesPath'] = '/images/uploads/' ; (Is it ok)

    what is the use of "uploads" folder.
    there is no folder like "uploads". before, in image folder.
    I have created and given the path in config.php
    note: nothing inside the folder "uploads" ( what should come inside)

    Please reply me.
    Advance Thanks...

  6. #6
    raghuvaran is offline Junior Member
    Join Date
    Sep 2008
    Posts
    3

    Default Not getting Result

    hi Zeus

    I have followed ur steps. but, still i am having doubts and getting errors.

    1)as like step 1. i used ur code in .htacess file.

    2)i have put the fckeditor inside js folder (C:\xampp\htdocs\js\fckeditor)Note i am using "xamp"

    3)In step 5. i am getting doubts. In config.php file i have given like this:

    $Config['Enabled'] = true ;
    $Config['UserFilesPath'] = '/images/uploads/' ; (Is it ok)

    what is the use of "uploads" folder.
    there is no folder like "uploads". before, in image folder.
    I have created and given the path in config.php
    note: nothing inside the folder "uploads" ( what should come inside)

    Please reply me.
    Advance Thanks...

  7. #7
    raghuvaran is offline Junior Member
    Join Date
    Sep 2008
    Posts
    3

    Default I Got it

    hi Zeus,
    I got it, I made mistake in path. i given the path correctly.

    now its working properly.

    Thank You,
    Bye...

  8. #8
    tsk
    tsk is offline Junior Member
    Join Date
    Oct 2008
    Location
    Vaals / NL
    Posts
    6

    Default View Helper for FCKeditor

    Hello,

    thank you very much for the information about how to use the Javascript version of FCKeditor within Zend Form. I would prefer to use the php connector of FCKeditor, mainly to get rid of the Javascript code in the view files and to get more comfortable control over the settings.

    To start with I wrote a View Helper which is wrapping the editor.

    [PHP]<?php
    class Zend_View_Helper_FckEditor
    {
    /**
    * Creates a form element with FCKEditor.
    *
    * @param string $name The form element name to be used with FCKeditor
    * @param string $value The form element initial value (like: Enter content here)
    * @param array $options (FCKeditor options)
    */

    protected $_view;

    // setView() function is automatically called by the view before calling the main helper function.
    function setView($view)
    {
    $this->_view = $view;
    }

    public function fckEditor($name = '', $value = '', $options = array())
    {
    $baseUrl = $this->_view->BaseUrl();

    // can be auto-loaded from a non-public library dir
    // FCKeditor.php = renamed fckeditor_php(4|5).php
    include_once 'fckeditor/FCKeditor.php';

    $oFCKeditor = new FCKeditor($name);

    // Custom configuration settings
    // Place in it's own Dir to allow updates of FCKeditor w/o changes
    $oFCKeditor->Config['CustomConfigurationsPath'] = $baseUrl . '/js/configs/myFCKconfig.js';

    // Default configuration
    $oFCKeditor->BasePath = $baseUrl . '/js/fckeditor/'; // must direct to the site's public area
    $oFCKeditor->ToolbarSet = ((isset($options['ToolbarSet'])) ? $options['ToolbarSet'] : 'Tsc_mighty');
    $oFCKeditor->Width = empty($options['Width']) ? '100%' : $options['Width'];
    $oFCKeditor->Height = empty($options['Height']) ? 500 : $options['Height'];
    $oFCKeditor->Value = $value;

    return $oFCKeditor->Create();
    }
    }[/PHP]

    It can be used as is as long as you are not using Zend Form. In your view files just type:

    <?php echo $this->fckEditor('page_content'); ?>
    (replace ‘page_content’ with your field name of the element)
    and the editor will appear.

    Now to my problem: How can I use my Helper within a Zend Form Textarea element? In the JavaScript version this is achieved by replacing the element onload. How do I get the editor in my Zend Form element textarea? Do I have to extend the Zend_View_Helper_FormElement or do I even have to understand the ‘Marsian’ explanations about the decorators? Which would be the best approach to get a tighter integration with Zend Form?

    TIA

    Thomas

    p.s. excuse my english. I'm a german living in Holland

  9. #9
    ashok is offline Junior Member
    Join Date
    Feb 2009
    Location
    India, Chennai
    Posts
    1

    Default Uploading image path problem

    Hai Ragu & Zeus

    I have done everything perfectly. But while uploading image there seems to have some problem with the path . Whem clicking the upload image icon it will open the Image Properties Window . From there when i click the Browse Server button it will open the next window but with some alert error "Error creating folder "redirect:/bitrix/urlrewrite.php/" (Can't create redirect: directory)" ...

    Please provide me some solution....

    Many Thanks Zeus & Ragu

  10. #10
    mobius is offline Junior Member
    Join Date
    Nov 2008
    Posts
    6

    Default

    It would be wise to add some sort of validation on your PHP connector to avoid somebody exploiting fckeditor connector to upload malicious files on your server.

    You could add something like:

    Code:
    session_start();
    
    if( !isset($_SESSION['Zend_Auth']['storage']) || (!isset($_SESSION['Zend_Auth']['storage']->administrator)) ) {
            return false;
    }
    into fckeditor/editor/filemanager/connector/php/config.php where you verify something from the Zend_Auth validator.

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Problem with zend framework installation on XAMPP
    By farazch in forum General Q&A on Zend Framework
    Replies: 0
    Last Post: 02-15-2010, 02:15 PM
  2. zf.sh installation problem!
    By FnTm in forum General Q&A on Zend Framework
    Replies: 0
    Last Post: 07-09-2009, 11:35 AM
  3. ZF installation problem
    By dizyn in forum Installation & Configuration
    Replies: 2
    Last Post: 03-31-2009, 06:36 AM
  4. Integrating FCKEditor with Zend_Form
    By Julian999 in forum General Q&A on Zend Framework
    Replies: 0
    Last Post: 11-12-2008, 03:55 PM
  5. pdo driver installation
    By sawatdee in forum Databases
    Replies: 1
    Last Post: 03-12-2008, 01:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts