diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-07 14:57:52 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-07 14:57:52 -0400 |
commit | 9580d0ef290c5ba2431e6c2c52c7a6d660b031ec (patch) | |
tree | e1f279e04c10a30d579fbfb3b653ffbf6d369cab /apps/calendar/lib | |
parent | 3533f43d12f2a0246dcdde72d2e68002da61e601 (diff) | |
download | nextcloud-server-9580d0ef290c5ba2431e6c2c52c7a6d660b031ec.tar.gz nextcloud-server-9580d0ef290c5ba2431e6c2c52c7a6d660b031ec.zip |
Initial calendar sharing backend
Diffstat (limited to 'apps/calendar/lib')
-rw-r--r-- | apps/calendar/lib/share/calendar.php | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/apps/calendar/lib/share/calendar.php b/apps/calendar/lib/share/calendar.php new file mode 100644 index 00000000000..9b68437531f --- /dev/null +++ b/apps/calendar/lib/share/calendar.php @@ -0,0 +1,58 @@ +<?php +/** +* ownCloud +* +* @author Michael Gapczynski +* @copyright 2012 Michael Gapczynski mtgap@owncloud.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +*/ + +class OC_Share_Backend_Calendar implements OCP\Share_Backend_Collection { + + const FORMAT_CALENDAR = 0; + + private static $calendar; + + public function isValidSource($itemSource, $uidOwner) { + if (self::$calendar = OC_Calendar_App::getCalendar($itemSource)) { + return true; + } + return false; + } + + public function generateTarget($itemSource, $shareWith, $exclude = null) { + if (isset(self::$calendar)) { + return self::$calendar['displayname']; + } + return false; + } + + public function formatItems($items, $format, $parameters = null) { + $calendars = array(); + if ($format == self::FORMAT_CALENDAR) { + foreach ($items as $item) { + $calendar = OC_Calendar_App::getCalendar($item['item_source']); + $calendar['displaynamename'] = $item['item_target']; + $calendars[] = $calendar; + } + } + return $calendars; + } + + public function getChildren($itemSource) { + // TODO + } + +}
\ No newline at end of file |