Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have updated the wymeditor.inc file to provide support for the different editor buttons that come with the editor (ie. they can now be turned on and off).
Comment | File | Size | Author |
---|---|---|---|
#8 | wysiwyg-DRUPAL-6--2.wymeditor-buttons.patch | 7.88 KB | sun |
#7 | wymeditor.buttons.patch | 3.98 KB | Richard Blackborder |
#2 | wymeditor.buttons.patch | 3.38 KB | Richard Blackborder |
wymeditor.buttons.patch | 3.83 KB | Richard Blackborder |
Comments
Comment #1
sunThank you! Very nice patch!
I think we can move $buttoninfo into the condition and remove the else case, because that is the default case with no buttons configured; therefore, the editor should use its own defaults.
Please also ensure that there is no trailing white-space anywhere; also not on blank lines.
At this point in time, I would highly appreciate if you could order + align that button list like TinyMCE's default buttons in tinymce.inc. (TinyMCE just being an example, all editor includes try to use the same order, if possible)
Duplicate newline here.
It looks like we could use the array key for the internal name and process that into 'name' elsewhere?
Comment #2
Richard Blackborder CreditAttribution: Richard Blackborder commentedSun I have tried to take care of each point you raised in this revised patch.
I am also looking into trying to integrate a Drupal teaser break button for this editor. I'm having some issues. I'm not asking you to solve them all for me, but any input you could give would be appreciated:
1) WYMeditor is not integrated with the WYSIWYG plugin API. Can I just hardcode a button in to the buttons list for the Drupal Teaser break?
2) WYMeditor doesn't seem to allow comments, so I'm having trouble inserting the <!--break--> marker (ref this post). I wondered if you might have any cunning workarounds I have not thought of?
Thanks
Comment #3
sunSetting proper status.
1) Adding Drupal plugin support for WYMeditor should be deferred to a separate issue.
2) Not sure what the actual issue is, but most probably, it is rather related to 1), though we also seem to have 1-2 other related issues in the queue already.
Mostly looks good.
a) I think that the leading comment is outdated. (re:
)b) $buttons doesn't seem to be used anywhere.
c) The foreach only allows to add internal, native buttons of the editor itself, so no other module can add further native buttons - we mostly want to replace the foreach with the plugin/button processing that can be found in tinymce.inc or fckeditor.inc (the latter might be easier to use as template).
Comment #4
Richard Blackborder CreditAttribution: Richard Blackborder commentedI've done the first points, but I find integrating a plugin system with only a different implementation of it to work off pretty awkward. Documentation would be a massive help. I've had a go, but I'm feeling my way in the dark a bit here.
That said, I want WYMeditor to have the best integration possible. I may need some support, though.
This code works for defaults:
From what I can tell, fckeditor.inc and tinymce.inc seem to add buttons by adding a string to the $settings['buttons'] array, but WYMeditor needs to add a whole array of data to $settings['toolsItems'] to add a button.
Now, for the defaults, I'm getting this array data from my internal helper subroutine _wysiwyg_wymeditor_button_info(), but I don't know where I would get the equivalent information for a plugin.
I'm sure that $plugins[$plugin][$type][$button] is wrong, but looking at wysiwyg_get_plugins(), it is not clear to me where I would find this array. Can you help?
Comment #5
Richard Blackborder CreditAttribution: Richard Blackborder commentedStatus.. oops
Comment #6
sunI think you forgot to attach your new patch since #3. ;)
Comment #7
Richard Blackborder CreditAttribution: Richard Blackborder commentedYou're quite right.. what a nuisance.
Comment #8
sunThanks for reporting, reviewing, and testing! Committed attached patch to all branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.