Roundcube Community Forum

Miscellaneous => Roundcube Discussion => Topic started by: pratik_1712 on February 03, 2011, 02:04:12 AM

Title: Render message toolbar through plugin..
Post by: pratik_1712 on February 03, 2011, 02:04:12 AM
function renderedpage($args){
  if($args['template'] == 'mail'){
    $content = $args['content'];
   
    $content = $content  // How to edit this part to add a label in the messagetoolbar div..??

    $args['content'] = $content;
  }
  return $args;
}



I need to add a label in the toolbar. I found that i have to edit messagetoolbar div in the template 'mail'..
I need to know how to edit this inside the function..??

Say i need to add Undo label to the toolbar..

Thanks and Regards,
Pratik
Title: Render message toolbar through plugin..
Post by: SKaero on February 03, 2011, 02:51:20 AM
Its easiest to add it with javascript, see an example here: http://trac.roundcube.net/wiki/Doc_Plugins#ClientscriptsandUIelements
Title: Render message toolbar through plugin..
Post by: pratik_1712 on February 03, 2011, 03:44:32 AM
I stumbled to that part but i need that value to change everytime. How to pass the value to JavaScript for display..??

So i thought that will be more appropriate..

any idea how to do it by this method..??
can't i select a particular div and add to it.??
Title: Render message toolbar through plugin..
Post by: SKaero on February 03, 2011, 05:09:24 AM
You can pass a variable to JavaScript by using the set_env function, like:

$rcmail->output->set_env('button_value', 'data');

Then in the Javascript access it by calling rcmail.env.button_value, like:

alert(rcmail.env.button_value);

Alternatively you could try using the template_container hook Plugin_Hooks ? Roundcube Webmail (http://trac.roundcube.net/wiki/Plugin_Hooks#TemplateHooks)
Title: Render message toolbar through plugin..
Post by: pratik_1712 on February 03, 2011, 05:21:45 AM
Thanks a lot that was very helpful.. It worked as i needed.. Cheers mate..