aboutsummaryrefslogtreecommitdiffstats
path: root/apps/calendar/ajax
diff options
context:
space:
mode:
Diffstat (limited to 'apps/calendar/ajax')
-rw-r--r--apps/calendar/ajax/cache/rescan.php15
-rw-r--r--apps/calendar/ajax/cache/status.php22
-rw-r--r--apps/calendar/ajax/events.php4
3 files changed, 37 insertions, 4 deletions
diff --git a/apps/calendar/ajax/cache/rescan.php b/apps/calendar/ajax/cache/rescan.php
new file mode 100644
index 00000000000..3417f1ae4b4
--- /dev/null
+++ b/apps/calendar/ajax/cache/rescan.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Copyright (c) 2012 Georg Ehrke <georg@ownCloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
+$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
+foreach($calendars as $calendar){
+ OC_Calendar_Repeat::cleancalendar($calendar['id']);
+ OC_Calendar_Repeat::generatecalendar($calendar['id']);
+}
+OCP\JSON::success(); \ No newline at end of file
diff --git a/apps/calendar/ajax/cache/status.php b/apps/calendar/ajax/cache/status.php
new file mode 100644
index 00000000000..d2806d47895
--- /dev/null
+++ b/apps/calendar/ajax/cache/status.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Copyright (c) 2012 Georg Ehrke <georg@ownCloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
+$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
+$allcached = true;
+foreach($calendars as $calendar){
+ if(!OC_Calendar_Repeat::is_calendar_cached($calendar['id'])){
+ $allcached = false;
+ }
+}
+$l = new OC_L10N('calendar');
+if(!$allcached){
+ OCP\JSON::error(array('message'=>'Not all calendars are completely cached', 'l10n'=>$l->t('Not all calendars are completely cached')));
+}else{
+ OCP\JSON::success(array('message'=>'Everything seems to be completely cached', 'l10n'=>$l->t('Everything seems to be completely cached')));
+} \ No newline at end of file
diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php
index 39130a6a983..6ea89e3e5b3 100644
--- a/apps/calendar/ajax/events.php
+++ b/apps/calendar/ajax/events.php
@@ -5,10 +5,6 @@
* later.
* See the COPYING-README file.
*/
-
-
-require_once('when/When.php');
-
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
session_write_close();