TinyMCE plugin

Description
TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.
The TinyMCE plugin for Frog CMS changes all textareas in the "Pages" section of Frog into editor instances. To avoid possible problems with the Markdown and Textile filters, its probably best to turn those plugins off.
Feature list:
- Easy image selection through dropdown list box.
- Easy linking to pages within the your Frog CMS through dropdown list box.
- True WYSIWYG possibility by choosing which CSS stylesheet TinyMCE uses.
- Easy configuration through a preferences screen in your Frog admin section.
Note: this plugin doesn't change any Frog CMS internal code, neither does it change the TinyMCE implementation.
It uses a stock (unchanged) TinyMCE download. If you want the plugin to use the latest TinyMCE version, just replace the contents of the "tinymce" directory within the plugin directory with the files of the new TinyMCE version.
License
The TinyMCE plugin (not TinyMCE itself) is licensed under the GNU General Public License v3. The TinyMCE code is included with the plugin for your convenience only.
Current version
If you use Frog 0.9.5+, download TinyMCE plugin version 2.0.0 RC1 (zip / tar.gz)
There is a small bug in the 2.0.0 RC1 release concerning the lists/image_list.php file. Fix it by adding an else to the if statement in line 18, here is how the if statement looks after the change:
if (!$first)
print ',';
else
$first = false;
NOT RECOMMENDED, upgrade to Frog 0.9.5 - If you use Frog 0.9.4, download TinyMCE plugin version 1.3.0 (download)
- Added support for "filter" selection.
- Added support for i18n.
- Added Dutch language support.
- Added check for "administrator" or "developer" roles when trying to access TinyMCE preferences tab in backend.
- Improved documentation.
You can also see all downloads for Frog on this site.
You can also see the complete changelist for all versions of this plugin.
You install the plugin in the /frog/plugins folder just like any other Frog plugin.
Where do you install the plugin? What folder?
Thanks
@Tom
If I understand correctly:
Your CMS install lives at C:\domains\tobtest
Your images (that you want to access with TinyMCE) live at: C:\domains\tobtest\public\themes\rpmc\images
The full URL to your CMS installation I assume to be: http://localhost/
This means:
Images directory: C:\domains\tobtest\public\themes\rpmc\images
URI to images: /public/themes/rpmc/images
URI to CSS file: /public/themes/rpmc/rpmctob.css
HOWEVER, IF the full URL to your CMS installation is something like: http://localhost/wolfcms/
This means:
Images directory: C:\domains\tobtest\public\themes\rpmc\images
URI to images: /wolfcms/public/themes/rpmc/images
URI to CSS file: /wolfcms/public/themes/rpmc/rpmctob.css
If that doesn't work, something else is wrong. (did you try flushing your browser's cache?)
Has anyone used this plugin on a windows server. I've spent a lot of time trying to get the settings right but noting works: Link dropdown Image dropdown Defining my own stylesheet
Any help would be appreciated: My image directory is: C:\domains\tobtest\public\themes\rpmc\images
My CSS is at: C:\domains\tobtest\public\themes\rpmc\rpmctob.css
the relative paths would be: /public/themes/rpmc/images /public/themes/rpmc/rpmctob.css Can anyone suggest how these should be entered into the settings page ?
Thanks in advance for any help !
@josh - Don't think I have... but that's more a general question concerning TinyMCE. It might be down to your specific browser/version. You could check the TinyMCE forums?
Anyone else having issues with TinyMCE removing the classes set on links?
@Tom - Yes. Absolute is absolute. Never tested it on Windows though. :-p
How would you specify the alsolute path on a Windows Server ? Does it need a C: ?
for example : Absolute path to images on disk. For example: /home/user/www/public/images Thanks.
Hey Andy,
Most often, something like this is caused by a problem in the settings. Check them again and re-read the documentation for the plugin.
If that doesn't pan out... well, you haven't exactly given me much information to work with.
I assume you've used the correct download for your Frog version?
You could always try downloading the latest TinyMCE release from the Moxiecode website and putting that inside the tinymce directory of the plugin.
Sincerely, Martijn.
I can't get the MCE to editor to drop down in firefox (latest version) when i select it from the filter drop down.
I can see it in the list but it wont bring the bar down.
Any ideas?
@Chris McB:
About the preview CSS.. maybe its just me, but why don't you simply edit the file on disk to do the import. Why should the plugin do it for you?
Everything got stripped out:
<?php
require_once('../config.php');
$dir_handle = @opendir($image_list_dir) or die("Unable to open $image_public_path");
print 'var tinyMCEImageList = new Array(';
print list_dir($dir_handle,$image_list_dir,$image_public_path);
print ');';
function list_dir($dir_handle,$path,$webpath) {
$out = '';
while (false !== ($file = readdir($dir_handle))) {
$dir =$path.'/'.$file;
if(is_dir($dir) && $file != '.' && $file !='..' ) {
$handle = @opendir($dir) or die("unable to open file $file");
if ($out!='') $out.=',';
$out .= list_dir($handle, $dir, $webpath.'/'.$file);
}
elseif ($file != '.' && $file !='..') {
if ($out!='') $out.=',';
$out .= '["'.$webpath.'/'.$file.'", "'.$webpath.'/'.$file.'"]';
}
}
return $out;
closedir($dir_handle);
}
?>
One other thing to fix the image list for occurences where the image directory has no files, but has sub directories with files:
Apologies - didn't quite get the code right on WMD!
Remove line 65 of config.php
header("Location: $preview_css");Replace with
$sheets = split(',',str_replace(' ','',$preview_css)); $amount = sizeof($sheets); for($i=0; $i<$amount; $i++){ echo "@import '" . $sheets[$i] . "';\n"; }Martijn,
Great work - I started using FCKEditor when I began working with Frog, but your integration of TinyMCE has taken out a lot of hassle and niggles.
Can I suggest an addition to your code?
In the configuration page, you allow for an external CSS to be loaded.
With one tweak, you can change that to multiple CSS files - as I very often require.
On line 65 of config.php, I commented out:
print("header(\"Location: $preview_css\");"); and added in:
print("$sheets = split(',',str_replace(' ','',$preview_css)); $amount = sizeof($sheets); for($i=0; $i<$amount; $i++){ echo \"@import '\" . $sheets[$i] . \"';\n\"; }");
As well as that code, just a quick change to the description of the text field in the settings page too.
I hope this helps someone!
@Fred - Haven't heard of other users with such a problem. Which version on the plugin & Frog are you using?
Also, which DB and DB version are you using?
Great plug!
However, the tab in the menu for tinymce gives me a Content Not Found (404) page.
How comes ?
Working (and fully new) image_list.php is here.
Don't forget correct image public path. It'll be without first slash, because slash having in URL_PUBLIC definition.
Have fun! :)
I'm having the same problem with the image list not displaying. Ahmed is correct, the image_list.php is not outputting the correct JavaScript.
If you can't wait for the next release, the fix quite easy. Just edit the file "lists/image_list.php" and add the code "$first = false;" after line number 20.
You can see it here (line 21 is highlighted):
http://pastebin.com/f2d300880
@Emrys - I'll try to get out a new release of the plugin before I leave on my trip to Japan. No promises though, life's been a little hectic lately with me trying to finish Frog 0.9.5., being busy at work, trying to prepare for Japan and catching a sever case of the flu a week before departure. :-o lol
@Stéphane - Inside the zip/tar.gz file is a readme.txt This tells you to unzip and upload the plugin to Frog's "plugins" directory.
how (where) to install (configure) TinyMCE in Madebyfrog ?
Thanks
Hi Martijn Has there been a solution to this problem? I have the same issue - the dropdown listing the contents of /public/images does not appear?
I created a file to echo out the paths here:
http://staging.artsandhealth.org/frog/plugins/tinymce/lists/vars.php
but as you see here:
http://staging.artsandhealth.org/frog/plugins/tinymce/lists/image_list.php
it is giving an error? the permissions are all ok.
Any help greatly appreciated! Many thanks, emrys
Hi Ahmed, thanks for the comment.. unfortunately, the WMD editor seems to have eaten your code. Maybe you could mail it to my gmail addres?
Dear Martijn, I have found a bug in v2.0.0 RC1 in image_list.php file if the image folder contains more than one file or any files other than images or any folder it will not produce the right array to TinyMCE so i have worked on that her is my code :
With all my respect.