i've done an updated module for drupal 4.6

this module is mostly equal with the tinymce head modul, of course except the form api stuff. all files are the latest head revisions from cvs, except tinymce.module, which i've changed to work with drupal 4.6

so all features of the 4.7 module, are available and like the 4.7 module, it needs tinymce 2.
currently it's not tested much, but everything seems to work for me.

Comments

jjeff’s picture

Awesome!

TinyMCE’s picture

I think ive found a bug, I was making a step-by-step tutorial on how to install the MCFileManager and MCImageManager into Drupal.

I think there is an issue with plugins that has no buttons, they simply don't get included. There is only a few plugins that has this, for example, the autosave plugin, contextmenu, but also the MCImageManager and MCFileManager (as they are buttons inside other plugins).

You can try this by enableing the Autosave plugin, then typing some text in the content area and navigate away (not saving), it should promt you with an alert. Or you can check by enabling the contextmenu and try to right click in the editor window, it should show a custom context menu.

Even though im quite familiar with TinyMCE, its hard to understand everything the module is doing, but changing this line seems to fix it.

LINE: 506
if ($settings['buttons'][$rname]) {

to

if ($settings['plugins'][$rname]) {

You should probably look it over.

fago’s picture

StatusFileSize
new21.11 KB

ah, yes this was broken, thanks.
your fix does its work :)

i've attached a fixed module

fago’s picture

StatusFileSize
new1.24 KB

here a patch, which updates the last module to fix the css classes

there was a little bug special to this module, further i included the solution from this issue too:
http://drupal.org/node/43013

pembeci’s picture

I tried the patch with 4.6.5 and it worked fine. Thanks fago, I was trying to configure the buttons based on user roles and this patch made my life much easier. The only thing I couldn't get working was the drupalbreak plugin. Do you have any suggestions about which tinymce version to use to make this working? Which one are you using?

fago’s picture

no sry, i never tried/used that

sangamreddi’s picture

Did you copy the drupal break plugin to tinymce/tinymce/jscripts/tiny_mce/plugins directory and you need to add the function to the plugin_reg.php. plese see the readme file in those plugin to install.

I followed the instruction and its got working fine.

agilpwc’s picture

I installed all the patches and on 4.6.5 along with tinymce 2.03. After it is enable it works. But when I create a profile and check a couple plugins then I get an error the next time the editor is invoked. The error is 'Error: Could not find the template function: TinyMCE_advanced_getEditorTemplate'. If I delete the profile, it works again.

Any ideas?

JohnG-1’s picture

I'm having problems with the default line-1 functions (bold, italic, ... undo, list, etc): The buttons are present but the formatting tags refuse to stick to the page.
I had them working at first but something has caused them to break. I've tried reinstalling tinymce to restore defaults but no luck.
I'm baffled as to what might be causing this - possibly my input settings? - or could it be related to the following:?

plugin_reg.php seems to contain reference to 'modules / tinymce / tinymce / jscripts / tiny_mce / plugins / font / editor_plugin.js. There is no font plug-in folder in tinyMCE v203 (or just mine?) so I'm getting a file not found warning. Does this matter? The call seems to be (when I // out the these lines, the warnings stop!):

// Note this isn't a true plugin, rather it's buttons made available by the advanced theme.
$plugins['font'] = array();
$plugins['font']['theme_advanced_buttons1'] = array('formatselect', 'fontselect', 'fontsizeselect','styleselect');
$plugins['font']['extended_valid_elements'] = array('font[face|size|color|style],span[class|align|style]');

Any suggestions gratefully welcomed!

fago’s picture

i don't have this folder, but for me the font-seletor still works, as everything else seems to work (using tinymce 2.03)

mgifford’s picture

Seems to work fine. Thanks for backporting it.

sulleleven’s picture

to comment #8:
are you using tinymce version 2?

JohnG-1’s picture

Didn't know where to post this really but I hope it might be useful to someone, somewhere ...

help configuring tinymce buttons by editing the plugin_reg.php
====================================

1. Getting all the buttons into a single row:
=========================
Tinymce can display buttons in one of 3 groups. As shown in the default settings (extract) below, each of the default buttons is listed in the group it will appear in.

/* default settings */
$plugins['default'] = array();
$plugins['default']['theme_advanced_buttons1'] = array('bold', 'italic', 'underline', 'strikethrough',  'anchor');
$plugins['default']['theme_advanced_buttons2'] = array('image', 'cleanup', 'forecolor', 'backcolor', 'sup', 'sub', 'code', 'hr');
$plugins['default']['theme_advanced_buttons3'] = array('cut', 'copy', 'paste', 'visualaid', 'removeformat', 'charmap', 'help');

To move a button from one row to another, just cut & paste the label (but careful with those commas and character spaces!) Note that duplicate buttons can also be created, if they are referenced twice.

To get all the buttons onto a single row, you can do this: (though it will look very messy if you have them all enabled)

/* single row settings */
$plugins['default'] = array();
$plugins['default']['theme_advanced_buttons1'] = array('bold', 'italic', 'underline', 'help');
$plugins['default']['theme_advanced_buttons2'] = array();
$plugins['default']['theme_advanced_buttons3'] = array();

To change the order in which the buttons appear (left to right) simply switch them around in the array order.

In theory you should have to set all your (relevant) plugin buttons to 'theme_advanced_buttons1' ... but apparently you don't :? They will just tag along before or behind depending on whether they are above or blow in the stack order.

That trick was easy enough, but from here on in we're in bug country ... :)

What you can't do with a single row of buttons, is put a plugin button in between 2 default buttons:

2. splitting up the default buttons:
====================

There are 3 groups but only 2 rows of buttons:
'theme_advanced_buttons1' = row1
'theme_advanced_buttons2' = row2 left
'theme_advanced_buttons3' = row2 right

You can only have 3 clusters of the default buttons because ** you can't have two versions of the same array **

$plugins['default'] = array();
$plugins['default']['theme_advanced_buttons1'] = array('bold');
$plugins['default']['theme_advanced_buttons2'] = array('italic');
$plugins['default']['theme_advanced_buttons2'] = array('underline');

which will display as:

row1: bold
row2: underline

(note the second '...buttons2' array obliterates the first, so 'italic' is not displayed)

you may have :

$plugins['default'] = array();
$plugins['default']['theme_advanced_buttons1'] = array('bold');
$plugins['default']['theme_advanced_buttons2'] = array('italic');
$plugins['default']['theme_advanced_buttons3'] = array('underline');
or
$plugins['default'] = array();
$plugins['default']['theme_advanced_buttons1'] = array('bold');
$plugins['default']['theme_advanced_buttons3'] = array('underline');
$plugins['default']['theme_advanced_buttons2'] = array('italic');

which will both display as:

row1: bold
row2: italic | underline

(the stack order here doesn't upset the buttons order)

But ...
you can put plugin buttons in between those 3 clusters:

$plugins['default'] = array();
$plugins['default']['theme_advanced_buttons1'] = array('bold');
 $plugins['emotions'] = array();
 $plugins['emotions']['theme_advanced_buttons1'] = array('emotions');
$plugins['default']['theme_advanced_buttons2'] = array('italic');
$plugins['default']['theme_advanced_buttons3'] = array('underline');

which will display as:

row1: bold | emotions
row2: italic | underline

or (by changing emotions to row2)

$plugins['default'] = array();
$plugins['default']['theme_advanced_buttons1'] = array('bold');
 $plugins['emotions'] = array();
 $plugins['emotions']['theme_advanced_buttons2'] = array('emotions');
$plugins['default']['theme_advanced_buttons2'] = array('italic');
$plugins['default']['theme_advanced_buttons3'] = array('underline');

which will display as:

row1: bold
row2: emotions | italic | underline

or (by changing emotions to row3 but leaving it in the same 'stacking order' as before)

$plugins['default'] = array();
$plugins['default']['theme_advanced_buttons1'] = array('bold');
 $plugins['emotions'] = array();
 $plugins['emotions']['theme_advanced_buttons3'] = array('emotions');
$plugins['default']['theme_advanced_buttons2'] = array('italic');
$plugins['default']['theme_advanced_buttons3'] = array('underline');

which will display as:

row1: bold
row2: italic | emotions | underline

That's the basics (in additon to the notes inside plugin_reg.php).

I'm too tired to take it any further :)

canadrian’s picture

JohnG, I'm experiencing that problem with the formatting not sticking as well. Did you ever manage to get it fixed?

JohnG-1’s picture

yes : for me it was a typo in benshell's img_assist, (updated) patch documented here: http://drupal.org/node/52273

canadrian’s picture

Not even using image assist. Was using drupalbreak, but I've tried removing that. I have neither plugin installed, and there are no references to them in the plugin_reg.php but I'm still getting really quirky beaviour.

TinyMCE doesn't seem to be following ANY rules. I set up a profile, but none of the settings I put in that profile actually show up in the editor (buttons, postition of toolbar, using theme css, etc.). Also, I keep getting <p> instead of <br>, and the formatting sometimes sticks, sometimes doesn't. Basically, overall, the modules's just acting really really quirky...

vikramsurya’s picture

Category: task » bug
Status: Needs review » Active

Hi, I'm trying to install this module on 4.6.6 on RHEL4/Apache2/MySQL4.1. Using the latest version linked from the main module page or the version in #3 on this page breaks the admin/modules page on my site -- the page just loads completely blank. When I remove tinymce directory from my /modules directory, then admin/modules comes up as usual. Any guess as to what is breaking, or how I might be able to diagnose?

fago’s picture

Category: bug » task
Status: Active » Needs review

this issue is actually no bug-report.

perhaps it would be good to have a look at the handbook and forums, first? e.g the troubleshooting faq might be useful ;)

otherwise try the support or open an extra issue for your issue, as it is not specific to this backport. thanks.

vikramsurya’s picture

Component: Code » Documentation
Priority: Normal » Minor
Status: Needs review » Closed (fixed)

Thank you for that link fago; it worked. Considering this is one of the heavier modules, perhaps a pointer to this in the install doc might be helpful since there is no information given by the web app when it happens. I would do it myself, but I've never submitted doc changes (or any others) as yet to Drupal. Is this something it would be appropriate to submit a revised INSTALL.txt for? Maybe as follows, add at bottom of INSTALL.txt in TROUBLESHOOTING section:
In case your admin>modules page doesn't load, you may need to increase the memory_limit setting in your php.ini file. For more information, see http://drupal.org/node/31819.

fago’s picture

Component: Documentation » Code
Priority: Minor » Normal
Status: Closed (fixed) » Needs review

then please open a separate issue for this. this issue and its status is about the backported module.

sethcohn’s picture

Weirdness with Firefox....

Installed ok, put the latest version of tinymce in the right place.

In IE, the image popup works.
In Firefox 1.5.0.2, image popup shows up _behind_ the main tinymce window, and isn't clickable at all.

Any ideas?

sja1’s picture

Javascript error - UNTERMINATED STRING CONSTANT

I installed the patched version from comment 3, and everything works in firefox, but in IE the pages all load with javascript errors. The effect is that either tinymce doesn't load at all in IE, or if fewer buttons are activated, it loads but some of the buttons do not show up properly (missing graphics). To locate the error, I uninstalled the compressor, and in the administration panel unchecked ALL the buttons, but the error does not go away. I have installed tinymce 2.0.6, on drupal 4.6.6. There seem to be similar bug reports on tinymce for drupal 4.7.

didier973’s picture

I'm not at all a coder or whatever, but would like to benefit from this backport. I have the 'standard' tinyMCE module installed, and working more or less (browser dependent).
I uploaded the module and the latest tinyMCE engine in a 'tinymce.new' folder.
Then I renamed the 'tinymce' folder into 'tinymce.old', and 'tinymce.new' in 'tinymce' to switch to the new version. And then, tinymce isn't working anymore :-(. I renamed the directories with the old names to get the old module working, as before.

I missed some steps from the 'install.txt': creation of the mysql tables, creation of the roles...: are they different from those of the previous tinymce module (I didn't installed the drupal modules by myself, but using civicspace :-/...)

I hope all this will soon work! Thanks anyway for the work done!

kreynen’s picture

Status: Needs review » Closed (fixed)

closing all 4.6 issues