]> git.mxchange.org Git - friendica.git/commitdiff
Remove deprecated App::is_mobile/is_tablet - replace with DI::mode()->isMobile()...
authornupplaPhil <admin@philipp.info>
Mon, 16 Dec 2019 00:12:07 +0000 (01:12 +0100)
committernupplaPhil <admin@philipp.info>
Sun, 29 Dec 2019 19:17:50 +0000 (20:17 +0100)
mod/community.php
mod/network.php
src/App.php
src/Model/Profile.php
src/Module/Profile.php
view/theme/frio/php/default.php
view/theme/frio/theme.php
view/theme/vier/theme.php

index 9bea93f12a6a287379a48d01196316a3ab34b78e..f8336a623019b42b59482c12f77f79d78ce65d3d 100644 (file)
@@ -15,6 +15,7 @@ use Friendica\Core\PConfig;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Item;
 use Friendica\Model\User;
 
@@ -136,7 +137,7 @@ function community_content(App $a, $update = 0)
        }
 
        // check if we serve a mobile device and get the user settings accordingly
-       if ($a->is_mobile) {
+       if (DI::mode()->isMobile()) {
                $itemspage_network = PConfig::get(local_user(), 'system', 'itemspage_mobile_network', 20);
        } else {
                $itemspage_network = PConfig::get(local_user(), 'system', 'itemspage_network', 40);
index 14f70c9d659e8d6a1dad84f93c774e531c77d40f..aa4d1a40e0c8bebf510f9e2cac9a96f126679d39 100644 (file)
@@ -228,7 +228,7 @@ function networkPager(App $a, Pager $pager, $update)
 
        //  check if we serve a mobile device and get the user settings
        //  accordingly
-       if ($a->is_mobile) {
+       if (DI::mode()->isMobile()) {
                $itemspage_network = PConfig::get(local_user(), 'system', 'itemspage_mobile_network');
                $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 20);
        } else {
index 5c2118f73d63c0e841bf46b91731270d4f77d1ae..74638a862d48fd19e9bc6edd1a992c640903fc4e 100644 (file)
@@ -66,10 +66,6 @@ class App
        public $timezone;
        public $interactive = true;
        public $identities;
-       /** @deprecated 2019.09 - Use App\Mode->isMobile() instead */
-       public $is_mobile;
-       /** @deprecated 2019.09 - Use App\Mode->isTable() instead */
-       public $is_tablet;
        public $theme_info = [];
        public $category;
        // Allow themes to control internal parameters
@@ -183,9 +179,6 @@ class App
                $this->module       = $module->getName();
                $this->page         = $page;
 
-               $this->is_mobile = $mode->isMobile();
-               $this->is_tablet = $mode->isTablet();
-
                $this->load();
        }
 
index 0ebb400f6eb3eefca7e8696f02782328f132114f..c050e07f0875bfc2d1c00983ee38ec2c1b90ca2b 100644 (file)
@@ -571,7 +571,7 @@ class Profile
                $a = \get_app();
                $o = '';
 
-               if (!local_user() || $a->is_mobile || $a->is_tablet) {
+               if (!local_user() || DI::mode()->isMobile() || DI::mode()->isMobile()) {
                        return $o;
                }
 
@@ -668,7 +668,7 @@ class Profile
                $a = \get_app();
                $o = '';
 
-               if (!local_user() || $a->is_mobile || $a->is_tablet) {
+               if (!local_user() || DI::mode()->isMobile() || DI::mode()->isMobile()) {
                        return $o;
                }
 
index 04364ba0cc57fe30e77f07b3b192b072202f2fdf..991aa9126b12306bfe4a6f880a34ada0655294e1 100644 (file)
@@ -290,7 +290,7 @@ class Profile extends BaseModule
 
                        //  check if we serve a mobile device and get the user settings
                        //  accordingly
-                       if ($a->is_mobile) {
+                       if (DI::mode()->isMobile()) {
                                $itemspage_network = PConfig::get(local_user(), 'system', 'itemspage_mobile_network', 10);
                        } else {
                                $itemspage_network = PConfig::get(local_user(), 'system', 'itemspage_network', 20);
index 73ceea5845fb5f8f650bdd929cc03bd215d920f3..cdb0f16673cba5a089b8c2a3c585d347fd5bf31d 100644 (file)
@@ -22,7 +22,7 @@ if (!isset($minimal)) {
 
 $basepath = DI::baseUrl()->getUrlPath() ? "/" . DI::baseUrl()->getUrlPath() . "/" : "/";
 $frio = "view/theme/frio";
-$view_mode_class = ($a->is_mobile || $a->is_tablet) ? 'mobile-view' : 'desktop-view';
+$view_mode_class = (DI::mode()->isMobile() || DI::mode()->isMobile()) ? 'mobile-view' : 'desktop-view';
 $is_singleuser = Config::get('system', 'singleuser');
 $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
 ?>
index 1e255e38b042e917aed2c7c0cfe1d23a03eb692b..5fe0152748ec59dd22b24c1d720a18a05838e0f4 100644 (file)
@@ -35,7 +35,7 @@ function frio_init(App $a)
 
        // if the device is a mobile device set js is_mobile
        // variable so the js scripts can use this information
-       if ($a->is_mobile || $a->is_tablet) {
+       if (DI::mode()->isMobile() || DI::mode()->isMobile()) {
                $a->page['htmlhead'] .= <<< EOT
                        <script type="text/javascript">
                                var is_mobile = 1;
index 2ffa957fe0016e54747b63b2ee0333757344912a..9f974eda0744e00da949611d6cf500031e70ad97 100644 (file)
@@ -36,7 +36,7 @@ function vier_init(App $a)
                $a->page['htmlhead'] .= "<link rel='stylesheet' type='text/css' href='view/theme/vier/wide.css' media='screen and (min-width: 1300px)'/>\n";
        }
 
-       if ($a->is_mobile || $a->is_tablet) {
+       if (DI::mode()->isMobile() || DI::mode()->isMobile()) {
                $a->page['htmlhead'] .= '<meta name=viewport content="width=device-width, initial-scale=1">'."\n";
                $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="view/theme/vier/mobile.css" media="screen"/>'."\n";
        }
@@ -64,7 +64,7 @@ function cmtBbClose(id) {
 </script>
 EOT;
 
-       if ($a->is_mobile || $a->is_tablet) {
+       if (DI::mode()->isMobile() || DI::mode()->isMobile()) {
                $a->page['htmlhead'] .= <<< EOT
 <script>
        $(document).ready(function() {