Posted by TwoD on November 7, 2010 at 10:51pm
5 followers
| Project: | Wysiwyg |
| Version: | 7.x-2.x-dev |
| Component: | Documentation |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
We've had this wonderful and powerful hook for some time, but it's not mentioned in wysiwyg.api.php.
Comments
#1
Some of these are pretty obvious but included for sake of completeness.
Suggestions?
#2
I don't think this should hold up the release, but of course, we can commit anything that's ready.
From the listed sections, only basics and purpose should be documented for now. A brief sentence about audience/powers/limitations may be added, but I wouldn't want to "officially formalize" this hook's usage yet, as it's poor workaround for our API/feature limitations.
#3
There is a way to know wich wysiwyg profile or input format is active inside this hook?
I'm trying to override Ckeditor toolbars here to circunvent the icons group limitation (no wrap).
Thanks.
#4
Yes, the strings
$context['profile']->formatand$context['profile']->editorshould have that information.The profile object is the same one as retrieved from wysiwyg_profile_load($format).
EDIT: Fixed syntax, thanks!
#5
Thanks TwoD!
Is $context['profile']->format, is not ?
#6
Couldn't think of simple example code, so I left the function body empty.
#7
How about this?
I added the comments to avoid questions about why something like this won't work:
<?phpfunction hook_wysiwyg_editor_settings_alter(&$settings, $context) {
if ($context['profile']->editor == 'tinymce') {
$settings['fillEmptyBlocks'] = function ( element ) {
// Expected to be executed as JavaScript.
if ( element.attributes[ 'class' ].indexOf ( 'clear-both' ) != -1 )
return false;
}
}
}
?>
(Taken from the CKEditor config docs.)
#8
Thanks for reporting, reviewing, and testing! Committed with minor adjustments 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.
#9
Automatically closed -- issue fixed for 2 weeks with no activity.