Incorporate CMSMS Image Manager into FCK editor
Posted: Tue Jun 19, 2007 6:20 pm
I have to admit that, personally, I do not use WYSIWYG editors but I do put them into sites for my customers, who are mostly charities with very little understanding of HTML.
The major WYSIWYG editors are all generally good and have their individual strong and weak points but it seems that for the inexperienced user uploading and inserting images into the text area can be quite daunting.
If the user has got used to using CMSMS's Image Manager it is extremely easy to incorporate this into FCK as the image file browser and use it to upload, edit and insert images.
Simply make the following changes and additions to two files (back up both these files before changing):
file: modules/FCKeditorX/FCKeditorX.module.php
about line 425 change the
to
file: lib/filemanager/ImageManager/images.php
about line 65 find
change to
then add the java function between the script tags at about line 268
You can also create FCK templates very easily to help inexperienced users.
The major WYSIWYG editors are all generally good and have their individual strong and weak points but it seems that for the inexperienced user uploading and inserting images into the text area can be quite daunting.
If the user has got used to using CMSMS's Image Manager it is extremely easy to incorporate this into FCK as the image file browser and use it to upload, edit and insert images.
Simply make the following changes and additions to two files (back up both these files before changing):
file: modules/FCKeditorX/FCKeditorX.module.php
about line 425 change the
Code: Select all
$oFCKeditor->Config['ImageBrowserURL']
Code: Select all
$oFCKeditor->Config['ImageBrowserURL'] = $this->cms->config["root_url"].'/admin/imagefiles.php' ;
about line 65 find
Code: Select all
<td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
<a href="<?php echo "{$manager->config['base_url']}{$file['relative']}";?>" TARGET="_blank" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"><img src="<?php
Code: Select all
<td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
<a href="javascript:SelectFile('<?php echo "{$manager->config['base_url']}{$file['relative']}";?>')" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"><img src="<?php
Code: Select all
function SelectFile(fileUrl)
{
window.top.opener.SetUrl( fileUrl ) ;
window.top.close() ;
window.top.opener.focus() ;
}