summaryrefslogtreecommitdiffstats
path: root/apps/calendar/ajax/changeview.php
blob: 707c8c59ebf8338e3eb8c9423d3c2c134fb16f78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
/**
 * Copyright (c) 2011 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.
 */

 
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar');
$view = $_GET['v'];
switch($view){
	case 'agendaWeek':
	case 'month';
	case 'list':
		break;
	default:
		OC_JSON::error(array('message'=>'unexspected parameter: ' . $view));
		exit;
}
OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'currentview', $view);
OC_JSON::success();
?>