Development

#185 (FCKEditor in Form helpers)

You must first sign up to be able to contribute.

Ticket #185 (closed enhancement: fixed)

Opened 6 years ago

Last modified 6 years ago

FCKEditor in Form helpers

Reported by: adrive Assigned to:
Priority: trivial Milestone:
Component: Version: 0.7.X
Keywords: fckeditor textarea Cc:
Qualification:

Description

I need FCKEditor integrated into symfony as rich text browser, so I modify textarea_tag in FormHelper?.php to integrate FCKEditor. It is full compatible with TinyMCE, so you can choose which editor you want to use.

How to install 1. copy fckeditor into your web_dir/js/fckeditor 2. add all .setttings rich_text_fck_js_dir: js/fckeditor into your settings file 3. apply attached patch to symfony/helpers/FormHelper.php

How to use: I create new options like "width", "height", if they are not set, and only rows and cols are set, rows and cols are counted into pixels. 1 row/col has 10 pixles.

New option tool to choose between your FCKEditor toolbars.

Can you integrate my patch into next release of symfony?

Attachments

FormHelper.patch (2.8 kB) - added by adrive on 02/07/06 16:54:09.
FormHelper? patch integrates FCKEditor into symfony
FormHelper.php (15.4 kB) - added by adrive on 02/07/06 16:58:03.
File with my patch from revision 757

Change History

02/07/06 16:54:09 changed by adrive

  • attachment FormHelper.patch added.

FormHelper? patch integrates FCKEditor into symfony

02/07/06 16:58:03 changed by adrive

  • attachment FormHelper.php added.

File with my patch from revision 757

02/08/06 08:15:32 changed by hulvat

Helou. Good idea adrive! I use so FCKeditor, i hope this patch will be incorporated into the next version.

02/08/06 10:45:42 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

fixed in r770.

02/23/06 05:32:59 changed by tamcy

  • version changed from 0.5.X to 0.6.0.

292 $fckeditor->BasePath? = DIRECTORY_SEPARATOR.sfConfig::get('sf_rich_text_fck_js_dir').DIRECTORY_SEPARATOR;

Basepath is the base url to load the editor, it is not a local path. Using DIRECTORY_SEPARATOR causes a 404 error in windows platform. I sugget to change it to

'/'.sfConfig::get('sf_rich_text_fck_js_dir').'/';

02/23/06 05:36:54 changed by tancy

Sorry, it's the first time I use this ticket system and didn't realize to use the preview feature. My suggestion is changing line 292 to

    $fckeditor->BasePath = '/'.sfConfig::get('sf_rich_text_fck_js_dir').'/';

04/19/06 07:08:28 changed by anonymous

  • status changed from closed to reopened.
  • type changed from enhancement to defect.
  • version changed from 0.6.0 to 0.6.1.
  • resolution deleted.

The issue with the DIRECTORY_SEPARATOR on Windows platform is still there.

This around line 333 in FormHelper?.php version 0.6.1

$fckeditor->BasePath = DIRECTORY_SEPARATOR.sfConfig::get('sf_rich_text_fck_js_dir').DIRECTORY_SEPARATOR;

needs to be changed to:

$fckeditor->BasePath = '/'.sfConfig::get('sf_rich_text_fck_js_dir').'/';

because BasePath? is not a local path, it's a part of an URL

04/19/06 13:00:32 changed by fabien

  • status changed from reopened to closed.
  • resolution set to fixed.

fixed in r1227.

04/20/06 05:22:34 changed by joey.cai@gmail.com

  • status changed from closed to reopened.
  • type changed from defect to enhancement.
  • version changed from 0.6.1 to 0.7.X.
  • resolution deleted.

I have a patch that allows user to specify custom config file for FCKeditor. e.g.

<?php echo object_textarea_tag($journal, 'getContent', 'rich=fck config=myconfig') ?>

And here's the patch

--- lib/helper/FormHelper.php   (revision 1238)
+++ lib/helper/FormHelper.php   (working copy)
@@ -348,6 +348,11 @@
     {
       $fckeditor->ToolbarSet = $options['tool'];
     }
+
+    if (isset($options['config']))
+    {
+      $fckeditor->Config['CustomConfigurationsPath'] = javascript_path($options['config']);
+    }

     $content = $fckeditor->CreateHtml();

04/20/06 09:59:27 changed by fabien

  • status changed from reopened to closed.
  • resolution set to fixed.

fixed in r1240.

Please open a new ticket when this is a new enhancement or problem.

05/28/06 00:19:25 changed by anonymous

  • priority changed from blocker to trivial.