diff --git a/mod/community.php b/mod/community.php index 9bea93f12a..f8336a6230 100644 --- a/mod/community.php +++ b/mod/community.php @@ -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); diff --git a/mod/network.php b/mod/network.php index 14f70c9d65..aa4d1a40e0 100644 --- a/mod/network.php +++ b/mod/network.php @@ -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 { diff --git a/src/App.php b/src/App.php index 5c2118f73d..74638a862d 100644 --- a/src/App.php +++ b/src/App.php @@ -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(); } diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 0ebb400f6e..c050e07f08 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -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; } diff --git a/src/Module/Profile.php b/src/Module/Profile.php index 04364ba0cc..991aa9126b 100644 --- a/src/Module/Profile.php +++ b/src/Module/Profile.php @@ -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); diff --git a/view/theme/frio/php/default.php b/view/theme/frio/php/default.php index 73ceea5845..cdb0f16673 100644 --- a/view/theme/frio/php/default.php +++ b/view/theme/frio/php/default.php @@ -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"; ?> diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index 1e255e38b0..5fe0152748 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -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 EOT; - if ($a->is_mobile || $a->is_tablet) { + if (DI::mode()->isMobile() || DI::mode()->isMobile()) { $a->page['htmlhead'] .= <<< EOT