]> git.mxchange.org Git - friendica.git/blobdiff - mod/notifications.php
Merge pull request #8135 from annando/brief
[friendica.git] / mod / notifications.php
index 51b4d80873d189b53a65410b01bcdb255cd4c411..e306f0c8a64d2cf86a41d6c719c6112fa6d560d8 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * @file mod/notifications.php
- * @brief The notifications module
+ * The notifications module
  */
 
 use Friendica\App;
@@ -15,13 +15,13 @@ use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Module\Security\Login;
+use Friendica\Model\Contact;
 use Friendica\Model\Introduction;
-use Friendica\Model\Notify;
 
 function notifications_post(App $a)
 {
        if (!local_user()) {
-               $a->internalRedirect();
+               DI::baseUrl()->redirect();
        }
 
        $request_id = (($a->argc > 1) ? $a->argv[1] : 0);
@@ -31,20 +31,18 @@ function notifications_post(App $a)
        }
 
        if ($request_id) {
-               /** @var Introduction $Intro */
-               $Intro = \Friendica\BaseObject::getClass(Introduction::class);
-               $Intro->fetch(['id' => $request_id, 'uid' => local_user()]);
+               $intro = DI::intro()->selectFirst(['id' => $request_id, 'uid' => local_user()]);
 
                switch ($_POST['submit']) {
                        case L10n::t('Discard'):
-                               $Intro->discard();
+                               $intro->discard();
                                break;
                        case L10n::t('Ignore'):
-                               $Intro->ignore();
+                               $intro->ignore();
                                break;
                }
 
-               $a->internalRedirect('notifications/intros');
+               DI::baseUrl()->redirect('notifications/intros');
        }
 }
 
@@ -112,11 +110,11 @@ function notifications_content(App $a)
                $notifs = $nm->getHomeList($show, $startrec, $perpage);
        // fallback - redirect to main page
        } else {
-               $a->internalRedirect('notifications');
+               DI::baseUrl()->redirect('notifications');
        }
 
        // Set the pager
-       $pager = new Pager($a->query_string, $perpage);
+       $pager = new Pager(DI::args()->getQueryString(), $perpage);
 
        // Add additional informations (needed for json output)
        $notifs['items_page'] = $pager->getItemsPerPage();