]> git.mxchange.org Git - friendica.git/blobdiff - mod/cal.php
Fix commenting on public posts
[friendica.git] / mod / cal.php
index d4830842bb05159a2d015d1a655cc24668c1cc8c..ac12d69b914c8e122bc50d1ba3eb2b750983ffab 100644 (file)
@@ -44,7 +44,7 @@ function cal_init(App $a)
                throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
        }
 
-       if ($a->argc < 2) {
+       if (DI::args()->getArgc() < 2) {
                throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
        }
 
@@ -52,11 +52,11 @@ function cal_init(App $a)
 
        // if it's a json request abort here becaus we don't
        // need the widget data
-       if (!empty($a->argv[2]) && ($a->argv[2] === 'json')) {
+       if (!empty(DI::args()->getArgv()[2]) && (DI::args()->getArgv()[2] === 'json')) {
                return;
        }
 
-       $owner = User::getOwnerDataByNick($a->argv[1]);
+       $owner = User::getOwnerDataByNick(DI::args()->getArgv()[1]);
        if (empty($owner)) {
                throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
        }
@@ -73,7 +73,7 @@ function cal_init(App $a)
 
 function cal_content(App $a)
 {
-       $owner = User::getOwnerDataByNick($a->argv[1]);
+       $owner = User::getOwnerDataByNick(DI::args()->getArgv()[1]);
        if (empty($owner)) {
                throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
        }
@@ -101,9 +101,9 @@ function cal_content(App $a)
        $ignored = (!empty($_REQUEST['ignored']) ? intval($_REQUEST['ignored']) : 0);
 
        $format = 'ical';
-       if ($a->argc == 4 && $a->argv[2] == 'export') {
+       if (DI::args()->getArgc() == 4 && DI::args()->getArgv()[2] == 'export') {
                $mode = 'export';
-               $format = $a->argv[3];
+               $format = DI::args()->getArgv()[3];
        }
 
        // Setup permissions structures
@@ -127,7 +127,7 @@ function cal_content(App $a)
        $sql_extra = " AND `event`.`cid` = 0 " . $sql_perms;
 
        // get the tab navigation bar
-       $tabs = BaseProfile::getTabsHTML($a, 'cal', false, $owner);
+       $tabs = BaseProfile::getTabsHTML($a, 'cal', false, $owner['nickname'], $owner['hide-friends']);
 
        // The view mode part is similiar to /mod/events.php
        if ($mode == 'view') {
@@ -172,7 +172,7 @@ function cal_content(App $a)
                $finish = sprintf('%d-%d-%d %d:%d:%d', $y, $m, $dim, 23, 59, 59);
 
 
-               if (!empty($a->argv[2]) && ($a->argv[2] === 'json')) {
+               if (!empty(DI::args()->getArgv()[2]) && (DI::args()->getArgv()[2] === 'json')) {
                        if (!empty($_GET['start'])) {
                                $start = $_GET['start'];
                        }
@@ -220,7 +220,7 @@ function cal_content(App $a)
                // transform the event in a usable array
                $events = Event::prepareListForTemplate($r);
 
-               if (!empty($a->argv[2]) && ($a->argv[2] === 'json')) {
+               if (!empty(DI::args()->getArgv()[2]) && (DI::args()->getArgv()[2] === 'json')) {
                        echo json_encode($events);
                        exit();
                }