Roundcube Community Forum

Release Support => Release Discussion => Topic started by: ciccio on June 29, 2012, 05:35:16 AM

Title: How to build an empty plugin
Post by: ciccio on June 29, 2012, 05:35:16 AM
Hi everyone.
My goal is build a very very simple plugin that can be reacheble by "Settings" and appears in the Tabs selection.
I dont need API or complicated things for my goal, but just insert a small code to test.
Which file I need or can I do that?

Thanks in advance.
Title: Re: How to build an empty plugin
Post by: SKaero on June 29, 2012, 06:52:37 PM
So you want to add a tab in the settings? The following code taken from the password plugin should add a tab:
Code: [Select]
if (window.rcmail) {
  rcmail.addEventListener('init', function(evt) {
    var tab = $('<span>').attr('id', 'settingstabpluginxxxx').addClass('tablink xxxx');
    var button = $('<a>').attr('href', rcmail.env.comm_path+'&_action=plugin.xxxx').html(rcmail.gettext('xxxx')).appendTo(tab);
    rcmail.add_element(tab, 'tabs');
  }
}