]> git.mxchange.org Git - friendica.git/blobdiff - mod/notifications.php
Merge pull request #5862 from nupplaphil/rename_App_Methods
[friendica.git] / mod / notifications.php
index acd49de0632e698a537efcd4d2badce8517c7cd0..1885f96447c9f7e54276cd059bd26cddcaa2482c 100644 (file)
@@ -12,6 +12,7 @@ use Friendica\Core\NotificationsManager;
 use Friendica\Core\Protocol;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\Module\Login;
 
 function notifications_post(App $a)
 {
@@ -65,7 +66,7 @@ function notifications_content(App $a)
 {
        if (!local_user()) {
                notice(L10n::t('Permission denied.') . EOL);
-               return;
+               return Login::form();
        }
 
        $page = defaults($_REQUEST, 'page', 1);
@@ -119,7 +120,7 @@ function notifications_content(App $a)
        }
 
        // Set the pager
-       $a->set_pager_itemspage($perpage);
+       $a->setPagerItemsPage($perpage);
 
        // Add additional informations (needed for json output)
        $notifs['items_page'] = $a->pager['itemspage'];
@@ -132,6 +133,11 @@ function notifications_content(App $a)
 
        $notif_tpl = get_markup_template('notifications.tpl');
 
+       $notif_show_lnk = [
+               'href' => ($show ? 'notifications/' . $notifs['ident'] : 'notifications/' . $notifs['ident'] . '?show=all' ),
+               'text' => ($show ? L10n::t('Show unread') : L10n::t('Show all')),
+       ];
+
        // Process the data for template creation
        if (defaults($notifs, 'ident', '') === 'introductions') {
                $sugg = get_markup_template('suggestions.tpl');
@@ -303,11 +309,6 @@ function notifications_content(App $a)
                $notif_nocontent = L10n::t('No more %s notifications.', $notifs['ident']);
        }
 
-       $notif_show_lnk = [
-               'href' => ($show ? 'notifications/' . $notifs['ident'] : 'notifications/' . $notifs['ident'] . '?show=all' ),
-               'text' => ($show ? L10n::t('Show unread') : L10n::t('Show all')),
-       ];
-
        $o .= replace_macros($notif_tpl, [
                '$notif_header'    => $notif_header,
                '$tabs'            => $tabs,