The point of suggesting the existing software that works when installed was to use it as a basis from which to expand.
So, sorry.. I was wrong you were right... Okay let's move on.
The more recent ZC files already include the some of the assignments for ckeditor in the inclusion/assignment of
in admin\includes\init_includes\init_html_editor.phpCode:$editors_list['CKEDITOR'] = array('desc' => EDITOR_CKEDITOR, 'handler' => 'ckeditor.php', 'special_needs' => '');
as pointed out to be loaded if the directory ckeditor exists where the editors are located in the catalog, typically the folder where the store is and a subfolder of editors. ie: /usr/x/y/z/public_html/editors
So, if a new/different editor is to be added (in the same location) it needs to be added to the $editors_list array. By creating a file in the admin area (which is the side of the store considered applicable to have/need html editing) such that the array is populated with the applicable references before the the above init_includes has been loaded (thus being added to the resulting pulldown). So, the new file should follow a format similar to the above. The key value of the editors_list array variable is used in the dropdown when the editor has been loaded to the system (may require logging out and logging in, or logging out, clearing cache and then logging in for it to display as a selection.) The portion on the right side provides further information for display (a "friendly name of the editor rather than an all caps listing) and other action.
So, the EDITOR_CKEDITOR is a constant that *IS/EXPECTED TO BE* defined in the admin/includes/languages/english/extra_definitions/ckeditor.php file (or the filename of your choosing. The suggestion is to prefix the filename for clarity that it is in fact an editor that has some extra definition.) Looking through the admin/index.php and subsequently called files, definitions in that directory will be called to load the information used in that file. The content of that file as described is the friendly name of the editor used for display.
Then there is the "handler" that handler without further change of the path in the handler key is to be located in the admin/includes directory... For ckeditor, this handler is a javascript related file that loads jquery if it hasn't been already and then identifies that the editor has its own javascript file to load and calls it. Additional script goes through and identifies if/where the editor is to be applied. Where it is to be applied it is "replaces" the existing content and the accessibility of the plugin takes over...
All of that was gleaned from a search in the ZC code for ckeditor (which revealed the one file that was previously posted in part) and no other specific reference to it. The main power of the editor though now comes from whatever the handler references/loads (hence the handler) and so the result can be displayed... In this case, ckeditor has a javascript file that does a lot of processing/control to pull all of the loaded/identified elements together to provide what is used/shown.
So what does it take? Give information to ZC about the identity of the editor, what is to be displayed to the user when "selecting" from the list of editors, and tell ZC where the handler file is located with the handler taking the action necessary to display/integrate the editor into the areas needed/desired and the editor providing functionality as loaded by the handler. The rest is really basically just common usage information to keep things "similar". Hopefully whatever editor you're either developing or planning to incorporate may be worth providing back to the community and that you consider packaging it for others as a plugin.


Reply With Quote
