]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
Merge pull request #8297 from MrPetovan/task/8285-api-events
[friendica.git] / mod / network.php
index db6d8eaf4516f48f8e8f84dc60c33c1e30b1ca49..6c63753d9114de8f9dd8b412a204c24795822744 100644 (file)
@@ -1,7 +1,22 @@
 <?php
-
 /**
- * @file mod/network.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
 
 use Friendica\App;
@@ -213,14 +228,12 @@ function networkPager(App $a, Pager $pager, $update)
                return ' LIMIT 100';
        }
 
-       //  check if we serve a mobile device and get the user settings
-       //  accordingly
        if (DI::mode()->isMobile()) {
-               $itemspage_network = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network');
-               $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 20);
+               $itemspage_network = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
+                       DI::config()->get('system', 'itemspage_network_mobile'));
        } else {
-               $itemspage_network = DI::pConfig()->get(local_user(), 'system', 'itemspage_network');
-               $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 40);
+               $itemspage_network = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
+                       DI::config()->get('system', 'itemspage_network'));
        }
 
        //  now that we have the user settings, see if the theme forces
@@ -276,7 +289,7 @@ function networkConversation(App $a, $items, Pager $pager, $mode, $update, $orde
                $items = [];
        }
 
-       $o = conversation($a, $items, $pager, $mode, $update, false, $ordering, local_user());
+       $o = conversation($a, $items, $mode, $update, false, $ordering, local_user());
 
        if (!$update) {
                if (DI::pConfig()->get(local_user(), 'system', 'infinite_scroll')) {
@@ -362,7 +375,7 @@ function networkFlatView(App $a, $update = 0)
                }
        }
 
-       $pager = new Pager(DI::args()->getQueryString());
+       $pager = new Pager(DI::l10n(), DI::args()->getQueryString());
 
        networkPager($a, $pager, $update);
 
@@ -654,7 +667,7 @@ function networkThreadedView(App $a, $update, $parent)
                $sql_range = '';
        }
 
-       $pager = new Pager(DI::args()->getQueryString());
+       $pager = new Pager(DI::l10n(), DI::args()->getQueryString());
 
        $pager_sql = networkPager($a, $pager, $update);
 
@@ -879,7 +892,7 @@ function network_tabs(App $a)
 {
        // item filter tabs
        /// @TODO fix this logic, reduce duplication
-       /// $a->page['content'] .= '<div class="tabs-wrapper">';
+       /// DI::page()['content'] .= '<div class="tabs-wrapper">';
        list($no_active, $all_active, $post_active, $conv_active, $new_active, $starred_active, $bookmarked_active) = network_query_get_sel_tab($a);
 
        // if no tabs are selected, defaults to activitys