diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-04-19 17:44:29 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-04-19 17:44:29 +0000 |
| commit | c4185d03cfb5c4e9df4c004b2c13a9b3c3196eac (patch) | |
| tree | 4f7ca23360a62cf181bb23a0f2264d69481cac03 /roundcubemail/plugins/userinfo | |
| parent | 137ee56eda15ecccb6a619a906ac532fc5d6c042 (diff) | |
Merged branch devel-api (from r2208 to r2387) back into trunk (omitting some sample plugins)
git-svn-id: https://svn.roundcube.net/trunk@2401 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/plugins/userinfo')
| -rw-r--r-- | roundcubemail/plugins/userinfo/localization/de_CH.inc | 9 | ||||
| -rw-r--r-- | roundcubemail/plugins/userinfo/localization/en_US.inc | 9 | ||||
| -rw-r--r-- | roundcubemail/plugins/userinfo/userinfo.js | 16 | ||||
| -rw-r--r-- | roundcubemail/plugins/userinfo/userinfo.php | 53 |
4 files changed, 87 insertions, 0 deletions
diff --git a/roundcubemail/plugins/userinfo/localization/de_CH.inc b/roundcubemail/plugins/userinfo/localization/de_CH.inc new file mode 100644 index 000000000..5f236b66c --- /dev/null +++ b/roundcubemail/plugins/userinfo/localization/de_CH.inc @@ -0,0 +1,9 @@ +<?php + +$labels = array(); +$labels['userinfo'] = 'Benutzerinfo'; +$labels['created'] = 'Erstellt'; +$labels['lastlogin'] = 'Letztes Login'; +$labels['defaultidentity'] = 'Standard-Absender'; + +?>
\ No newline at end of file diff --git a/roundcubemail/plugins/userinfo/localization/en_US.inc b/roundcubemail/plugins/userinfo/localization/en_US.inc new file mode 100644 index 000000000..1a2fd9016 --- /dev/null +++ b/roundcubemail/plugins/userinfo/localization/en_US.inc @@ -0,0 +1,9 @@ +<?php + +$labels = array(); +$labels['userinfo'] = 'User info'; +$labels['created'] = 'Created'; +$labels['lastlogin'] = 'Last Login'; +$labels['defaultidentity'] = 'Default Identity'; + +?>
\ No newline at end of file diff --git a/roundcubemail/plugins/userinfo/userinfo.js b/roundcubemail/plugins/userinfo/userinfo.js new file mode 100644 index 000000000..70a5085b3 --- /dev/null +++ b/roundcubemail/plugins/userinfo/userinfo.js @@ -0,0 +1,16 @@ +/* Show user-info plugin script */ + +if (window.rcmail) { + rcmail.addEventListener('init', function(evt) { + // <span id="settingstabdefault" class="tablink"><roundcube:button command="preferences" type="link" label="preferences" title="editpreferences" /></span> + var tab = $('<span>').attr('id', 'settingstabpluginuserinfo').addClass('tablink'); + + var button = $('<a>').attr('href', rcmail.env.comm_path+'&_action=plugin.userinfo').html(rcmail.gettext('userinfo', 'userinfo')).appendTo(tab); + button.bind('click', function(e){ return rcmail.command('plugin.userinfo', this) }); + + // add button and register command + rcmail.add_element(tab, 'tabs'); + rcmail.register_command('plugin.userinfo', function(){ rcmail.goto_url('plugin.userinfo') }, true); + }) +} + diff --git a/roundcubemail/plugins/userinfo/userinfo.php b/roundcubemail/plugins/userinfo/userinfo.php new file mode 100644 index 000000000..0f1b18cd9 --- /dev/null +++ b/roundcubemail/plugins/userinfo/userinfo.php @@ -0,0 +1,53 @@ +<?php + +/** + * Sample plugin that adds a new tab to the settings section + * to display some information about the current user + */ +class userinfo extends rcube_plugin +{ + public $task = 'settings'; + + function init() + { + $this->add_texts('localization/', array('userinfo')); + $this->register_action('plugin.userinfo', array($this, 'infostep')); + $this->include_script('userinfo.js'); + } + + function infostep() + { + $this->register_handler('plugin.body', array($this, 'infohtml')); + rcmail::get_instance()->output->send('plugin'); + } + + function infohtml() + { + $rcmail = rcmail::get_instance(); + $user = $rcmail->user; + + $table = new html_table(array('cols' => 2, 'cellpadding' => 3)); + + $table->add('title', 'ID'); + $table->add('', Q($user->ID)); + + $table->add('title', Q($this->gettext('username'))); + $table->add('', Q($user->data['username'])); + + $table->add('title', Q($this->gettext('server'))); + $table->add('', Q($user->data['mail_host'])); + + $table->add('title', Q($this->gettext('created'))); + $table->add('', Q($user->data['created'])); + + $table->add('title', Q($this->gettext('lastlogin'))); + $table->add('', Q($user->data['last_login'])); + + $identity = $user->get_identity(); + $table->add('title', Q($this->gettext('defaultidentity'))); + $table->add('', Q($identity['name'] . ' <' . $identity['email'] . '>')); + + return html::tag('h4', null, Q('Infos for ' . $user->get_username())) . $table->show(); + } + +}
\ No newline at end of file |
