Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-03 14:23:29 +0400
committerFrank Karlitschek <frank@owncloud.org>2012-05-03 14:23:29 +0400
commit43caa3b3b9cc9dbbf73ab2f6695a801a07a1dba5 (patch)
treef4b191f0d039cb7de942554ea23df3fff9de7ad6 /apps/calendar
parent375ba986452b190745b9388be92737d7e5771673 (diff)
ported oc_json
Diffstat (limited to 'apps/calendar')
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/calendar/activation.php6
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/calendar/delete.php8
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/calendar/edit.form.php4
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/calendar/edit.php4
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/calendar/new.form.php4
-rwxr-xr-xapps/calendar/ajax/calendar/new.php10
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/calendar/overview.php4
-rwxr-xr-xapps/calendar/ajax/calendar/update.php10
-rwxr-xr-xapps/calendar/ajax/categories/rescan.php8
-rwxr-xr-xapps/calendar/ajax/changeview.php8
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/event/delete.php8
-rwxr-xr-xapps/calendar/ajax/event/edit.form.php4
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/event/edit.php10
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/event/move.php6
-rwxr-xr-xapps/calendar/ajax/event/new.form.php4
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/event/new.php8
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/event/resize.php6
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/events.php6
-rwxr-xr-xapps/calendar/ajax/import/dialog.php2
-rwxr-xr-xapps/calendar/ajax/import/import.php6
-rwxr-xr-xapps/calendar/ajax/settings/getfirstday.php4
-rwxr-xr-xapps/calendar/ajax/settings/gettimezonedetection.php6
-rwxr-xr-xapps/calendar/ajax/settings/guesstimezone.php8
-rwxr-xr-xapps/calendar/ajax/settings/setfirstday.php6
-rwxr-xr-xapps/calendar/ajax/settings/settimeformat.php6
-rwxr-xr-xapps/calendar/ajax/settings/settimezone.php8
-rwxr-xr-xapps/calendar/ajax/settings/timeformat.php4
-rwxr-xr-xapps/calendar/ajax/settings/timezonedetection.php8
-rwxr-xr-xapps/calendar/ajax/share/activation.php2
-rwxr-xr-xapps/calendar/ajax/share/changepermission.php10
-rwxr-xr-xapps/calendar/ajax/share/dropdown.php2
-rwxr-xr-xapps/calendar/ajax/share/share.php20
-rwxr-xr-xapps/calendar/ajax/share/unshare.php12
-rwxr-xr-xapps/calendar/lib/app.php2
34 files changed, 112 insertions, 112 deletions
diff --git a/apps/calendar/ajax/calendar/activation.php b/apps/calendar/ajax/calendar/activation.php
index c93a0495717..3523590aa27 100644..100755
--- a/apps/calendar/ajax/calendar/activation.php
+++ b/apps/calendar/ajax/calendar/activation.php
@@ -7,13 +7,13 @@
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$calendarid = $_POST['calendarid'];
$calendar = OC_Calendar_App::getCalendar($calendarid);//access check
OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
$calendar = OC_Calendar_App::getCalendar($calendarid);
-OC_JSON::success(array(
+OCP\JSON::success(array(
'active' => $calendar['active'],
'eventSource' => OC_Calendar_Calendar::getEventSourceInfo($calendar),
));
diff --git a/apps/calendar/ajax/calendar/delete.php b/apps/calendar/ajax/calendar/delete.php
index 4bef912333c..a36a0534650 100644..100755
--- a/apps/calendar/ajax/calendar/delete.php
+++ b/apps/calendar/ajax/calendar/delete.php
@@ -7,15 +7,15 @@
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$cal = $_POST["calendarid"];
$calendar = OC_Calendar_App::getCalendar($cal);
$del = OC_Calendar_Calendar::deleteCalendar($cal);
if($del == true){
- OC_JSON::success();
+ OCP\JSON::success();
}else{
- OC_JSON::error(array('error'=>'dberror'));
+ OCP\JSON::error(array('error'=>'dberror'));
}
?>
diff --git a/apps/calendar/ajax/calendar/edit.form.php b/apps/calendar/ajax/calendar/edit.form.php
index d3f9629f1ae..17118c5165f 100644..100755
--- a/apps/calendar/ajax/calendar/edit.form.php
+++ b/apps/calendar/ajax/calendar/edit.form.php
@@ -7,8 +7,8 @@
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
$calendar = OC_Calendar_App::getCalendar($_GET['calendarid']);
diff --git a/apps/calendar/ajax/calendar/edit.php b/apps/calendar/ajax/calendar/edit.php
index d3f9629f1ae..17118c5165f 100644..100755
--- a/apps/calendar/ajax/calendar/edit.php
+++ b/apps/calendar/ajax/calendar/edit.php
@@ -7,8 +7,8 @@
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
$calendar = OC_Calendar_App::getCalendar($_GET['calendarid']);
diff --git a/apps/calendar/ajax/calendar/new.form.php b/apps/calendar/ajax/calendar/new.form.php
index 3de56460c2d..fa30b871e42 100644..100755
--- a/apps/calendar/ajax/calendar/new.form.php
+++ b/apps/calendar/ajax/calendar/new.form.php
@@ -7,8 +7,8 @@
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
$calendar = array(
'id' => 'new',
diff --git a/apps/calendar/ajax/calendar/new.php b/apps/calendar/ajax/calendar/new.php
index b7136981633..4b8688e3d1d 100755
--- a/apps/calendar/ajax/calendar/new.php
+++ b/apps/calendar/ajax/calendar/new.php
@@ -9,17 +9,17 @@
// Check if we are a user
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
if(trim($_POST['name']) == ''){
- OC_JSON::error(array('message'=>'empty'));
+ OCP\JSON::error(array('message'=>'empty'));
exit;
}
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
foreach($calendars as $cal){
if($cal['displayname'] == $_POST['name']){
- OC_JSON::error(array('message'=>'namenotavailable'));
+ OCP\JSON::error(array('message'=>'namenotavailable'));
exit;
}
}
@@ -31,7 +31,7 @@ OC_Calendar_Calendar::setCalendarActive($calendarid, 1);
$calendar = OC_Calendar_Calendar::find($calendarid);
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
$tmpl->assign('calendar', $calendar);
-OC_JSON::success(array(
+OCP\JSON::success(array(
'page' => $tmpl->fetchPage(),
'eventSource' => OC_Calendar_Calendar::getEventSourceInfo($calendar),
));
diff --git a/apps/calendar/ajax/calendar/overview.php b/apps/calendar/ajax/calendar/overview.php
index f66d1eae8f8..586bf3db814 100644..100755
--- a/apps/calendar/ajax/calendar/overview.php
+++ b/apps/calendar/ajax/calendar/overview.php
@@ -8,8 +8,8 @@
$l10n = OC_L10N::get('calendar');
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$output = new OC_TEMPLATE("calendar", "part.choosecalendar");
$output -> printpage();
?>
diff --git a/apps/calendar/ajax/calendar/update.php b/apps/calendar/ajax/calendar/update.php
index 1e35035fa48..408ac900912 100755
--- a/apps/calendar/ajax/calendar/update.php
+++ b/apps/calendar/ajax/calendar/update.php
@@ -9,17 +9,17 @@
// Check if we are a user
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
if(trim($_POST['name']) == ''){
- OC_JSON::error(array('message'=>'empty'));
+ OCP\JSON::error(array('message'=>'empty'));
exit;
}
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
foreach($calendars as $cal){
if($cal['displayname'] == $_POST['name'] && $cal['id'] != $_POST['id']){
- OC_JSON::error(array('message'=>'namenotavailable'));
+ OCP\JSON::error(array('message'=>'namenotavailable'));
exit;
}
}
@@ -32,7 +32,7 @@ OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
$calendar = OC_Calendar_App::getCalendar($calendarid);
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
$tmpl->assign('calendar', $calendar);
-OC_JSON::success(array(
+OCP\JSON::success(array(
'page' => $tmpl->fetchPage(),
'eventSource' => OC_Calendar_Calendar::getEventSourceInfo($calendar),
));
diff --git a/apps/calendar/ajax/categories/rescan.php b/apps/calendar/ajax/categories/rescan.php
index a8e62f64a5b..93e8c50954a 100755
--- a/apps/calendar/ajax/categories/rescan.php
+++ b/apps/calendar/ajax/categories/rescan.php
@@ -7,15 +7,15 @@
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
foreach ($_POST as $key=>$element) {
debug('_POST: '.$key.'=>'.print_r($element, true));
}
function bailOut($msg) {
- OC_JSON::error(array('data' => array('message' => $msg)));
+ OCP\JSON::error(array('data' => array('message' => $msg)));
OCP\Util::writeLog('calendar','ajax/categories/rescan.php: '.$msg, OCP\Util::DEBUG);
exit();
}
@@ -39,4 +39,4 @@ if(count($events) == 0) {
OC_Calendar_App::scanCategories($events);
$categories = OC_Calendar_App::getCategoryOptions();
-OC_JSON::success(array('data' => array('categories'=>$categories)));
+OCP\JSON::success(array('data' => array('categories'=>$categories)));
diff --git a/apps/calendar/ajax/changeview.php b/apps/calendar/ajax/changeview.php
index a637e62aad1..2c2d09ccb12 100755
--- a/apps/calendar/ajax/changeview.php
+++ b/apps/calendar/ajax/changeview.php
@@ -5,8 +5,8 @@
* later.
* See the COPYING-README file.
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$view = $_GET['v'];
switch($view){
case 'agendaWeek':
@@ -14,9 +14,9 @@ switch($view){
case 'list':
break;
default:
- OC_JSON::error(array('message'=>'unexspected parameter: ' . $view));
+ OCP\JSON::error(array('message'=>'unexspected parameter: ' . $view));
exit;
}
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'currentview', $view);
-OC_JSON::success();
+OCP\JSON::success();
?>
diff --git a/apps/calendar/ajax/event/delete.php b/apps/calendar/ajax/event/delete.php
index 3b726651641..cb30621af4d 100644..100755
--- a/apps/calendar/ajax/event/delete.php
+++ b/apps/calendar/ajax/event/delete.php
@@ -7,14 +7,14 @@
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$id = $_POST['id'];
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
if($access != 'owner' && $access != 'rw'){
- OC_JSON::error(array('message'=>'permission denied'));
+ OCP\JSON::error(array('message'=>'permission denied'));
exit;
}
$result = OC_Calendar_Object::delete($id);
-OC_JSON::success();
+OCP\JSON::success();
diff --git a/apps/calendar/ajax/event/edit.form.php b/apps/calendar/ajax/event/edit.form.php
index 675a417eba8..91d07d3897a 100755
--- a/apps/calendar/ajax/event/edit.form.php
+++ b/apps/calendar/ajax/event/edit.form.php
@@ -11,13 +11,13 @@
if(!OCP\User::isLoggedIn()) {
die('<script type="text/javascript">document.location = oc_webroot;</script>');
}
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkAppEnabled('calendar');
$id = $_GET['id'];
$data = OC_Calendar_App::getEventObject($id, true, true);
if(!$data){
- OC_JSON::error(array('data' => array('message' => self::$l10n->t('Wrong calendar'))));
+ OCP\JSON::error(array('data' => array('message' => self::$l10n->t('Wrong calendar'))));
exit;
}
$access = OC_Calendar_App::getaccess($id, OC_Calendar_Share::EVENT);
diff --git a/apps/calendar/ajax/event/edit.php b/apps/calendar/ajax/event/edit.php
index 172488f6241..e615fb093de 100644..100755
--- a/apps/calendar/ajax/event/edit.php
+++ b/apps/calendar/ajax/event/edit.php
@@ -7,8 +7,8 @@
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$id = $_POST['id'];
@@ -21,14 +21,14 @@ if(!array_key_exists('calendar', $_POST)){
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
if($access != 'owner' && $access != 'rw'){
- OC_JSON::error(array('message'=>'permission denied'));
+ OCP\JSON::error(array('message'=>'permission denied'));
exit;
}
$errarr = OC_Calendar_Object::validateRequest($_POST);
if($errarr){
//show validate errors
- OC_JSON::error($errarr);
+ OCP\JSON::error($errarr);
exit;
}else{
$data = OC_Calendar_App::getEventObject($id, false, false);
@@ -41,6 +41,6 @@ if($errarr){
if ($data['calendarid'] != $cal) {
OC_Calendar_Object::moveToCalendar($id, $cal);
}
- OC_JSON::success();
+ OCP\JSON::success();
}
?>
diff --git a/apps/calendar/ajax/event/move.php b/apps/calendar/ajax/event/move.php
index 75d174c13e1..8added69143 100644..100755
--- a/apps/calendar/ajax/event/move.php
+++ b/apps/calendar/ajax/event/move.php
@@ -6,12 +6,12 @@
* See the COPYING-README file.
*/
-OC_JSON::checkLoggedIn();
+OCP\JSON::checkLoggedIn();
$id = $_POST['id'];
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
if($access != 'owner' && $access != 'rw'){
- OC_JSON::error(array('message'=>'permission denied'));
+ OCP\JSON::error(array('message'=>'permission denied'));
exit;
}
$vcalendar = OC_Calendar_App::getVCalendar($id, false, false);
@@ -43,4 +43,4 @@ $vevent->setDateTime('DTSTAMP', 'now', Sabre_VObject_Property_DateTime::UTC);
$result = OC_Calendar_Object::edit($id, $vcalendar->serialize());
$lastmodified = $vevent->__get('LAST-MODIFIED')->getDateTime();
-OC_JSON::success(array('lastmodified'=>(int)$lastmodified->format('U')));
+OCP\JSON::success(array('lastmodified'=>(int)$lastmodified->format('U')));
diff --git a/apps/calendar/ajax/event/new.form.php b/apps/calendar/ajax/event/new.form.php
index 376149b57c3..42cdb81642e 100755
--- a/apps/calendar/ajax/event/new.form.php
+++ b/apps/calendar/ajax/event/new.form.php
@@ -11,10 +11,10 @@
if(!OCP\User::isLoggedIn()) {
die('<script type="text/javascript">document.location = oc_webroot;</script>');
}
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkAppEnabled('calendar');
if (!isset($_POST['start'])){
- OC_JSON::error();
+ OCP\JSON::error();
die;
}
$start = $_POST['start'];
diff --git a/apps/calendar/ajax/event/new.php b/apps/calendar/ajax/event/new.php
index 5e8c305e97a..72d57be03bf 100644..100755
--- a/apps/calendar/ajax/event/new.php
+++ b/apps/calendar/ajax/event/new.php
@@ -8,18 +8,18 @@
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$errarr = OC_Calendar_Object::validateRequest($_POST);
if($errarr){
//show validate errors
- OC_JSON::error($errarr);
+ OCP\JSON::error($errarr);
exit;
}else{
$cal = $_POST['calendar'];
$vcalendar = OC_Calendar_Object::createVCalendarFromRequest($_POST);
$result = OC_Calendar_Object::add($cal, $vcalendar->serialize());
- OC_JSON::success();
+ OCP\JSON::success();
}
?>
diff --git a/apps/calendar/ajax/event/resize.php b/apps/calendar/ajax/event/resize.php
index 260b6914426..0dc0a5fca7f 100644..100755
--- a/apps/calendar/ajax/event/resize.php
+++ b/apps/calendar/ajax/event/resize.php
@@ -6,13 +6,13 @@
* See the COPYING-README file.
*/
-OC_JSON::checkLoggedIn();
+OCP\JSON::checkLoggedIn();
$id = $_POST['id'];
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
if($access != 'owner' && $access != 'rw'){
- OC_JSON::error(array('message'=>'permission denied'));
+ OCP\JSON::error(array('message'=>'permission denied'));
exit;
}
@@ -35,4 +35,4 @@ $vevent->setDateTime('DTSTAMP', 'now', Sabre_VObject_Property_DateTime::UTC);
OC_Calendar_Object::edit($id, $vcalendar->serialize());
$lastmodified = $vevent->__get('LAST-MODIFIED')->getDateTime();
-OC_JSON::success(array('lastmodified'=>(int)$lastmodified->format('U')));
+OCP\JSON::success(array('lastmodified'=>(int)$lastmodified->format('U')));
diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php
index 8adaa4c98f3..2499c5163a2 100644..100755
--- a/apps/calendar/ajax/events.php
+++ b/apps/calendar/ajax/events.php
@@ -9,8 +9,8 @@
require_once('when/When.php');
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$start = (version_compare(PHP_VERSION, '5.3.0', '>='))?DateTime::createFromFormat('U', $_GET['start']):new DateTime('@' . $_GET['start']);
$end = (version_compare(PHP_VERSION, '5.3.0', '>='))?DateTime::createFromFormat('U', $_GET['end']):new DateTime('@' . $_GET['end']);
@@ -21,5 +21,5 @@ $output = array();
foreach($events as $event){
$output[] = OC_Calendar_App::generateEventOutput($event, $start, $end);
}
-OC_JSON::encodedPrint($output);
+OCP\JSON::encodedPrint($output);
?>
diff --git a/apps/calendar/ajax/import/dialog.php b/apps/calendar/ajax/import/dialog.php
index 9ee989c0dee..e686066a993 100755
--- a/apps/calendar/ajax/import/dialog.php
+++ b/apps/calendar/ajax/import/dialog.php
@@ -7,7 +7,7 @@
*/
-OC_JSON::checkLoggedIn();
+OCP\JSON::checkLoggedIn();
OCP\App::checkAppEnabled('calendar');
$tmpl = new OC_Template('calendar', 'part.import');
$tmpl->assign('path', $_POST['path']);
diff --git a/apps/calendar/ajax/import/import.php b/apps/calendar/ajax/import/import.php
index 43dfb5493fc..202af1eb46e 100755
--- a/apps/calendar/ajax/import/import.php
+++ b/apps/calendar/ajax/import/import.php
@@ -7,7 +7,7 @@
*/
//check for calendar rights or create new one
ob_start();
-OC_JSON::checkLoggedIn();
+OCP\JSON::checkLoggedIn();
OCP\App::checkAppEnabled('calendar');
$nl="\r\n";
$comps = array('VEVENT'=>true, 'VTODO'=>true, 'VJOURNAL'=>true);
@@ -24,7 +24,7 @@ if($_POST['method'] == 'new'){
}else{
$calendar = OC_Calendar_App::getCalendar($_POST['id']);
if($calendar['userid'] != OCP\USER::getUser()){
- OC_JSON::error();
+ OCP\JSON::error();
exit();
}
$id = $_POST['id'];
@@ -126,4 +126,4 @@ sleep(3);
if(is_writable('import_tmp/')){
unlink($progressfile);
}
-OC_JSON::success();
+OCP\JSON::success();
diff --git a/apps/calendar/ajax/settings/getfirstday.php b/apps/calendar/ajax/settings/getfirstday.php
index dfc8b304b69..23b71bba043 100755
--- a/apps/calendar/ajax/settings/getfirstday.php
+++ b/apps/calendar/ajax/settings/getfirstday.php
@@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
-OC_JSON::checkLoggedIn();
+OCP\JSON::checkLoggedIn();
$firstday = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'firstday', 'mo');
-OC_JSON::encodedPrint(array('firstday' => $firstday));
+OCP\JSON::encodedPrint(array('firstday' => $firstday));
?>
diff --git a/apps/calendar/ajax/settings/gettimezonedetection.php b/apps/calendar/ajax/settings/gettimezonedetection.php
index be01807bbb4..6bc9a07a1e9 100755
--- a/apps/calendar/ajax/settings/gettimezonedetection.php
+++ b/apps/calendar/ajax/settings/gettimezonedetection.php
@@ -6,6 +6,6 @@
* See the COPYING-README file.
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
-OC_JSON::success(array('detection' => OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection'))); \ No newline at end of file
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
+OCP\JSON::success(array('detection' => OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection'))); \ No newline at end of file
diff --git a/apps/calendar/ajax/settings/guesstimezone.php b/apps/calendar/ajax/settings/guesstimezone.php
index 19aa778472d..13092777b78 100755
--- a/apps/calendar/ajax/settings/guesstimezone.php
+++ b/apps/calendar/ajax/settings/guesstimezone.php
@@ -7,8 +7,8 @@
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
$l = OC_L10N::get('calendar');
@@ -18,10 +18,10 @@ $lng = $_GET['long'];
$timezone = OC_Geo::timezone($lat, $lng);
if($timezone == OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone')){
- OC_JSON::success();
+ OCP\JSON::success();
exit;
}
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezone', $timezone);
$message = array('message'=> $l->t('New Timezone:') . $timezone);
-OC_JSON::success($message);
+OCP\JSON::success($message);
?> \ No newline at end of file
diff --git a/apps/calendar/ajax/settings/setfirstday.php b/apps/calendar/ajax/settings/setfirstday.php
index 0c6ab695365..373eeee7968 100755
--- a/apps/calendar/ajax/settings/setfirstday.php
+++ b/apps/calendar/ajax/settings/setfirstday.php
@@ -6,12 +6,12 @@
* See the COPYING-README file.
*/
-OC_JSON::checkLoggedIn();
+OCP\JSON::checkLoggedIn();
if(isset($_POST["firstday"])){
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]);
- OC_JSON::success();
+ OCP\JSON::success();
}else{
- OC_JSON::error();
+ OCP\JSON::error();
}
?>
diff --git a/apps/calendar/ajax/settings/settimeformat.php b/apps/calendar/ajax/settings/settimeformat.php
index d648545d9ca..eae7be54e80 100755
--- a/apps/calendar/ajax/settings/settimeformat.php
+++ b/apps/calendar/ajax/settings/settimeformat.php
@@ -6,12 +6,12 @@
* See the COPYING-README file.
*/
-OC_JSON::checkLoggedIn();
+OCP\JSON::checkLoggedIn();
if(isset($_POST["timeformat"])){
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]);
- OC_JSON::success();
+ OCP\JSON::success();
}else{
- OC_JSON::error();
+ OCP\JSON::error();
}
?>
diff --git a/apps/calendar/ajax/settings/settimezone.php b/apps/calendar/ajax/settings/settimezone.php
index abe14bd0ec7..d2797a08aae 100755
--- a/apps/calendar/ajax/settings/settimezone.php
+++ b/apps/calendar/ajax/settings/settimezone.php
@@ -12,16 +12,16 @@
$l=OC_L10N::get('calendar');
// Check if we are a user
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
// Get data
if( isset( $_POST['timezone'] ) ){
$timezone=$_POST['timezone'];
OCP\Config::setUserValue( OCP\USER::getUser(), 'calendar', 'timezone', $timezone );
- OC_JSON::success(array('data' => array( 'message' => $l->t('Timezone changed') )));
+ OCP\JSON::success(array('data' => array( 'message' => $l->t('Timezone changed') )));
}else{
- OC_JSON::error(array('data' => array( 'message' => $l->t('Invalid request') )));
+ OCP\JSON::error(array('data' => array( 'message' => $l->t('Invalid request') )));
}
?>
diff --git a/apps/calendar/ajax/settings/timeformat.php b/apps/calendar/ajax/settings/timeformat.php
index dbcfcb29b42..809164e870a 100755
--- a/apps/calendar/ajax/settings/timeformat.php
+++ b/apps/calendar/ajax/settings/timeformat.php
@@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
-OC_JSON::checkLoggedIn();
+OCP\JSON::checkLoggedIn();
$timeformat = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'timeformat', "24");
-OC_JSON::encodedPrint(array("timeformat" => $timeformat));
+OCP\JSON::encodedPrint(array("timeformat" => $timeformat));
?>
diff --git a/apps/calendar/ajax/settings/timezonedetection.php b/apps/calendar/ajax/settings/timezonedetection.php
index 8cb375183bb..ba5f2af5fd9 100755
--- a/apps/calendar/ajax/settings/timezonedetection.php
+++ b/apps/calendar/ajax/settings/timezonedetection.php
@@ -6,15 +6,15 @@
* See the COPYING-README file.
*/
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
if(array_key_exists('timezonedetection', $_POST)){
if($_POST['timezonedetection'] == 'on'){
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'true');
}else{
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'false');
}
- OC_JSON::success();
+ OCP\JSON::success();
}else{
- OC_JSON::error();
+ OCP\JSON::error();
} \ No newline at end of file
diff --git a/apps/calendar/ajax/share/activation.php b/apps/calendar/ajax/share/activation.php
index 5c2fe8efd13..5526e5230f4 100755
--- a/apps/calendar/ajax/share/activation.php
+++ b/apps/calendar/ajax/share/activation.php
@@ -9,4 +9,4 @@ require_once('../../../../lib/base.php');
$id = strip_tags($_GET['id']);
$activation = strip_tags($_GET['activation']);
OC_Calendar_Share::set_active(OCP\USER::getUser(), $id, $activation);
-OC_JSON::success(); \ No newline at end of file
+OCP\JSON::success(); \ No newline at end of file
diff --git a/apps/calendar/ajax/share/changepermission.php b/apps/calendar/ajax/share/changepermission.php
index 431ef7964b6..e4a4f186ab0 100755
--- a/apps/calendar/ajax/share/changepermission.php
+++ b/apps/calendar/ajax/share/changepermission.php
@@ -14,7 +14,7 @@ switch($idtype){
case 'event':
break;
default:
- OC_JSON::error(array('message'=>'unexspected parameter'));
+ OCP\JSON::error(array('message'=>'unexspected parameter'));
exit;
}
$sharewith = $_GET['sharewith'];
@@ -25,16 +25,16 @@ switch($sharetype){
case 'public':
break;
default:
- OC_JSON::error(array('message'=>'unexspected parameter'));
+ OCP\JSON::error(array('message'=>'unexspected parameter'));
exit;
}
if($sharetype == 'user' && !OCP\User::userExists($sharewith)){
- OC_JSON::error(array('message'=>'user not found'));
+ OCP\JSON::error(array('message'=>'user not found'));
exit;
}
if($sharetype == 'group' && !OC_Group::groupExists($sharewith)){
- OC_JSON::error(array('message'=>'group not found'));
+ OCP\JSON::error(array('message'=>'group not found'));
exit;
}
$success = OC_Calendar_Share::changepermission($sharewith, $sharetype, $id, $permission, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT));
-OC_JSON::success(); \ No newline at end of file
+OCP\JSON::success(); \ No newline at end of file
diff --git a/apps/calendar/ajax/share/dropdown.php b/apps/calendar/ajax/share/dropdown.php
index 988e18c0b03..bac487f0d0b 100755
--- a/apps/calendar/ajax/share/dropdown.php
+++ b/apps/calendar/ajax/share/dropdown.php
@@ -10,7 +10,7 @@ $user = OCP\USER::getUser();
$calid = $_GET['calid'];
$calendar = OC_Calendar_Calendar::find($calid);
if($calendar['userid'] != $user){
- OC_JSON::error();
+ OCP\JSON::error();
exit;
}
$tmpl = new OC_Template('calendar', 'share.dropdown');
diff --git a/apps/calendar/ajax/share/share.php b/apps/calendar/ajax/share/share.php
index 39d97522338..3ce2bf1e217 100755
--- a/apps/calendar/ajax/share/share.php
+++ b/apps/calendar/ajax/share/share.php
@@ -13,15 +13,15 @@ switch($idtype){
case 'event':
break;
default:
- OC_JSON::error(array('message'=>'unexspected parameter'));
+ OCP\JSON::error(array('message'=>'unexspected parameter'));
exit;
}
if($idtype == 'calendar' && !OC_Calendar_App::getCalendar($id)){
- OC_JSON::error(array('message'=>'permission denied'));
+ OCP\JSON::error(array('message'=>'permission denied'));
exit;
}
if($idtype == 'event' && !OC_Calendar_App::getEventObject($id)){
- OC_JSON::error(array('message'=>'permission denied'));
+ OCP\JSON::error(array('message'=>'permission denied'));
exit;
}
$sharewith = $_GET['sharewith'];
@@ -32,28 +32,28 @@ switch($sharetype){
case 'public':
break;
default:
- OC_JSON::error(array('message'=>'unexspected parameter'));
+ OCP\JSON::error(array('message'=>'unexspected parameter'));
exit;
}
if($sharetype == 'user' && !OCP\User::userExists($sharewith)){
- OC_JSON::error(array('message'=>'user not found'));
+ OCP\JSON::error(array('message'=>'user not found'));
exit;
}
if($sharetype == 'group' && !OC_Group::groupExists($sharewith)){
- OC_JSON::error(array('message'=>'group not found'));
+ OCP\JSON::error(array('message'=>'group not found'));
exit;
}
if($sharetype == 'user' && OCP\USER::getUser() == $sharewith){
- OC_JSON::error(array('meesage'=>'you can not share with yourself'));
+ OCP\JSON::error(array('meesage'=>'you can not share with yourself'));
}
$success = OC_Calendar_Share::share(OCP\USER::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT));
if($success){
if($sharetype == 'public'){
- OC_JSON::success(array('message'=>$success));
+ OCP\JSON::success(array('message'=>$success));
}else{
- OC_JSON::success(array('message'=>'shared'));
+ OCP\JSON::success(array('message'=>'shared'));
}
}else{
- OC_JSON::error(array('message'=>'can not share'));
+ OCP\JSON::error(array('message'=>'can not share'));
exit;
} \ No newline at end of file
diff --git a/apps/calendar/ajax/share/unshare.php b/apps/calendar/ajax/share/unshare.php
index e5676c72f31..cbd5ed8e505 100755
--- a/apps/calendar/ajax/share/unshare.php
+++ b/apps/calendar/ajax/share/unshare.php
@@ -13,7 +13,7 @@ switch($idtype){
case 'event':
break;
default:
- OC_JSON::error(array('message'=>'unexspected parameter'));
+ OCP\JSON::error(array('message'=>'unexspected parameter'));
exit;
}
$sharewith = $_GET['sharewith'];
@@ -24,20 +24,20 @@ switch($sharetype){
case 'public':
break;
default:
- OC_JSON::error(array('message'=>'unexspected parameter'));
+ OCP\JSON::error(array('message'=>'unexspected parameter'));
exit;
}
if($sharetype == 'user' && !OCP\User::userExists($sharewith)){
- OC_JSON::error(array('message'=>'user not found'));
+ OCP\JSON::error(array('message'=>'user not found'));
exit;
}elseif($sharetype == 'group' && !OC_Group::groupExists($sharewith)){
- OC_JSON::error(array('message'=>'group not found'));
+ OCP\JSON::error(array('message'=>'group not found'));
exit;
}
$success = OC_Calendar_Share::unshare(OCP\USER::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT));
if($success){
- OC_JSON::success();
+ OCP\JSON::success();
}else{
- OC_JSON::error(array('message'=>'can not unshare'));
+ OCP\JSON::error(array('message'=>'can not unshare'));
exit;
} \ No newline at end of file
diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php
index 8e2679a43f4..e8fdbe8c78a 100755
--- a/apps/calendar/lib/app.php
+++ b/apps/calendar/lib/app.php
@@ -106,7 +106,7 @@ class OC_Calendar_App{
public static function isNotModified($vevent, $lastmodified){
$last_modified = $vevent->__get('LAST-MODIFIED');
if($last_modified && $lastmodified != $last_modified->getDateTime()->format('U')){
- OC_JSON::error(array('modified'=>true));
+ OCP\JSON::error(array('modified'=>true));
exit;
}
return true;