X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcal.php;h=3f249da0aca21c457146fd4243eebc669ea06430;hb=f889aeffb354f46cba746c84fddffdf8689f3005;hp=ac12d69b914c8e122bc50d1ba3eb2b750983ffab;hpb=4495e83eca67986ecbd5e083509c782116d77c6c;p=friendica.git diff --git a/mod/cal.php b/mod/cal.php index ac12d69b91..3f249da0ac 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -1,6 +1,6 @@ intval($_GET['id'] ?? 0), 'start' => $start, 'finish' => $finish, - 'adjust_start' => $adjust_start, - 'adjust_finish' => $adjust_finish, 'ignore' => $ignored, ]; @@ -210,7 +207,7 @@ function cal_content(App $a) if (DBA::isResult($r)) { $r = Event::sortByDate($r); foreach ($r as $rr) { - $j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j'); + $j = DateTimeFormat::local($rr['start'], 'j'); if (empty($links[$j])) { $links[$j] = DI::baseUrl() . '/' . DI::args()->getCommand() . '#link-' . $j; } @@ -221,19 +218,14 @@ function cal_content(App $a) $events = Event::prepareListForTemplate($r); if (!empty(DI::args()->getArgv()[2]) && (DI::args()->getArgv()[2] === 'json')) { - echo json_encode($events); - exit(); + System::jsonExit($events); } // links: array('href', 'text', 'extra css classes', 'title') if (!empty($_GET['id'])) { $tpl = Renderer::getMarkupTemplate("event.tpl"); } else { -// if (DI::config()->get('experimentals','new_calendar')==1){ $tpl = Renderer::getMarkupTemplate("events_js.tpl"); -// } else { -// $tpl = Renderer::getMarkupTemplate("events.tpl"); -// } } // Get rid of dashes in key names, Smarty3 can't handle them @@ -262,8 +254,7 @@ function cal_content(App $a) ]); if (!empty($_GET['id'])) { - echo $o; - exit(); + System::httpExit($o); } return $o; @@ -298,10 +289,8 @@ function cal_content(App $a) // If nothing went wrong we can echo the export content if ($evexport["success"]) { - header('Content-type: text/calendar'); header('content-disposition: attachment; filename="' . DI::l10n()->t('calendar') . '-' . $nick . '.' . $evexport["extension"] . '"'); - echo $evexport["content"]; - exit(); + System::httpExit($evexport["content"], Response::TYPE_BLANK, 'text/calendar'); } return;