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-02 17:54:34 +0400
committerFrank Karlitschek <frank@owncloud.org>2012-05-02 17:54:34 +0400
commit82a61e2e1a0f392759b69f7336213ff70a7bc877 (patch)
treea78094228b8454feb9212c2b7c3f54f5427fc03c /apps/calendar
parentff66600bc060dd2713b88b4af88e5a0a291710e0 (diff)
port oc_preferences
Diffstat (limited to 'apps/calendar')
-rwxr-xr-xapps/calendar/ajax/changeview.php2
-rwxr-xr-xapps/calendar/ajax/event/new.form.php4
-rwxr-xr-xapps/calendar/ajax/settings/getfirstday.php2
-rwxr-xr-xapps/calendar/ajax/settings/gettimezonedetection.php2
-rwxr-xr-xapps/calendar/ajax/settings/guesstimezone.php4
-rwxr-xr-xapps/calendar/ajax/settings/setfirstday.php2
-rwxr-xr-xapps/calendar/ajax/settings/settimeformat.php2
-rwxr-xr-xapps/calendar/ajax/settings/settimezone.php2
-rwxr-xr-xapps/calendar/ajax/settings/timeformat.php2
-rwxr-xr-xapps/calendar/ajax/settings/timezonedetection.php4
-rwxr-xr-xapps/calendar/index.php14
-rwxr-xr-xapps/calendar/lib/app.php2
-rwxr-xr-xapps/calendar/lib/object.php2
-rwxr-xr-xapps/calendar/lib/search.php2
-rwxr-xr-xapps/calendar/settings.php2
-rwxr-xr-xapps/calendar/templates/calendar.php8
16 files changed, 28 insertions, 28 deletions
diff --git a/apps/calendar/ajax/changeview.php b/apps/calendar/ajax/changeview.php
index f53eb288b79..a637e62aad1 100755
--- a/apps/calendar/ajax/changeview.php
+++ b/apps/calendar/ajax/changeview.php
@@ -17,6 +17,6 @@ switch($view){
OC_JSON::error(array('message'=>'unexspected parameter: ' . $view));
exit;
}
-OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'currentview', $view);
+OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'currentview', $view);
OC_JSON::success();
?>
diff --git a/apps/calendar/ajax/event/new.form.php b/apps/calendar/ajax/event/new.form.php
index a2fa48edf8a..376149b57c3 100755
--- a/apps/calendar/ajax/event/new.form.php
+++ b/apps/calendar/ajax/event/new.form.php
@@ -22,12 +22,12 @@ $end = $_POST['end'];
$allday = $_POST['allday'];
if (!$end){
- $duration = OC_Preferences::getValue( OCP\USER::getUser(), 'calendar', 'duration', '60');
+ $duration = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'duration', '60');
$end = $start + ($duration * 60);
}
$start = new DateTime('@'.$start);
$end = new DateTime('@'.$end);
-$timezone = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+$timezone = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
$start->setTimezone(new DateTimeZone($timezone));
$end->setTimezone(new DateTimeZone($timezone));
diff --git a/apps/calendar/ajax/settings/getfirstday.php b/apps/calendar/ajax/settings/getfirstday.php
index 3fe89c5bc56..dfc8b304b69 100755
--- a/apps/calendar/ajax/settings/getfirstday.php
+++ b/apps/calendar/ajax/settings/getfirstday.php
@@ -7,6 +7,6 @@
*/
OC_JSON::checkLoggedIn();
-$firstday = OC_Preferences::getValue( OCP\USER::getUser(), 'calendar', 'firstday', 'mo');
+$firstday = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'firstday', 'mo');
OC_JSON::encodedPrint(array('firstday' => $firstday));
?>
diff --git a/apps/calendar/ajax/settings/gettimezonedetection.php b/apps/calendar/ajax/settings/gettimezonedetection.php
index a5a71670ca9..be01807bbb4 100755
--- a/apps/calendar/ajax/settings/gettimezonedetection.php
+++ b/apps/calendar/ajax/settings/gettimezonedetection.php
@@ -8,4 +8,4 @@
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar');
-OC_JSON::success(array('detection' => OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezonedetection'))); \ No newline at end of file
+OC_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 9b86c305e44..19aa778472d 100755
--- a/apps/calendar/ajax/settings/guesstimezone.php
+++ b/apps/calendar/ajax/settings/guesstimezone.php
@@ -17,11 +17,11 @@ $lng = $_GET['long'];
$timezone = OC_Geo::timezone($lat, $lng);
-if($timezone == OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone')){
+if($timezone == OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone')){
OC_JSON::success();
exit;
}
-OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timezone', $timezone);
+OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezone', $timezone);
$message = array('message'=> $l->t('New Timezone:') . $timezone);
OC_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 232a51733ba..0c6ab695365 100755
--- a/apps/calendar/ajax/settings/setfirstday.php
+++ b/apps/calendar/ajax/settings/setfirstday.php
@@ -8,7 +8,7 @@
OC_JSON::checkLoggedIn();
if(isset($_POST["firstday"])){
- OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]);
+ OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]);
OC_JSON::success();
}else{
OC_JSON::error();
diff --git a/apps/calendar/ajax/settings/settimeformat.php b/apps/calendar/ajax/settings/settimeformat.php
index 428cb4220a1..d648545d9ca 100755
--- a/apps/calendar/ajax/settings/settimeformat.php
+++ b/apps/calendar/ajax/settings/settimeformat.php
@@ -8,7 +8,7 @@
OC_JSON::checkLoggedIn();
if(isset($_POST["timeformat"])){
- OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]);
+ OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]);
OC_JSON::success();
}else{
OC_JSON::error();
diff --git a/apps/calendar/ajax/settings/settimezone.php b/apps/calendar/ajax/settings/settimezone.php
index efc23c0f979..abe14bd0ec7 100755
--- a/apps/calendar/ajax/settings/settimezone.php
+++ b/apps/calendar/ajax/settings/settimezone.php
@@ -18,7 +18,7 @@ OC_JSON::checkAppEnabled('calendar');
// Get data
if( isset( $_POST['timezone'] ) ){
$timezone=$_POST['timezone'];
- OC_Preferences::setValue( OCP\USER::getUser(), 'calendar', 'timezone', $timezone );
+ OCP\Config::setUserValue( OCP\USER::getUser(), 'calendar', 'timezone', $timezone );
OC_JSON::success(array('data' => array( 'message' => $l->t('Timezone changed') )));
}else{
OC_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 cec09394815..dbcfcb29b42 100755
--- a/apps/calendar/ajax/settings/timeformat.php
+++ b/apps/calendar/ajax/settings/timeformat.php
@@ -7,6 +7,6 @@
*/
OC_JSON::checkLoggedIn();
-$timeformat = OC_Preferences::getValue( OCP\USER::getUser(), 'calendar', 'timeformat', "24");
+$timeformat = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'timeformat', "24");
OC_JSON::encodedPrint(array("timeformat" => $timeformat));
?>
diff --git a/apps/calendar/ajax/settings/timezonedetection.php b/apps/calendar/ajax/settings/timezonedetection.php
index 17bd740beea..8cb375183bb 100755
--- a/apps/calendar/ajax/settings/timezonedetection.php
+++ b/apps/calendar/ajax/settings/timezonedetection.php
@@ -10,9 +10,9 @@ OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar');
if(array_key_exists('timezonedetection', $_POST)){
if($_POST['timezonedetection'] == 'on'){
- OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'true');
+ OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'true');
}else{
- OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'false');
+ OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'false');
}
OC_JSON::success();
}else{
diff --git a/apps/calendar/index.php b/apps/calendar/index.php
index 0a77bdbf2ba..dcc7e25e3ec 100755
--- a/apps/calendar/index.php
+++ b/apps/calendar/index.php
@@ -29,21 +29,21 @@ OC_Hook::emit('OC_Calendar', 'getSources', array('sources' => &$eventSources));
$categories = OC_Calendar_App::getCategoryOptions();
//Fix currentview for fullcalendar
-if(OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview"){
- OC_Preferences::setValue(OCP\USER::getUser(), "calendar", "currentview", "agendaWeek");
+if(OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview"){
+ OCP\Config::setUserValue(OCP\USER::getUser(), "calendar", "currentview", "agendaWeek");
}
-if(OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "onemonthview"){
- OC_Preferences::setValue(OCP\USER::getUser(), "calendar", "currentview", "month");
+if(OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "onemonthview"){
+ OCP\Config::setUserValue(OCP\USER::getUser(), "calendar", "currentview", "month");
}
-if(OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "listview"){
- OC_Preferences::setValue(OCP\USER::getUser(), "calendar", "currentview", "list");
+if(OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "listview"){
+ OCP\Config::setUserValue(OCP\USER::getUser(), "calendar", "currentview", "list");
}
OCP\Util::addscript('3rdparty/fullcalendar', 'fullcalendar');
OCP\Util::addStyle('3rdparty/fullcalendar', 'fullcalendar');
OCP\Util::addscript('3rdparty/timepicker', 'jquery.ui.timepicker');
OCP\Util::addStyle('3rdparty/timepicker', 'jquery.ui.timepicker');
-if(OC_Preferences::getValue(OCP\USER::getUser(), "calendar", "timezone") == null || OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezonedetection') == 'true'){
+if(OCP\Config::getUserValue(OCP\USER::getUser(), "calendar", "timezone") == null || OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection') == 'true'){
OCP\Util::addscript('calendar', 'geo');
}
OCP\Util::addscript('calendar', 'calendar');
diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php
index 7a52bf08dc7..f3e9bea86a3 100755
--- a/apps/calendar/lib/app.php
+++ b/apps/calendar/lib/app.php
@@ -9,7 +9,7 @@
* This class manages our app actions
*/
OC_Calendar_App::$l10n = new OC_L10N('calendar');
-OC_Calendar_App::$tz = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+OC_Calendar_App::$tz = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
class OC_Calendar_App{
const CALENDAR = 'calendar';
const EVENT = 'event';
diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php
index d8e9d5fb946..018bf5beff1 100755
--- a/apps/calendar/lib/object.php
+++ b/apps/calendar/lib/object.php
@@ -761,7 +761,7 @@ class OC_Calendar_Object{
$vevent->setDateTime('DTSTART', $start, Sabre_VObject_Property_DateTime::DATE);
$vevent->setDateTime('DTEND', $end, Sabre_VObject_Property_DateTime::DATE);
}else{
- $timezone = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+ $timezone = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
$timezone = new DateTimeZone($timezone);
$start = new DateTime($from.' '.$fromtime, $timezone);
$end = new DateTime($to.' '.$totime, $timezone);
diff --git a/apps/calendar/lib/search.php b/apps/calendar/lib/search.php
index 3291e505249..03516b3b70c 100755
--- a/apps/calendar/lib/search.php
+++ b/apps/calendar/lib/search.php
@@ -12,7 +12,7 @@ class OC_Search_Provider_Calendar extends OC_Search_Provider{
}else{
$searchquery[] = $query;
}
- $user_timezone = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+ $user_timezone = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
$l = new OC_l10n('calendar');
foreach($calendars as $calendar){
$objects = OC_Calendar_Object::all($calendar['id']);
diff --git a/apps/calendar/settings.php b/apps/calendar/settings.php
index d6195108a2d..981df9ffafd 100755
--- a/apps/calendar/settings.php
+++ b/apps/calendar/settings.php
@@ -7,7 +7,7 @@
*/
$tmpl = new OC_Template( 'calendar', 'settings');
-$timezone=OC_Preferences::getValue(OCP\USER::getUser(),'calendar','timezone','');
+$timezone=OCP\Config::getUserValue(OCP\USER::getUser(),'calendar','timezone','');
$tmpl->assign('timezone',$timezone);
$tmpl->assign('timezones',DateTimeZone::listIdentifiers());
diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php
index 4285dc0f833..7e767e36732 100755
--- a/apps/calendar/templates/calendar.php
+++ b/apps/calendar/templates/calendar.php
@@ -1,13 +1,13 @@
<script type='text/javascript'>
- var defaultView = '<?php echo OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') ?>';
+ var defaultView = '<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') ?>';
var eventSources = <?php echo json_encode($_['eventSources']) ?>;
var categories = <?php echo json_encode($_['categories']); ?>;
var dayNames = <?php echo json_encode($l->tA(array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'))) ?>;
var dayNamesShort = <?php echo json_encode($l->tA(array('Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'))) ?>;
var monthNames = <?php echo json_encode($l->tA(array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'))) ?>;
var monthNamesShort = <?php echo json_encode($l->tA(array('Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'))) ?>;
- var agendatime = '<?php echo ((int) OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>{ - <?php echo ((int) OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>}';
- var defaulttime = '<?php echo ((int) OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>';
+ var agendatime = '<?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>{ - <?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>}';
+ var defaulttime = '<?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>';
var allDayText = '<?php echo addslashes($l->t('All day')) ?>';
var newcalendar = '<?php echo addslashes($l->t('New Calendar')) ?>';
var missing_field = '<?php echo addslashes($l->t('Missing fields')) ?>';
@@ -20,7 +20,7 @@
var missing_field_startsbeforeends = '<?php echo addslashes($l->t('The event ends before it starts')) ?>';
var missing_field_dberror = '<?php echo addslashes($l->t('There was a database fail')) ?>';
var totalurl = '<?php echo OCP\Util::linkToAbsolute('calendar', 'caldav.php'); ?>/calendars';
- var firstDay = '<?php echo (OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo') == 'mo' ? '1' : '0'); ?>';
+ var firstDay = '<?php echo (OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo') == 'mo' ? '1' : '0'); ?>';
$(document).ready(function() {
<?php
if(array_key_exists('showevent', $_)){