I want a function to be executed every time the compose window loads up..
I am using the following code but unable to link it to the desired event..
Kindly guide which event to hook up to..??
// In the Plugin
public $task = 'mail';
function init() {
$rcmail = rcmail::get_instance();
if (($rcmail->task == 'mail') && ($rcmail->action == 'compose')) {
$this->include_script('myscript.js');
}
}
document.onLoad = myfunc();
function myfunc()
{
alert('works');
var link = document.createElement('a');
link.setAttribute('href', '#');
link.setAttribute('title','Something');
document.getElementById('messagetoolbar').appendChild(link);
}
This is just coz i am not sure which event to call up..
I tried with 'init' but that didn't worked..
I am looking to add a label or button in the toolbar..
Any help is appreciated..
Thanks and Regards,
Pratik
Look into compose_addressbook plugin.
Roundcube Plugins | Underwater World (http://underwa.ter.net/roundcube-plugins/)
Thanks a lot.. thats exactly what i needed..
Regards,
Pratik
$this->add_button(array(
'command' => 'mycommand',
'label' => 'mylabel',
'title' => 'mytitle,
'id' => 'rcmbtn_compose_myid'), 'toolbar');
On the UI the lable value is coming in the [] brackets..
How to remove them..??
[mylabel]
This is the HTML being generated..
I want innerHTML without brackets..
Brackets indicate that the label is undefined in the plugin localization.
thanks.. was happening due to a typo with the name in localization..
Fixed it..