]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Event.php
codeblock updates
[friendica.git] / src / Model / Event.php
index 8b7c7e706c15deebd3522d9df8a43ef4478d72f2..3ce86017ba99028203aeb946a09c1a70bbe530cb 100644 (file)
@@ -48,8 +48,10 @@ class Event extends BaseObject
                }
 
                if ($simple) {
+                       $o = '';
+
                        if (!empty($event['summary'])) {
-                               $o = "<h3>" . BBCode::convert(Strings::escapeHtml($event['summary']), false, $simple) . "</h3>";
+                               $o .= "<h3>" . BBCode::convert(Strings::escapeHtml($event['summary']), false, $simple) . "</h3>";
                        }
 
                        if (!empty($event['desc'])) {
@@ -239,8 +241,6 @@ class Event extends BaseObject
         */
        public static function store($arr)
        {
-               $a = self::getApp();
-
                $event = [];
                $event['id']        = intval(defaults($arr, 'id'       , 0));
                $event['uid']       = intval(defaults($arr, 'uid'      , 0));
@@ -418,7 +418,6 @@ class Event extends BaseObject
                        "February"  => L10n::t("February"),
                        "March"     => L10n::t("March"),
                        "April"     => L10n::t("April"),
-                       "May"       => L10n::t("May"),
                        "June"      => L10n::t("June"),
                        "July"      => L10n::t("July"),
                        "August"    => L10n::t("August"),
@@ -643,17 +642,19 @@ class Event extends BaseObject
         *
         * @todo  Implement timezone support
         */
-       private static function formatListForExport(array $events, $format, $timezone)
+       private static function formatListForExport(array $events, $format)
        {
+               $o = '';
+
                if (!count($events)) {
-                       return '';
+                       return $o;
                }
 
                switch ($format) {
                        // Format the exported data as a CSV file.
                        case "csv":
                                header("Content-type: text/csv");
-                               $o = '"Subject", "Start Date", "Start Time", "Description", "End Date", "End Time", "Location"' . PHP_EOL;
+                               $o .= '"Subject", "Start Date", "Start Time", "Description", "End Date", "End Time", "Location"' . PHP_EOL;
 
                                foreach ($events as $event) {
                                        /// @todo The time / date entries don't include any information about the
@@ -795,19 +796,14 @@ class Event extends BaseObject
        {
                $process = false;
 
-               $user = DBA::selectFirst('user', ['timezone'], ['uid' => $uid]);
-               if (DBA::isResult($user)) {
-                       $timezone = $user['timezone'];
-               }
-
                // Get all events which are owned by a uid (respects permissions).
                $events = self::getListByUserId($uid);
 
                // We have the events that are available for the requestor.
                // Now format the output according to the requested format.
-               $res = self::formatListForExport($events, $format, $timezone);
+               $res = self::formatListForExport($events, $format);
 
-               // If there are results the precess was successfull.
+               // If there are results the precess was successful.
                if (!empty($res)) {
                        $process = true;
                }