Opened 7 years ago

Closed 6 years ago

#2872 closed New Feature (fixed)

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 (3)

2872.patch (23.3 KB) - added by wwalc 6 years ago.
php_ssi_docs.zip (16.8 KB) - added by wwalc 6 years ago.
php_ssi.zip (30.3 KB) - added by wwalc 6 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 7 years ago by wwalc

  • Owner set to wwalc

comment:2 Changed 7 years ago by wwalc

  • Keywords Review? added

Setting Review? keyword to start the discussion.

comment:3 Changed 7 years 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.

comment:4 Changed 7 years ago by wwalc

  • Keywords Review? removed

Changed 6 years ago by wwalc

Changed 6 years ago by wwalc

comment:5 Changed 6 years 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.

comment:6 Changed 6 years 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?

comment:7 Changed 6 years ago by fredck

  • Milestone changed from CKEditor 3.x to CKEditor 3.1

comment:8 Changed 6 years 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 6 years ago by wwalc

comment:9 Changed 6 years 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).

comment:10 Changed 6 years 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.

comment:11 Changed 6 years ago by fredck

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

comment:12 Changed 6 years ago by wwalc

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with [4692].

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