summaryrefslogtreecommitdiff
path: root/plugins/libcalendaring/libcalendaring.php
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-03-19 14:32:37 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-03-19 14:32:37 (GMT)
commit5d49b4850d923e79765de53d02ce4f4b436efcdc (patch)
treec1235ded0438500b06e495cb5833eb46440eea19 /plugins/libcalendaring/libcalendaring.php
parent532662802b7664a0e1981464f7446b719bda6d4e (diff)
downloadroundcubemail-plugins-kolab-5d49b4850d923e79765de53d02ce4f4b436efcdc.tar.gz
Moved iTip functionality to libcalendaring for common use + improved inline UI for iTip messages and the options a user can select there
Diffstat (limited to 'plugins/libcalendaring/libcalendaring.php')
-rw-r--r--plugins/libcalendaring/libcalendaring.php33
1 files changed, 32 insertions, 1 deletions
diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php
index 88f5ed4..d33df67 100644
--- a/plugins/libcalendaring/libcalendaring.php
+++ b/plugins/libcalendaring/libcalendaring.php
@@ -113,7 +113,17 @@ class libcalendaring extends rcube_plugin
require_once($self->home . '/libvcalendar.php');
return new libvcalendar();
}
-
+
+ /**
+ * Load iTip functions
+ */
+ public static function get_itip($domain = 'libcalendaring')
+ {
+ $self = self::get_instance();
+ require_once($self->home . '/lib/libcalendaring_itip.php');
+ return new libcalendaring_itip($self, $domain);
+ }
+
/**
* Shift dates into user's current timezone
*
@@ -304,6 +314,27 @@ class libcalendaring extends rcube_plugin
return $html;
}
+ /**
+ * Get a list of email addresses of the current user (from login and identities)
+ */
+ public function get_user_emails()
+ {
+ $emails = array();
+ $plugin = $this->rc->plugins->exec_hook('calendar_user_emails', array('emails' => $emails));
+ $emails = array_map('strtolower', $plugin['emails']);
+
+ if ($plugin['abort']) {
+ return $emails;
+ }
+
+ $emails[] = $this->rc->user->get_username();
+ foreach ($this->rc->user->list_identities() as $identity) {
+ $emails[] = strtolower($identity['email']);
+ }
+
+ return array_unique($emails);
+ }
+
/********* Alarms handling *********/