Page 1 of 1

Incorporate CMSMS Image Manager into FCK editor

Posted: Tue Jun 19, 2007 6:20 pm
by chrisl
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

Code: Select all

$oFCKeditor->Config['ImageBrowserURL']
to

Code: Select all

$oFCKeditor->Config['ImageBrowserURL'] = $this->cms->config["root_url"].'/admin/imagefiles.php' ;
file: lib/filemanager/ImageManager/images.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
change to

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
then add the java function between the script tags at about line 268

   

Code: Select all

function SelectFile(fileUrl)
        {        	
        window.top.opener.SetUrl( fileUrl ) ;
	    window.top.close() ;
	    window.top.opener.focus() ;
        }
You can also create FCK templates very easily to help inexperienced users.

Re: Incorporate CMSMS Image Manager into FCK editor

Posted: Tue Jun 19, 2007 6:31 pm
by cyberman
Many thanks for that solution - it's funny, cause the image manager comes from another WYSISYG editor (HTMLArea).

Re: Incorporate CMSMS Image Manager into FCK editor

Posted: Tue Jun 19, 2007 6:53 pm
by KO
Nice one. I like this!

Re: Incorporate CMSMS Image Manager into FCK editor

Posted: Sat Jul 07, 2007 12:54 pm
by Tealon
This one is great! I was looking for a decent plug-in for ages! And the answer was just under my nose!

Re: Incorporate CMSMS Image Manager into FCK editor

Posted: Wed Jul 18, 2007 10:20 am
by musicscore
This looks realy nice but ......
When I click on a image to insert it in my content, it doesn't insert the image but opens a new browser-window.
Is this the way it should be or am I doing something wrong ???

Musicscore

Re: Incorporate CMSMS Image Manager into FCK editor

Posted: Wed Jul 18, 2007 4:36 pm
by chrisl
Yes.
Just click on the image in the second box to insert it at the cursor's position in the edit area