Author Topic: Looking for add_button() documentation  (Read 2932 times)

Offline cheeks

  • Newbie
  • *
  • Posts: 8
Looking for add_button() documentation
« on: October 29, 2020, 09:20:32 PM »
I'm working on the view elements of a plugin and find that I don't understand the arguments to add_button() (for example, some code I'm looking at has 'type'  => 'link', but what other types are valid, and how would that change the rest of the required arguments?)

I've followed all the links in the "How to get involved" doc at github, including checking out http://docs.roundcube.net/doc/phpdoc/ but I haven't found anything that describes it.  Hopefully I'm just missing something.

Thanks in advance,

Mark

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: Looking for add_button() documentation
« Reply #1 on: October 30, 2020, 04:08:50 AM »
add_button() has 2 params the first is an array of properties for the rcmail_output_html::button() function and the second is the name of the container to put the button in.

supported 'type's in the first param are: image, link, input (depreciated), ant button (default). You also need a 'command' key and then whatever HTML attributes you want the element to have; id, class etc.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline cheeks

  • Newbie
  • *
  • Posts: 8
Re: Looking for add_button() documentation
« Reply #2 on: October 30, 2020, 08:34:29 PM »
Thank you for the hints, that helps.  I'll see if I can drum up some info on rcmail_output_html::button() next.

Mark