Opened 16 years ago
Closed 15 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)
Change History (15)
comment:1 Changed 16 years ago by
Owner: | set to Wiktor Walc |
---|
comment:2 Changed 16 years ago by
Keywords: | Review? added |
---|
comment:3 Changed 16 years ago by
Milestone: | CKEditor 3.0 → CKEditor 3.x |
---|
We'll have server side integration after the first stable release only.
comment:4 Changed 15 years ago by
Keywords: | Review? removed |
---|
Changed 15 years ago by
Attachment: | 2872.patch added |
---|
Changed 15 years ago by
Attachment: | php_ssi_docs.zip added |
---|
comment:5 Changed 15 years ago by
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 15 years ago by
...
- 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 15 years ago by
Milestone: | CKEditor 3.x → CKEditor 3.1 |
---|
comment:8 Changed 15 years ago by
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 15 years ago by
Attachment: | php_ssi.zip added |
---|
comment:9 Changed 15 years ago by
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 15 years ago by
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.
Setting Review? keyword to start the discussion.