Author Topic: Render message toolbar through plugin..  (Read 5231 times)

Offline pratik_1712

  • Jr. Member
  • **
  • Posts: 43
Render message toolbar through plugin..
« on: February 03, 2011, 02:04:12 AM »
Code: [Select]
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

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Render message toolbar through plugin..
« Reply #1 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

Offline pratik_1712

  • Jr. Member
  • **
  • Posts: 43
Render message toolbar through plugin..
« Reply #2 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.??

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Render message toolbar through plugin..
« Reply #3 on: February 03, 2011, 05:09:24 AM »
You can pass a variable to JavaScript by using the set_env function, like:
Code: [Select]

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

Then in the Javascript access it by calling rcmail.env.button_value, like:
Code: [Select]

alert(rcmail.env.button_value);

Alternatively you could try using the template_container hook Plugin_Hooks ? Roundcube Webmail

Offline pratik_1712

  • Jr. Member
  • **
  • Posts: 43
Render message toolbar through plugin..
« Reply #4 on: February 03, 2011, 05:21:45 AM »
Thanks a lot that was very helpful.. It worked as i needed.. Cheers mate..