aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-02-05 18:06:25 -0800
committerzotlabs <mike@macgirvin.com>2018-02-05 18:06:25 -0800
commitcadd958339323f5fcf4c2b438f7a5e311e477d52 (patch)
tree9c1d4c94d68bc5aa193a4c6cc163c6874f6f6ab1 /Zotlabs
parentb06c52553d1fee69062b533a46b80190d9b4b350 (diff)
downloadvolse-hubzilla-cadd958339323f5fcf4c2b438f7a5e311e477d52.tar.gz
volse-hubzilla-cadd958339323f5fcf4c2b438f7a5e311e477d52.tar.bz2
volse-hubzilla-cadd958339323f5fcf4c2b438f7a5e311e477d52.zip
remove mobile_detect (outdated and unmaintainable)
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Connections.php2
-rw-r--r--Zotlabs/Module/Connedit.php1
-rw-r--r--Zotlabs/Module/Settings/Display.php26
-rw-r--r--Zotlabs/Render/Theme.php30
4 files changed, 8 insertions, 51 deletions
diff --git a/Zotlabs/Module/Connections.php b/Zotlabs/Module/Connections.php
index f42ff9b84..255731c9c 100644
--- a/Zotlabs/Module/Connections.php
+++ b/Zotlabs/Module/Connections.php
@@ -232,7 +232,7 @@ class Connections extends \Zotlabs\Web\Controller {
if($rr['xchan_url']) {
if(($rr['vcard']) && is_array($rr['vcard']['tels']) && $rr['vcard']['tels'][0]['nr'])
- $phone = ((\App::$is_mobile || \App::$is_tablet) ? $rr['vcard']['tels'][0]['nr'] : '');
+ $phone = $rr['vcard']['tels'][0]['nr'];
else
$phone = '';
diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php
index e23a751d9..f359175c1 100644
--- a/Zotlabs/Module/Connedit.php
+++ b/Zotlabs/Module/Connedit.php
@@ -895,7 +895,6 @@ class Connedit extends \Zotlabs\Web\Controller {
'$permnote_self' => t('Some permissions may be inherited from your channel\'s <a href="settings"><strong>privacy settings</strong></a>, which have higher priority than individual settings. You can change those settings here but they wont have any impact unless the inherited setting changes.'),
'$lastupdtext' => t('Last update:'),
'$last_update' => relative_date($contact['abook_connected']),
- '$is_mobile' => ((\App::$is_mobile || \App::$is_tablet) ? true : false),
'$profile_select' => contact_profile_assign($contact['abook_profile']),
'$multiprofs' => $multiprofs,
'$contact_id' => $contact['abook_id'],
diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php
index e1ea0e3e5..340b3c0bb 100644
--- a/Zotlabs/Module/Settings/Display.php
+++ b/Zotlabs/Module/Settings/Display.php
@@ -21,7 +21,7 @@ class Display {
if(! $theme)
$theme = 'redbasic';
- $mobile_theme = ((x($_POST,'mobile_theme')) ? notags(trim($_POST['mobile_theme'])) : '');
+
$preload_images = ((x($_POST,'preload_images')) ? intval($_POST['preload_images']) : 0);
$channel_menu = ((x($_POST,'channel_menu')) ? intval($_POST['channel_menu']) : 0);
$user_scalable = ((x($_POST,'user_scalable')) ? intval($_POST['user_scalable']) : 0);
@@ -47,11 +47,6 @@ class Display {
if($itemspage > 100)
$itemspage = 100;
- if ($mobile_theme == "---")
- del_pconfig(local_channel(),'system','mobile_theme');
- else {
- set_pconfig(local_channel(),'system','mobile_theme',$mobile_theme);
- }
set_pconfig(local_channel(),'system','preload_images',$preload_images);
set_pconfig(local_channel(),'system','user_scalable',$user_scalable);
@@ -114,10 +109,6 @@ class Display {
$theme = (($existing_theme) ? $existing_theme : $default_theme);
- $default_mobile_theme = get_config('system','mobile_theme');
- if(! $mobile_default_theme)
- $mobile_default_theme = 'none';
-
$allowed_themes_str = get_config('system','allowed_themes');
$allowed_themes_raw = explode(',',$allowed_themes_str);
$allowed_themes = array();
@@ -135,26 +126,19 @@ class Display {
$info = get_theme_info($th);
$compatible = check_plugin_versions($info);
- if(!$compatible) {
- $mobile_themes[$f] = $themes[$f] = sprintf(t('%s - (Incompatible)'), $f);
+ if(! $compatible) {
+ $themes[$f] = sprintf(t('%s - (Incompatible)'), $f);
continue;
}
$is_experimental = file_exists('view/theme/' . $th . '/experimental');
$unsupported = file_exists('view/theme/' . $th . '/unsupported');
- $is_mobile = file_exists('view/theme/' . $th . '/mobile');
$is_library = file_exists('view/theme/'. $th . '/library');
- $mobile_themes['---'] = t("No special theme for mobile devices");
if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){
$theme_name = (($is_experimental) ? sprintf(t('%s - (Experimental)'), $f) : $f);
if (! $is_library) {
- if($is_mobile) {
- $mobile_themes[$f] = $themes[$f] = $theme_name . ' (' . t('mobile') . ')';
- }
- else {
- $mobile_themes[$f] = $themes[$f] = $theme_name;
- }
+ $themes[$f] = $theme_name;
}
}
}
@@ -166,7 +150,6 @@ class Display {
$theme_selected = explode(':', $theme_selected)[0];
}
- $mobile_theme_selected = (!x($_SESSION,'mobile_theme')? $default_mobile_theme : $_SESSION['mobile_theme']);
$preload_images = get_pconfig(local_channel(),'system','preload_images');
$preload_images = (($preload_images===false)? '0': $preload_images); // default if not set: 0
@@ -213,7 +196,6 @@ class Display {
'$theme' => (($themes) ? array('theme', t('Display Theme:'), $theme_selected, '', $themes, 'preview') : false),
'$schema' => array('schema', t('Select scheme'), $existing_schema, '' , $schemas),
- '$mobile_theme' => (($mobile_themes) ? array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, '') : false),
'$preload_images' => array('preload_images', t("Preload images before rendering the page"), $preload_images, t("The subjective page load time will be longer but the page will be ready when displayed"), $yes_no),
'$user_scalable' => array('user_scalable', t("Enable user zoom on mobile devices"), $user_scalable, '', $yes_no),
'$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')),
diff --git a/Zotlabs/Render/Theme.php b/Zotlabs/Render/Theme.php
index 09cc7a4d4..0eebba1ba 100644
--- a/Zotlabs/Render/Theme.php
+++ b/Zotlabs/Render/Theme.php
@@ -8,10 +8,8 @@ use App;
class Theme {
static $system_theme = null;
- static $system_mobile_theme = null;
static $session_theme = null;
- static $session_mobile_theme = null;
/**
* @brief Array with base or fallback themes.
@@ -32,10 +30,6 @@ class Theme {
? \App::$config['system']['theme'] : '');
self::$session_theme = ((isset($_SESSION) && x($_SESSION, 'theme'))
? $_SESSION['theme'] : self::$system_theme);
- self::$system_mobile_theme = ((isset(\App::$config['system']['mobile_theme']))
- ? \App::$config['system']['mobile_theme'] : '');
- self::$session_mobile_theme = ((isset($_SESSION) && x($_SESSION, 'mobile_theme'))
- ? $_SESSION['mobile_theme'] : self::$system_mobile_theme);
$page_theme = null;
@@ -55,30 +49,12 @@ class Theme {
if(array_key_exists('theme', \App::$layout) && \App::$layout['theme'])
$page_theme = \App::$layout['theme'];
- // If the viewer is on a mobile device, ensure that we're using a mobile
- // theme of some kind or whatever the viewer's preference is for mobile
- // viewing (if applicable)
+ $chosen_theme = self::$session_theme;
- if(\App::$is_mobile || \App::$is_tablet) {
- if(isset($_SESSION['show_mobile']) && (! $_SESSION['show_mobile'])) {
- $chosen_theme = self::$session_theme;
- }
- else {
- $chosen_theme = self::$session_mobile_theme;
-
- if($chosen_theme === '' || $chosen_theme === '---' ) {
- // user has selected to have the mobile theme be the same as the normal one
- $chosen_theme = self::$session_theme;
- }
- }
+ if($page_theme) {
+ $chosen_theme = $page_theme;
}
- else {
- $chosen_theme = self::$session_theme;
- if($page_theme) {
- $chosen_theme = $page_theme;
- }
- }
if(array_key_exists('theme_preview', $_GET))
$chosen_theme = $_GET['theme_preview'];