Ticket #2872 (closed New Feature: fixed)

Opened 14 months ago

Last modified 3 months ago

Server side integration - CKEditor creator

Reported by: wwalc Owned by: wwalc
Priority: Normal Milestone: CKEditor 3.1
Component: Server : PHP Version:
Keywords: Confirmed Review+ Cc:

Description

Port the integration files from V2.

Attachments

2872.patch Download (23.3 KB) - added by wwalc 3 months ago.
php_ssi_docs.zip Download (16.8 KB) - added by wwalc 3 months ago.
php_ssi.zip Download (30.3 KB) - added by wwalc 3 months ago.

Change History

Changed 14 months ago by wwalc

  • owner set to wwalc

Changed 14 months ago by wwalc

  • keywords Review? added

Setting Review? keyword to start the discussion.

Changed 11 months ago by fredck

  • milestone changed from CKEditor 3.0 to CKEditor 3.x

We'll have server side integration after the first stable release only.

Changed 5 months ago by wwalc

  • keywords Review? removed

Changed 3 months ago by wwalc

Changed 3 months ago by wwalc

Changed 3 months ago by wwalc

  • keywords Review? added

Few notes about the patch:

  • PHP5+ only, once the patch is approved, I'll create a similar file for PHP4
  • does not work with the SVN (source) version of CKEditor - this is because CKEditor doesn't load if
    <script type="text/javascript" src="ckeditor/ckeditor_source.js"></script>
    
    is placed inside of the <body> tag.
  • The attached php_ssi_docs.zip file contains documentation created with Doxygen, it may be easier to understand the patch with it.
  • I'm not sure if the "textarea" method has the best name, but couldn't find anything better.
  • The "replace" and "replaceAll" methods are needed in many situations when textarea elements are already available and we just want to add CKEditor support.

Changed 3 months ago by wwalc

...

  • At this moment, generated javascript code is returned, not printed. That's why in examples PHP "echo" function is used (echo $CKEditor->replace(...);). Because there are three methods to create CKEditor (textarea, replace, replaceAll) it doesn't seem to be the best solution to create separate methods that will return or output created code (like Create and CreateHtml in FCKeditor). Perhaps adding property $returnOutput ("false" by default) would suit better here?

Changed 3 months ago by fredck

  • milestone changed from CKEditor 3.x to CKEditor 3.1

Changed 3 months ago by fredck

  • keywords Review- added; Review? removed
  • We may have a different solution for the server side error regarding the ckeditor.js existence check. If the '%VERSION%' version is detected we output an additional script that checks for the CKEDITOR object at client site. If not found, an alert like "The CKEDITOR object was not found. Please be sure that the ckeditor.js file is available in your installation." is shown.
  • The textarea() method name is not so clear. It makes me feel that we're creating a <textarea>, but I really want to create and editor. So, what about calling it editor()?
  • Very few devs will care about the attributes to be set to the <textarea> element output by the SSI. Again, they just want an editor. So, let's not require them to pass the $attributes param to the (now named) textarea() method. We may have it as a property in the class, with some good default values.
  • Let's have a linebreak after the <textarea> just to make the source a better.
  • There are some "�" chars in the code for me. For example, the copyright char at the sample files, but also in the SSI code comments.

There are even other things that I've talked about with Wiktor in a chat.

Changed 3 months ago by wwalc

Changed 3 months ago by wwalc

  • keywords Review? added; Review- removed

To avoid problems with patches creating new files with broken encoding, I have attached zipped file with all PHP files (+documentation for better understanding): php_ssi.zip.

New methods:

  • addEventHandler
  • addGlobalEventHandler
  • clearEventHandlers
  • clearGlobalEventHandlers

New properties:

  • $textareaAttributes
  • $returnOutput

Static variables are used in the init function (and in some other functions) to remember the state of CKEditor (whether it has been already initialized) across multiple CKEditor PHP class instances (similar trick should work in PHP4, that's why I didn't use static properties).

Changed 3 months ago by fredck

  • keywords Review+ added; Review? removed

This is a wonderful SSI for PHP. We can still refine it, but the important is that the public API looks good.

Changed 3 months ago by fredck

Please commit it into the 3.1.x branch, not on trunk.

Changed 3 months ago by wwalc

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

Fixed with [4692].

Note: See TracTickets for help on using tickets.