Closed (duplicate)
Project:
Wysiwyg
Version:
5.x-0.5
Component:
Editor - TinyMCE
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Dec 2008 at 12:45 UTC
Updated:
3 Dec 2008 at 14:46 UTC
Hi,
we would set the icons for tinymce with an plugin. This is posible with a options-value in the hook_wysiwyg_plugin(). ie:
'options' => array(
'cleanup_callback' => 'myCustomCleanup',
'theme_advanced_buttons1' => explode(',', "save,cancel,|,search,replace,|,undo,redo,|,cut,copy,paste,pastetext,pasteword,|,formatselect,|,code,preview,zoom,fullscreen,help"),
'theme_advanced_buttons2' => explode(',', "cleanup,removeformat,|,bold,italic,cite,abbr,acronym,|,sub,sup,|,bullist,numlist,outdent,indent,|,charmap,link,unlink,anchor,image,media"),
'theme_advanced_buttons3' => explode(',', "tablecontrols,|,visualaid,|,spellchecker,|,visualchars,nonbreaking,|,mceAkaMLBox,mceAkaMLBoxAchtung,mceAkaMLBoxAnmerkung,mceAkaMLBoxAufgabe,mceAkaMLBoxBeispiel,mceAkaMLBoxTipp"),
'spellchecker_languages' => "+German=de,English=en",
),
But with this the Buttons are not set in three rows, because the code in tinymce.inc function wysiwyg_tinymce_settings() setting the theme_advanced_buttons1 etc to NULL and add all buttons to the first row.
I have added some code to check if the button is in another row. Then would it not inserted again.
if (isset($init['buttons'])) {
// Note: These rows need to be set to NULL otherwise TinyMCE loads its
// own buttons as defined in advanced theme.
$init += array(
'theme_advanced_buttons1' => array(),
'theme_advanced_buttons2' => array(),
'theme_advanced_buttons3' => array(),
);
for ($i = 0; $i < count($init['buttons']); $i++) {
# Check if the button is already in another row:
if ( !in_array($init['buttons'][$i], $init['theme_advanced_buttons1'])
AND !in_array($init['buttons'][$i], $init['theme_advanced_buttons2'])
AND !in_array($init['buttons'][$i], $init['theme_advanced_buttons3'])
) {
$init['theme_advanced_buttons1'][] = $init['buttons'][$i];
}
}
}
Then you could set the layout of the icons with an plugin.
Hope that helps.
bye
Martin
Comments
Comment #1
sunMarking as duplicate of #277954: Allow to sort editor buttons