]> git.mxchange.org Git - friendica.git/blobdiff - mod/cal.php
Merge pull request #8044 from annando/contact-adding
[friendica.git] / mod / cal.php
index 51d17a10a43b98cb850d25bb39d7197b0f5969d1..c388e9521552cef8fa1aa4a86612ecda7439970b 100644 (file)
@@ -13,15 +13,13 @@ use Friendica\Content\Widget;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
-use Friendica\Core\System;
 use Friendica\Core\Session;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Event;
-use Friendica\Model\Group;
 use Friendica\Model\Item;
 use Friendica\Model\Profile;
-use Friendica\Protocol\DFRN;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Temporal;
 
@@ -68,12 +66,12 @@ function cal_init(App $a)
 
        $cal_widget = Widget\CalendarExport::getHTML();
 
-       if (empty($a->page['aside'])) {
-               $a->page['aside'] = '';
+       if (empty(DI::page()['aside'])) {
+               DI::page()['aside'] = '';
        }
 
-       $a->page['aside'] .= $vcard_widget;
-       $a->page['aside'] .= $cal_widget;
+       DI::page()['aside'] .= $vcard_widget;
+       DI::page()['aside'] .= $cal_widget;
 
        return;
 }
@@ -86,7 +84,7 @@ function cal_content(App $a)
        $i18n = Event::getStrings();
 
        $htpl = Renderer::getMarkupTemplate('event_head.tpl');
-       $a->page['htmlhead'] .= Renderer::replaceMacros($htpl, [
+       DI::page()['htmlhead'] .= Renderer::replaceMacros($htpl, [
                '$module_url' => '/cal/' . $a->data['user']['nickname'],
                '$modparams' => 2,
                '$i18n' => $i18n,
@@ -222,7 +220,7 @@ function cal_content(App $a)
                        foreach ($r as $rr) {
                                $j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
                                if (empty($links[$j])) {
-                                       $links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j;
+                                       $links[$j] = DI::baseUrl() . '/' . DI::args()->getCommand() . '#link-' . $j;
                                }
                        }
                }
@@ -260,8 +258,8 @@ function cal_content(App $a)
                        '$tabs' => $tabs,
                        '$title' => L10n::t('Events'),
                        '$view' => L10n::t('View'),
-                       '$previous' => [System::baseUrl() . "/events/$prevyear/$prevmonth", L10n::t('Previous'), '', ''],
-                       '$next' => [System::baseUrl() . "/events/$nextyear/$nextmonth", L10n::t('Next'), '', ''],
+                       '$previous' => [DI::baseUrl() . "/events/$prevyear/$prevmonth", L10n::t('Previous'), '', ''],
+                       '$next' => [DI::baseUrl() . "/events/$nextyear/$nextmonth", L10n::t('Next'), '', ''],
                        '$calendar' => Temporal::getCalendarTable($y, $m, $links, ' eventcal'),
                        '$events' => $events,
                        "today" => L10n::t("today"),
@@ -289,7 +287,7 @@ function cal_content(App $a)
                // Respect the export feature setting for all other /cal pages if it's not the own profile
                if ((local_user() !== $owner_uid) && !Feature::isEnabled($owner_uid, "export_calendar")) {
                        notice(L10n::t('Permission denied.') . EOL);
-                       $a->internalRedirect('cal/' . $nick);
+                       DI::baseUrl()->redirect('cal/' . $nick);
                }
 
                // Get the export data by uid
@@ -310,7 +308,7 @@ function cal_content(App $a)
                                $return_path = "cal/" . $nick;
                        }
 
-                       $a->internalRedirect($return_path);
+                       DI::baseUrl()->redirect($return_path);
                }
 
                // If nothing went wrong we can echo the export content