Incorporate CMSMS Image Manager into FCK editor

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
chrisl
Forum Members
Forum Members
Posts: 57
Joined: Fri Dec 30, 2005 10:08 am

Incorporate CMSMS Image Manager into FCK editor

Post 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.
cyberman

Re: Incorporate CMSMS Image Manager into FCK editor

Post by cyberman »

Many thanks for that solution - it's funny, cause the image manager comes from another WYSISYG editor (HTMLArea).
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: Incorporate CMSMS Image Manager into FCK editor

Post by KO »

Nice one. I like this!
Tealon

Re: Incorporate CMSMS Image Manager into FCK editor

Post by Tealon »

This one is great! I was looking for a decent plug-in for ages! And the answer was just under my nose!
musicscore
Power Poster
Power Poster
Posts: 484
Joined: Wed Jan 25, 2006 11:53 am

Re: Incorporate CMSMS Image Manager into FCK editor

Post 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
chrisl
Forum Members
Forum Members
Posts: 57
Joined: Fri Dec 30, 2005 10:08 am

Re: Incorporate CMSMS Image Manager into FCK editor

Post by chrisl »

Yes.
Just click on the image in the second box to insert it at the cursor's position in the edit area
Post Reply

Return to “Tips and Tricks”