XOOPS Paddling Computing Programming Internet Linux Drupal Networking Media Home Theater |
FCKeditor for XOOPS
Notes on FCKeditor 2.6.6 integration in XOOPS as released in the extra editors release of 2009-10. Latest XOOPSified Version: 2.6.4.1 (Included in extra XOOPSeditors release date 2009-10-26) Latest FCKeditor Release: 2.6.6 This release of the FCKeditor for XOOPS is much better than before (see previous FCKeditor notes for XOOPS 2.3.x and before) generally making upgrades of FCKeditor much easier (some mods still needed, see below). And some integration issues and bugs were fixed and others not. Finally, note that FCKeditor's lifespan is limited and CKeditor is the future direction and I'll be focusing on that shortly for my projects, but there are a bit of changes that must be handled to dial it in for my projects and not all modules are fully supporting it yet. This edition integrates the ImageManager plugin to replace the built-in version using File Manager, a more robust toolset with thumbnail images and such. However, you can't disable it on a module-by-module basis as you could before, so you may need to disable it altogether. Because the future direction is with CKeditor, I'll be focusing there generally in the future, but CKeditor requires a plugin for any uploadable aspects and/or the for-pay CKfinder. Note: all path/file references in this article, generally, will be from xRoot/class/xoopseditors/fckeditor directory. InstallationNewExtract the FCKeditor from the extra XOOPSeditors release and place it in xRoot/class/xoopseditors/ directory. Feel free to use as is, or customize as I've outlined below. I did that, uploaded the latest FCKeditor release (keeping the ImageManager plugin) on top and then made these edits/changes. UpgradesIt's always best before upgrading to save your configuration, style, and template files:
Note: upgrades from FCKeditor 2.4.x and prior will require making all configuration changes again as described below due to the changes in file structure to FCKeditor. ConfigurationMake the following changes as desired:
ModificationsThese are the modifications I've made based on the XOOPS FCKeditor 2.6.4.1 release (includes Image Manager plugin). FilesThe list of files I've modified/added:
Use Theme Stylesheets in EditorThis allows your editors to see what it will actually look like while editing. In ./formfckeditor.php add after line 86:
Enable ProtectedSourceThis security issue should have been done by the development team IMHO since this configuration depends upon which server-side application language is in use (php for XOOPS), so, to stop having to worry about this, put in in fckconfig-xoops.js (at least until this gets fixed):
Allow File Manager Browse / UploadsThe default installation has a new Image Manager integrated, but that doesn't deal with files, flash and such. Edit ./fckeditor/editor/filemanager/connectors/php/config.php: after the global $Config statement add this code (comes from the XOOPS 1.2.1 editors release (circa 2005) with a couple of modifications (relative URLs, sub-directories, registered user):
Note that the above code checks for logged in users (no anonymous users). Also edit these lines:
The default upload directory is thus /uploads/dirname. To change the second part, change 'content' to the directory name of your choice (like 'mynewdirname'). Whatever you name this, it remains a subdirectory in the uploads directory. HTML Special Characters IssueFor whatever reason, this error still persists. XoopsEditor 1.21 solved it by getting rid of the undoHtmlSpecialChars call in formfckeditor.php (as introduced in the XoopsEditor 1.10 release). However, it was re-introduced. I expect there is a reason that this call is made by FCKeditor for some sort of protection in case someone adds a special character in the source side - ::shrug:: Using any special characters cause an unintended cascading effect of ampersand conversion. For instance, a quote " will become " in the code — as it should be. However, after FCKeditor retrieves it from the database and displays it, it becomes " in the WYSIWYG instead of ". The next time it becomes " and then " ad infinitum. What I had to do was change fckeditor_php4.php and fckeditor_php5.php, approximately line 158 to (in function CreateHtml): // $HtmlValue = htmlspecialchars( $this->Value ) ; This is because this XOOPS implementation uses the $myts->undoHtmlSpecialChars function before throwing it back into the database so we need to use the XOOPS version of the htmlspecialchars function. Upload File PermissionsFiles and folders will be created with 777 permissions unless you change it in the configurations file, change in fckeditor/editor/filemanager/connectors/php/config.php:
File Uploader Doesn't Check if Disabled in Module ConfigurationsInterestingly, in the module-specific configuration code, there is ability to disable file uploads for that module alone, but the code doesn't exist to actually disable upload ability in the php connector. To do so, add these lines to fckeditor/editor/filemanager/connectors/php/config.php (before enabling -- i did it starting at line 62):
Paste from Word Remove Styles CheckboxI want the remove styles checkbox checked by default for the Paste from Word function, so made this change to line 339 of fckeditor/editor/dialog/fck_paste.html:
Require Registered UserBoth the Image Manager and File Manager should require at least registered user access. yeah, that means anonymous users can't browse the files. So what. Do you really want them having access to this? Because if they can upload files using this, then you're in trouble. To fix that in Image Manager, change line 26 to (Filemanager is fixed in the code above):
User Directory and Filename PatternsThe directory (by month/year or year) and filename (various options) patterns was introduced in XOOPSeditor 1.2.1 but dropped in this implementation for some reason (I'm assuming to touch as little of the connector code as possible for future updates). Some of my community sites liked it, so I've added it back in. To add it back in, follow these instructions. Add to fckeditor/editor/filemanager/connectors/php/config.php the following lines:
and then make configuration changes based upon the pattern(s) you want to use. In fckeditor/editor/filemanager/connectors/php/commands.php remove lines 177-179:
then, add starting at (before) new line 182
Other NotesImage Manager Not DisabledThis installation doesn't allow for the disabling of the Image Manager if it's specified in the configuration file. It might be best to setup module specific configurations in the fckeditor/modules directory and control it from there. That may be a future direction, but for now you'll just have to remove it from the editor configs. Safe Mode / Image ManagerIf you are using safe_mode = On, then you will need to edit the Image Manager plugin configuration file for safe mode. ImageMagick or NetPBMImage Manager uses GD by default, but if you want to use ImageMagick or NetPBM, edit the Image Manager plugin configuration file.
|
Login
Search
|