Hi
I need some help with a problem I am unable to solve on my own...
I have dynamic hook-in-arrays in my environment, which may contain arrays with this content:
$array['button']['name'] - plain string
$array['button']['js'] - which comes in a format like: function() { window.open('http://domain/some/path/hookname?txtarea=taname', 'plugname', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1') }
$array['button']['image'] - comes as a get link: http://domain/some/path/plugnamegif - returning a raw image data.
I have different CKEDITOR textarea fields to be filled with this incoming data for on-the-fly hook buttons. ( I think I know how to solve this part.) But the income dynamic array data is not changeable by me though.
Parts of my try to get this to work is:
CKEDITOR.plugins.add('taname'+item, {
init: function(editor) {
editor.ui.addButton('taname'+item, {
title: '<?php echo $button['name'] ?>',
icon: '<?php echo $button['image'] ?>',
iconName: 'tanamegif',
//command: 'taname',
click: "<?php echo $button['js'] ?>"
});
}
});
tile is easy, while string name
icon is bad, as i don't know how to get the link to be fetched and returned as a viewable gif or png (I tried to $.ajax get the raw data conten before, but still don't know how this is made viewable as a new button in CKE).
command or click is doing nothing, but should produce a href with window open event.
I don't really understand how the API is supposed to be used here... as I am still new to all this stuff.
Please get me on the way... while I tried for days now...
No ideas?