Jump to content


[Mod] Replace TinyMCE with FCKeditor


30 replies to this topic

#1 VTX

    Etomite Forum Newbie

  • Member
  • 17 posts

Posted 10 March 2005 - 11:02 AM

After getting really tired of the lack of functions with TinyMCE and HTMLArea, I replaced TinyMCE with FCKeditor (for a demo look here: http://www.fckeditor.net/demo/default.html).

Here is how I did it (Directly from the server, via SSH access):

Make a dir called 'fckeditor' in manager/media.

cd to that dir ('cd manager/media/fckeditor').

Download FCKeditor: http://prdownloads.sourceforge.net/fckedit...tar.gz?download
Make sure the tar.gz file is in 'manager/media/fckeditor' and unpack it there (' tar zxvf FCKeditor<version>.tgz').

Edit fckconfig.js and uncomment the php connectors and edit it, so it looks like this (change the ServerPath if needed):

FCKConfig.ImageBrowser = true ;
//FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/asp/connector.asp' ;
//FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/aspx/connector.aspx' ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=images&Connector=connectors/php/connector.php&ServerPath=/assets/' ;

Save the file.

Now open 'fckeditor.php', and edit the function 'FCKeditor' so it looks like (What is changed here is the 'BasePath' and the 'Height'):

function FCKeditor( $instanceName )
{
$this->InstanceName = $instanceName ;
$this->BasePath = 'media/fckeditor/' ;
$this->Width = '100%' ;
$this->Height = '400' ;
$this->ToolbarSet = 'Default' ;
$this->Value = '' ;
$this->Config = array() ;
}


Save the file.

Now open: 'editor/filemanager/browser/default/frmresourcetype.html' and edit 'var aTypes', so it looks like:

var aTypes = [
['File','File'],
['images','images'],
['Flash','Flash'],
['Media','Media']
] ;

Save the file.

Now open: ' editor/filemanager/browser/default/connectors/php/connector.php' and edit the array '$sResourceType', so it looks like:

if ( !in_array( $sResourceType, array('File','images','Flash','Media') ) )

Save the file.

Now cd to your manager dir ('cd <server_path>/manager'), open the file 'actions/dynamic/mutate_content.dynamic.action.php' and edit it(make a backup before you edit!):

First search for '} elseif($which_editor==1) {', and edit that part so it looks like:

</script>
<?php
} elseif($which_editor==1) {

include("/<full path to manager>/manager/media/fckeditor/fckeditor.php") ;
$sBasePath = "/manager/media/fckeditor/" ;

$oFCKeditor = new FCKeditor('ta') ;
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Value = $content[content];
$oFCKeditor->Create() ;

?>
<!-- tinyMCE -->
<!-- /tinyMCE -->
<?php
}
} else {
?>
<div style="width:100%"><textarea id="ta" name="ta" style="width:100%; height: 400px;" onChange="documentDirty=true;"><?php echo htmlspecialchars($content['content']); ?></textarea> </div>
<?php
}
?>
</div>
<?php } ?>

Save the file.

Now the hard part is done :)

Login to your manager, and set the editor to TinyMCE in your configuration. You now should have a FCKeditor including a working image editor in etomite!

It works great for me, good luck with it!

Here is a screenshot of FCKeditor integrated into Etomite:

Attached Files



#2 jaredc

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,193 posts

Posted 10 March 2005 - 02:28 PM

That's cool. I've been looking at FCK and wondered if it would be a good replacement for HTMLArea in the upcoming 0.7 release (Alex we need a code name or something because if it's going to be 1.0, we're calling it the wrong thing by saying 0.7... :betterwink: but I digress...).

I've tried the demo at the site and it keeps crashing my 1.0.1 Firefox (PC) AND 1.0 Firefox Mac (the ONLY Mac browser it even comes close to working in by the way - but that's nothing new :D). Am curious if I'm the only one having this problem. It usually crashes when I go to source code view and then try to come back.

Also, another major irritation is that in Firefox, there's no way to get a <p> tag without doing manual edits. It's all <br />. It's a known bug and plagues HTMLArea too.

Otherwise it looks like a pretty sweet replacement (especially since HTMLArea is no longer being developed).

#3 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 10 March 2005 - 02:44 PM

I'm leaning towards adding this as a third editor choice... I'll look over your installation spec's and see if I can change them to allow for a third editor in the config dropdown... B)

#4 Guest_SniperX_*

  • Guests

Posted 10 March 2005 - 03:02 PM

As with anything that goes into 1.0, the license will need to be checked vigourously, as 1.0 will be a commercial product.

"c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License."

#5 mmjaeger

    Likes Etomite Forums!

  • Member
  • PipPip
  • 343 posts

Posted 10 March 2005 - 03:15 PM

jaredc, on Mar 10 2005, 03:28 PM, said:

That's cool. I've been looking at FCK and wondered if it would be a good replacement for HTMLArea in the upcoming 0.7 release (Alex we need a code name or something because if it's going to be 1.0, we're calling it the wrong thing by saying 0.7... :betterwink: but I digress...).

I've tried the demo at the site and it keeps crashing my 1.0.1 Firefox (PC) AND 1.0 Firefox Mac (the ONLY Mac browser it even comes close to working in by the way - but that's nothing new :D). Am curious if I'm the only one having this problem. It usually crashes when I go to source code view and then try to come back.

Also, another major irritation is that in Firefox, there's no way to get a <p> tag without doing manual edits. It's all <br />. It's a known bug and plagues HTMLArea too.

Otherwise it looks like a pretty sweet replacement (especially since HTMLArea is no longer being developed).

around line 517 in mutate_settings.dynamic.action.php you can add some more editors.

#6 enternu

    Etomite Forum Newbie

  • Member
  • 19 posts

Posted 10 March 2005 - 03:26 PM

I tried to implement this mod but I keep getting errors:
Not Found
The requested URL /manager/media/fckeditor/editor/fckeditor.html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


#7 jaredc

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,193 posts

Posted 10 March 2005 - 03:32 PM

SniperX, on Mar 10 2005, 10:02 AM, said:

"c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License."
An excellent point and one I had failed to consider. Perhaps a solution like XStandard (which doesn't even attempt to work on a Mac) might be a viable option as there is a free version, and a licensed "pro" version which developers can distribute with commercial products. Seems like if a WYSIWYG product is available in both free and paid versions, it would be a simpler matter to use the correct version in the free and paid version of Eto... but at this point it gets over my head and I am glad brains the likes of Alex and Sniper are on the case.

#8 enternu

    Etomite Forum Newbie

  • Member
  • 19 posts

Posted 10 March 2005 - 04:05 PM

I fixed it already -_- :wacko:

#9 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 10 March 2005 - 06:49 PM

FCKEditor looks nice! I just tried the skin demo (office2003 version), and it looks so cool!!!

What is the functionality like when integrated into Etomite??

#10 Guest_eko40_*

  • Guests

Posted 10 March 2005 - 06:49 PM

I get a blank screen. I thought I followed all the steps although I'm not clear on what exactly needs to be "(re)placed" in:

"First search for '} elseif($which_editor==1) {', and edit that part so it looks like:

</script>
<?php
} elseif($which_editor==1) {

include("/<full path to manager>/manager/media/fckeditor/fckeditor.php") ;
$sBasePath = "/manager/media/fckeditor/" ;

$oFCKeditor = new FCKeditor('ta') ;
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Value = $content[content];
$oFCKeditor->Create() ;

?>
<!-- tinyMCE -->
<!-- /tinyMCE -->
<?php
}
} else {
?>
<div style="width:100%"><textarea id="ta" name="ta" style="width:100%; height: 400px;" onChange="documentDirty=true;"><?php echo htmlspecialchars($content['content']); ?></textarea> </div>
<?php
}
?>
</div>
<?php } ?>"


Do I replace '} elseif($which_editor==1) {' with ALL that, or overwrite it?

Help please!

#11 Guest_eko40_*

  • Guests

Posted 10 March 2005 - 06:59 PM

Does it work with [DO NOT CIRCUMVENT THE WORD FILTER]2?

#12 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 10 March 2005 - 11:01 PM

I managed to get FCKeditor installed and working in my Etomite Manager, but did things a bit differently. Within the 'fckconfig.js' file I also modified the code for file browsing. Additionally, I made the appropriate modifications so that I now have TinyMCE, HTMLArea, and FCKeditor as Rich-Text editor choices.

This is all I did to get FCKeditor working. Make sure you read the note towards the bottom of the text.

==========

Uploaded FCKeditor package into 'manager/media/fckeditor/'

==========

Edited 'fckconfig.js' connectors settings. Notice that both sections have been modified to use connector.php instead of the default connector.asp for the following settings. You can optionally remark out the connector.asp settings, but the connector.php settings will override them due to assignment ordering anyway.

# Change this line to point to your HTML file directory or "/" for webroot
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&ServerPath=/<path_to_HTM_filesL>' ;

# Change this line to point to the parent of your images directory
FCKConfig.ImageBrowserURL = FCKConfig.BasePath +
'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php&ServerPath=/assets/' ;

==========

Edited the 'fckeditor.php' function 'FCKeditor' settings below.

$this->BasePath = 'media/fckeditor/' ; # Relative path to FCKeditor from /etomite_root/manager/
...
$this->Height = '400' ; # New height of editor box, which can be as large as desired

==========

Edited '<server_path>/manager/actions/dynamic/mutate_content.dynamic.action.php' to add FCKeditor to the selection dropdown in your Etomite Configuration.

Change:

if($which_editor==2) {

To:

# Start - FCKeditor
if($which_editor==3) {

# The following line assumes that Etomite is run from your webroot
include($_SERVER["DOCUMENT_ROOT"]."/manager/media/fckeditor/fckeditor.php") ;
$sBasePath = "/manager/media/fckeditor/" ;

$oFCKeditor = new FCKeditor('ta') ;
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Value = $content[content];
$oFCKeditor->Create() ;

# End - FCKeditor
} elseif($which_editor==2) {

==========

Edited '<server_path>/manager/actions/dynamic/mutate_settings.dynamic.action.php' to add FCKeditor to the drop-down box by adding the lower line shown below;

Existing:
<option value="2" <?php echo $which_editor==2 ? "selected='selected'" : "" ;?>>HTMLArea</option>

Next line added below the existing line shown above.
<option value="3" <?php echo $which_editor==3 ? "selected='selected'" : "" ;?>>FCKeditor</option>

==========

DONE...

This was the end of the mofifications which I made. See the note below.

Note: I didn't make the following changes because I was able to create symlinks in my webroot which point to the appropriate locations. If you don't have direct access you will need to make these changes.


<<< Start of where I didn't make changes >>>

Now open: 'editor/filemanager/browser/default/frmresourcetype.html' and edit
'var aTypes', so it looks like:

var aTypes = [
['File','File'],
['images','images'],
['Flash','Flash'],
['Media','Media']
] ;

Now open: ' editor/filemanager/browser/default/connectors/php/connector.php' and
edit the array '$sResourceType', so it looks like:

if ( !in_array( $sResourceType, array('File','images','Flash','Media') ) )

Save the file.

<<< End of where I didn't make changes >>>

#13 sottwell

    Etomite Forum Fan

  • Member
  • Pip
  • 60 posts

Posted 11 March 2005 - 08:29 AM

I'm not having any problem with the demo.

I did switch my Firefox 1.0.1 for a special, supposedly hot-shot Mac-compiled version of 1.0 (hey, it has the fox on a really cute blue apple instead of a plain dull globe...) and lost the ability to edit in WYSIWYG mode with all of the editors; it would paste but not allow keyboard entry. I had to do all my editing in text mode. Didn't see any particular advantage to the special version, so dumped it and went back to the regular OS X package from mozilla.org.

As far as the licensing goes, "the whole of the work" referred to in the above post refers to the LGPLed code that has been modified. It does not refer to any other software the "work" may be packaged with, but not compiled or linked or embedded into:

Quote

Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.

In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.


#14 sottwell

    Etomite Forum Fan

  • Member
  • Pip
  • 60 posts

Posted 11 March 2005 - 09:48 AM

Very, very nice. Installed per rad's instructions. Only problem is image file access path doesn't seem to be working; will troubleshoot and report results.

I'm using the latest [DO NOT CIRCUMVENT THE WORD FILTER]2 patches, and OS X.

Between this and "Export Site", I've got a poor man's Dreamweaver! I'm already using it for a site that doesn't have any scripting capabilities.

#15 Guest_eko40_*

  • Guests

Posted 11 March 2005 - 11:15 AM

Very nice, also used Rad's approach and I got to work, but only fot the content modules not for MOD2x TVs, any help appreciated.

#16 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 11 March 2005 - 03:05 PM

sottwell, on Mar 11 2005, 05:48 AM, said:

Very, very nice.  Installed per rad's instructions.  Only problem is image file access path doesn't seem to be working;  will troubleshoot and report results.

I'm using the latest [Etomite Fork]2 patches, and OS X.

Between this and "Export Site", I've got a poor man's Dreamweaver!  I'm already using it for a site that doesn't have any scripting capabilities.
I had a tough time with the image path and ended up creating a symlink named Image which points to my actual images directory... The alternative is to either change the name of your images directory to Image or follow the bottom portion of the instructions that I didn't use, but did try to make sure they worked... B)

#17 Guest_eko40_*

  • Guests

Posted 11 March 2005 - 04:38 PM

Being at risk of double posting. Rad where you able to have fckeditor work in the [DO NOT CIRCUMVENT THE WORD FILTER]2 template variables? I followed your instructions exactly and only can make it work in the content variable.

#18 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 11 March 2005 - 05:12 PM

eko40, on Mar 11 2005, 12:38 PM, said:

Being at risk of double posting. Rad where you able to have fckeditor work in the [DO NOT CIRCUMVENT THE WORD FILTER]2 template variables? I followed your instructions exactly and only can make it work in the content variable.
I have not installed [DO NOT CIRCUMVENT THE WORD FILTER]2 on my system... I installed a very early version for testing purposes only, but even that has been removed... Considering how [DO NOT CIRCUMVENT THE WORD FILTER]2 makes system wide modifications, as do some of my modules, I need to keep my Etomite install as close to original as possible for testing purposes... But from what I have been reading [DO NOT CIRCUMVENT THE WORD FILTER]2 has progressed substantially as of late... Maybe someone with [DO NOT CIRCUMVENT THE WORD FILTER]2 can answer your question as any input I give would only be speculation... B)

#19 Guest_eko40_*

  • Guests

Posted 11 March 2005 - 05:15 PM

Thanks Rad, I hope someone has had more success than I had.

#20 Guest_rthrash_*

  • Guests

Posted 11 March 2005 - 05:37 PM

Consider it on the roadmap for [Etomite Fork]2... and it will work everywhere, of course ;)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users