aboutsummaryrefslogtreecommitdiffstats
path: root/apps/calendar/ajax/settings
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-02-26 21:23:20 +0100
committerGeorg Ehrke <dev@georgswebsite.de>2012-02-26 21:23:20 +0100
commit04c9cc60349fe8d6899a42781ccacaf6d9df5bf5 (patch)
tree6703867e9b45eb36cbcd86e9b7b7d47356f69960 /apps/calendar/ajax/settings
parenta501d4b61e3ba30aa1643b6a92c5177ee69d3b7d (diff)
downloadnextcloud-server-04c9cc60349fe8d6899a42781ccacaf6d9df5bf5.tar.gz
nextcloud-server-04c9cc60349fe8d6899a42781ccacaf6d9df5bf5.zip
give users the possibility to choose between monday and sunday as first day of the week
Diffstat (limited to 'apps/calendar/ajax/settings')
-rw-r--r--apps/calendar/ajax/settings/getfirstday.php12
-rw-r--r--apps/calendar/ajax/settings/setfirstday.php17
2 files changed, 29 insertions, 0 deletions
diff --git a/apps/calendar/ajax/settings/getfirstday.php b/apps/calendar/ajax/settings/getfirstday.php
new file mode 100644
index 00000000000..cab5870509a
--- /dev/null
+++ b/apps/calendar/ajax/settings/getfirstday.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+require_once('../../../../lib/base.php');
+OC_JSON::checkLoggedIn();
+$firstday = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'firstday', 'mo');
+OC_JSON::encodedPrint(array('firstday' => $firstday));
+?>
diff --git a/apps/calendar/ajax/settings/setfirstday.php b/apps/calendar/ajax/settings/setfirstday.php
new file mode 100644
index 00000000000..3b652212205
--- /dev/null
+++ b/apps/calendar/ajax/settings/setfirstday.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+require_once('../../../../lib/base.php');
+OC_JSON::checkLoggedIn();
+if(isset($_POST["firstday"])){
+ OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'firstday', $_POST["firstday"]);
+ OC_JSON::success();
+}else{
+ OC_JSON::error();
+}
+?>
+