Opened 9 years ago

Closed 8 years ago

#2872 closed New Feature (fixed)

Server side integration - CKEditor creator

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

Description

Port the integration files from V2.

Attachments (3)

2872.patch (23.3 KB) - added by Wiktor Walc 8 years ago.
php_ssi_docs.zip (16.8 KB) - added by Wiktor Walc 8 years ago.
php_ssi.zip (30.3 KB) - added by Wiktor Walc 8 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 9 years ago by Wiktor Walc

Owner: set to Wiktor Walc

comment:2 Changed 9 years ago by Wiktor Walc

Keywords: Review? added

Setting Review? keyword to start the discussion.

comment:3 Changed 9 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.0CKEditor 3.x

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

comment:4 Changed 8 years ago by Wiktor Walc

Keywords: Review? removed

Changed 8 years ago by Wiktor Walc

Attachment: 2872.patch added

Changed 8 years ago by Wiktor Walc

Attachment: php_ssi_docs.zip added

comment:5 Changed 8 years ago by Wiktor Walc

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.

comment:6 Changed 8 years ago by Wiktor Walc

...

  • 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?

comment:7 Changed 8 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.xCKEditor 3.1

comment:8 Changed 8 years ago by Frederico Caldeira Knabben

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 8 years ago by Wiktor Walc

Attachment: php_ssi.zip added

comment:9 Changed 8 years ago by Wiktor Walc

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).

comment:10 Changed 8 years ago by Frederico Caldeira Knabben

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.

comment:11 Changed 8 years ago by Frederico Caldeira Knabben

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

comment:12 Changed 8 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

Fixed with [4692].

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy