X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=dav%2Fcommon%2Fwdcal_backend.inc.php;h=d66251f4e78c00762eced0718a83cb6e2d66359d;hb=39dd3dffe07efd69fa1ac6d0bd243c7fc0e3a66f;hp=9233da6e21f8bb4124cd4e288b5e88eecd9515ae;hpb=ef8a46da2cd9f73992045104ceaf351cf2a78b87;p=friendica-addons.git diff --git a/dav/common/wdcal_backend.inc.php b/dav/common/wdcal_backend.inc.php index 9233da6e..d66251f4 100644 --- a/dav/common/wdcal_backend.inc.php +++ b/dav/common/wdcal_backend.inc.php @@ -1,7 +1,7 @@ false, - 'Msg' => t('No access'))); + 'Msg' => L10n::t('No access'))); killme(); } try { @@ -97,13 +97,13 @@ function wdcal_print_feed($base_path = "") $component = dav_get_eventComponent($item); $component->add("SUMMARY", icalendar_sanitize_string(dav_compat_parse_text_serverside("CalendarTitle"))); - if (isset($_REQUEST["allday"])) $type = Sabre_VObject_Property_DateTime::DATE; - else $type = Sabre_VObject_Property_DateTime::LOCALTZ; + if (isset($_REQUEST["allday"])) $type = Sabre\VObject\Property\DateTime::DATE; + else $type = Sabre\VObject\Property\DateTime::LOCALTZ; - $datetime_start = new Sabre_VObject_Property_DateTime("DTSTART"); - $datetime_start->setDateTime(new DateTime(date("Y-m-d H:i:s", IntVal($_REQUEST["CalendarStartTime"]))), $type); - $datetime_end = new Sabre_VObject_Property_DateTime("DTEND"); - $datetime_end->setDateTime(new DateTime(date("Y-m-d H:i:s", IntVal($_REQUEST["CalendarEndTime"]))), $type); + $datetime_start = new Sabre\VObject\Property\DateTime("DTSTART"); + $datetime_start->setDateTime(new DateTime(date(DateTimeFormat::MYSQL, IntVal($_REQUEST["CalendarStartTime"]))), $type); + $datetime_end = new Sabre\VObject\Property\DateTime("DTEND"); + $datetime_end->setDateTime(new DateTime(date(DateTimeFormat::MYSQL, IntVal($_REQUEST["CalendarEndTime"]))), $type); $component->add($datetime_start); $component->add($datetime_end); @@ -163,7 +163,7 @@ function wdcal_print_feed($base_path = "") $r = q("SELECT `calendarobject_id`, `calendar_id` FROM %s%sjqcalendar WHERE `id`=%d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($_REQUEST["jq_id"])); if (count($r) != 1) { echo wdcal_jsonp_encode(array('IsSuccess' => false, - 'Msg' => t('No access'))); + 'Msg' => L10n::t('No access'))); killme(); } try { @@ -175,17 +175,17 @@ function wdcal_print_feed($base_path = "") if (!$component) { echo wdcal_jsonp_encode(array('IsSuccess' => false, - 'Msg' => t('No access'))); + 'Msg' => L10n::t('No access'))); killme(); } - if (isset($_REQUEST["allday"])) $type = Sabre_VObject_Property_DateTime::DATE; - else $type = Sabre_VObject_Property_DateTime::LOCALTZ; + if (isset($_REQUEST["allday"])) $type = Sabre\VObject\Property\DateTime::DATE; + else $type = Sabre\VObject\Property\DateTime::LOCALTZ; - $datetime_start = new Sabre_VObject_Property_DateTime("DTSTART"); - $datetime_start->setDateTime(new DateTime(date("Y-m-d H:i:s", IntVal($_REQUEST["CalendarStartTime"]))), $type); - $datetime_end = new Sabre_VObject_Property_DateTime("DTEND"); - $datetime_end->setDateTime(new DateTime(date("Y-m-d H:i:s", IntVal($_REQUEST["CalendarEndTime"]))), $type); + $datetime_start = new Sabre\VObject\Property\DateTime("DTSTART"); + $datetime_start->setDateTime(new DateTime(date(DateTimeFormat::MYSQL, IntVal($_REQUEST["CalendarStartTime"]))), $type); + $datetime_end = new Sabre\VObject\Property\DateTime("DTEND"); + $datetime_end->setDateTime(new DateTime(date(DateTimeFormat::MYSQL, IntVal($_REQUEST["CalendarEndTime"]))), $type); $component->__unset("DTSTART"); $component->__unset("DTEND"); @@ -203,7 +203,7 @@ function wdcal_print_feed($base_path = "") ); } catch (Exception $e) { echo wdcal_jsonp_encode(array('IsSuccess' => false, - 'Msg' => t('No access'))); + 'Msg' => L10n::t('No access'))); killme(); } break; @@ -211,7 +211,7 @@ function wdcal_print_feed($base_path = "") $r = q("SELECT `calendarobject_id`, `calendar_id` FROM %s%sjqcalendar WHERE `id`=%d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($_REQUEST["jq_id"])); if (count($r) != 1) { echo wdcal_jsonp_encode(array('IsSuccess' => false, - 'Msg' => t('No access'))); + 'Msg' => L10n::t('No access'))); killme(); } try { @@ -226,7 +226,7 @@ function wdcal_print_feed($base_path = "") ); } catch (Exception $e) { echo wdcal_jsonp_encode(array('IsSuccess' => false, - 'Msg' => t('No access'))); + 'Msg' => L10n::t('No access'))); killme(); }