remove mobile_detect (outdated and unmaintainable)

This commit is contained in:
zotlabs
2018-02-05 18:06:25 -08:00
parent b06c52553d
commit cadd958339
8 changed files with 13 additions and 307 deletions

View File

@@ -38,7 +38,6 @@ require_once('include/datetime.php');
require_once('include/language.php');
require_once('include/nav.php');
require_once('include/permissions.php');
require_once('library/Mobile_Detect/Mobile_Detect.php');
require_once('include/features.php');
require_once('include/taxonomy.php');
require_once('include/channel.php');
@@ -788,9 +787,7 @@ class App {
public static $theme_info = array();
public static $is_sys = false;
public static $nav_sel;
public static $is_mobile = false;
public static $is_tablet = false;
public static $comanche;
public static $comanche;
public static $channel_links;
@@ -960,14 +957,6 @@ class App {
self::$pager['start'] = 0;
self::$pager['total'] = 0;
/*
* Detect mobile devices
*/
$mobile_detect = new Mobile_Detect();
self::$is_mobile = $mobile_detect->isMobile();
self::$is_tablet = $mobile_detect->isTablet();
/*
* register template engines
*/
@@ -2198,22 +2187,6 @@ function construct_page() {
}
}
if(App::$is_mobile || App::$is_tablet) {
if(isset($_SESSION['show_mobile']) && !$_SESSION['show_mobile']) {
$link = z_root() . '/toggle_mobile?f=&address=' . curPageURL();
}
else {
$link = z_root() . '/toggle_mobile?f=&off=1&address=' . curPageURL();
}
if ((isset($_SESSION) && $_SESSION['mobile_theme'] !='' && $_SESSION['mobile_theme'] !='---' ) ||
(isset(App::$config['system']['mobile_theme']) && !isset($_SESSION['mobile_theme']))) {
App::$page['footer'] .= replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array(
'$toggle_link' => $link,
'$toggle_text' => t('toggle mobile')
));
}
}
$page = App::$page;
$profile = App::$profile;