Aleksander Machniak
2016-01-08 0bde1c2e4d0872f1acaee4c94b4f7bd38ad354ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Show user-info plugin script */
 
if (window.rcmail) {
  rcmail.addEventListener('init', function() {
    // <span id="settingstabdefault" class="tablink"><roundcube:button command="preferences" type="link" label="preferences" title="editpreferences" /></span>
    var tab = $('<span>').attr('id', 'settingstabpluginuserinfo').addClass('tablink');
 
    $('<a>').attr('href', rcmail.env.comm_path + '&_action=plugin.userinfo')
      .text(rcmail.get_label('userinfo', 'userinfo'))
      .click(function(e) { return rcmail.command('plugin.userinfo', '', this, e); })
      .appendTo(tab);
 
    // add button and register command
    rcmail.add_element(tab, 'tabs');
    rcmail.register_command('plugin.userinfo', function() { rcmail.goto_url('plugin.userinfo') }, true);
  })
}