]> git.mxchange.org Git - friendica-addons.git/blobdiff - dav/friendica/main.php
Use short form array syntax everywhere
[friendica-addons.git] / dav / friendica / main.php
index f0af57c91727ef5924067805b739b9602ea20c31..e1dfe84f8d884ee3143091423080ec3c23cf2771 100644 (file)
@@ -198,7 +198,7 @@ function dav_content()
                        } else {
                                $server = dav_create_server(true, true, false);
                                $cals   = dav_get_current_user_calendars($server, DAV_ACL_READ);
-                               $x      = wdcal_printCalendar($cals, array(), $a->get_baseurl() . "/dav/wdcal/feed/", "week", 0, 200);
+                               $x      = wdcal_printCalendar($cals, [], $a->get_baseurl() . "/dav/wdcal/feed/", "week", 0, 200);
                        }
                }
        } catch (DAVVersionMismatchException $e) {
@@ -238,12 +238,12 @@ function dav_event_updated_hook(&$a, &$b)
  */
 function dav_profile_tabs_hook(&$a, &$b)
 {
-       $b["tabs"][] = array(
+       $b["tabs"][] = [
                "label" => t('Calendar'),
                "url"   => $a->get_baseurl() . "/dav/wdcal/",
                "sel"   => "",
                "title" => t('Extended calendar with CalDAV-support'),
-       );
+       ];
 }
 
 
@@ -261,7 +261,7 @@ function dav_cron(&$a, &$b)
                q("UPDATE %s%snotifications SET `notified` = 1 WHERE `id` = %d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, $not["id"]);
                $event    = q("SELECT * FROM %s%sjqcalendar WHERE `calendarobject_id` = %d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, $not["calendarobject_id"]);
                $calendar = q("SELECT * FROM %s%scalendars WHERE `id` = %d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, $not["calendar_id"]);
-               $users    = array();
+               $users    = [];
                if (count($calendar) != 1 || count($event) == 0) continue;
                switch ($calendar[0]["namespace"]) {
                        case CALDAV_NAMESPACE_PRIVATE:
@@ -274,11 +274,11 @@ function dav_cron(&$a, &$b)
                        case "email":
                        case "display": // @TODO implement "Display"
                                foreach ($users as $user) {
-                                       $find      = array("%to%", "%event%", "%url%");
-                                       $repl      = array($user["username"], $event[0]["Summary"], $a->get_baseurl() . "/dav/wdcal/" . $calendar[0]["id"] . "/" . $not["calendarobject_id"] . "/");
+                                       $find      = ["%to%", "%event%", "%url%"];
+                                       $repl      = [$user["username"], $event[0]["Summary"], $a->get_baseurl() . "/dav/wdcal/" . $calendar[0]["id"] . "/" . $not["calendarobject_id"] . "/"];
                                        $text_text = str_replace($find, $repl, "Hi %to%!\n\nThe event \"%event%\" is about to begin:\n%url%");
                                        $text_html = str_replace($find, $repl, "Hi %to%!<br>\n<br>\nThe event \"%event%\" is about to begin:<br>\n<a href='" . "%url%" . "'>%url%</a>");
-                                       $params    = array(
+                                       $params    = [
                                                'fromName'             => FRIENDICA_PLATFORM,
                                                'fromEmail'            => t('noreply') . '@' . $a->get_hostname(),
                                                'replyTo'              => t('noreply') . '@' . $a->get_hostname(),
@@ -287,7 +287,7 @@ function dav_cron(&$a, &$b)
                                                'htmlVersion'          => $text_html,
                                                'textVersion'          => $text_text,
                                                'additionalMailHeader' => "",
-                                       );
+                                       ];
                                        Emailer::send($params);
                                }
                                break;