Author Topic: How to build an empty plugin  (Read 3637 times)

Offline ciccio

  • Newbie
  • *
  • Posts: 1
How to build an empty plugin
« 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.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: How to build an empty plugin
« Reply #1 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');
  }
}