provide an expert option to opt out from user zoom on mobile devices
This commit is contained in:
		
							
								
								
									
										5
									
								
								boot.php
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								boot.php
									
									
									
									
									
								
							| @@ -980,6 +980,10 @@ class App { | |||||||
|  |  | ||||||
| 	function build_pagehead() { | 	function build_pagehead() { | ||||||
|  |  | ||||||
|  | 		$user_scalable = ((local_user()) ? get_pconfig(local_user(),'system','user_scalable') : 1); | ||||||
|  | 		if ($user_scalable === false) | ||||||
|  | 			$user_scalable = 1; | ||||||
|  |  | ||||||
| 		$interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000); | 		$interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000); | ||||||
| 		if($interval < 10000) | 		if($interval < 10000) | ||||||
| 			$interval = 40000; | 			$interval = 40000; | ||||||
| @@ -993,6 +997,7 @@ class App { | |||||||
| 		 */ | 		 */ | ||||||
| 		$tpl = get_markup_template('head.tpl'); | 		$tpl = get_markup_template('head.tpl'); | ||||||
| 		$this->page['htmlhead'] = replace_macros($tpl, array( | 		$this->page['htmlhead'] = replace_macros($tpl, array( | ||||||
|  | 			'$user_scalable' => $user_scalable, | ||||||
| 			'$baseurl' => $this->get_baseurl(), | 			'$baseurl' => $this->get_baseurl(), | ||||||
| 			'$local_user' => local_user(), | 			'$local_user' => local_user(), | ||||||
| 			'$generator' => RED_PLATFORM . ' ' . RED_VERSION, | 			'$generator' => RED_PLATFORM . ' ' . RED_VERSION, | ||||||
|   | |||||||
| @@ -135,6 +135,7 @@ function settings_post(&$a) { | |||||||
|  |  | ||||||
| 		$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme']))  : $a->channel['channel_theme']); | 		$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme']))  : $a->channel['channel_theme']); | ||||||
| 		$mobile_theme = ((x($_POST,'mobile_theme')) ? notags(trim($_POST['mobile_theme']))  : ''); | 		$mobile_theme = ((x($_POST,'mobile_theme')) ? notags(trim($_POST['mobile_theme']))  : ''); | ||||||
|  | 		$user_scalable = ((x($_POST,'user_scalable')) ? intval($_POST['user_scalable'])  : 0); | ||||||
| 		$nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile'])  : 0);   | 		$nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile'])  : 0);   | ||||||
| 		$browser_update   = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0); | 		$browser_update   = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0); | ||||||
| 		$browser_update   = $browser_update * 1000; | 		$browser_update   = $browser_update * 1000; | ||||||
| @@ -151,7 +152,7 @@ function settings_post(&$a) { | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| //		$chanview_full = ((x($_POST,'chanview_full')) ? intval($_POST['chanview_full']) : 0); | //		$chanview_full = ((x($_POST,'chanview_full')) ? intval($_POST['chanview_full']) : 0); | ||||||
|  | 		set_pconfig(local_user(),'system','user_scalable',$user_scalable); | ||||||
| 		set_pconfig(local_user(),'system','update_interval', $browser_update); | 		set_pconfig(local_user(),'system','update_interval', $browser_update); | ||||||
| 		set_pconfig(local_user(),'system','itemspage', $itemspage); | 		set_pconfig(local_user(),'system','itemspage', $itemspage); | ||||||
| 		set_pconfig(local_user(),'system','no_smilies',$nosmile); | 		set_pconfig(local_user(),'system','no_smilies',$nosmile); | ||||||
| @@ -727,6 +728,9 @@ function settings_content(&$a) { | |||||||
| 		} | 		} | ||||||
| 		$theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']); | 		$theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']); | ||||||
| 		$mobile_theme_selected = (!x($_SESSION,'mobile_theme')? $default_mobile_theme : $_SESSION['mobile_theme']); | 		$mobile_theme_selected = (!x($_SESSION,'mobile_theme')? $default_mobile_theme : $_SESSION['mobile_theme']); | ||||||
|  |  | ||||||
|  | 		$user_scalable = get_pconfig(local_user(),'system','user_scalable'); | ||||||
|  | 		$user_scalable = (($user_scalable===false)? '1': $user_scalable); // default if not set: 1 | ||||||
| 		 | 		 | ||||||
| 		$browser_update = intval(get_pconfig(local_user(), 'system','update_interval')); | 		$browser_update = intval(get_pconfig(local_user(), 'system','update_interval')); | ||||||
| 		$browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds | 		$browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds | ||||||
| @@ -753,11 +757,13 @@ function settings_content(&$a) { | |||||||
| 		 | 		 | ||||||
| 			'$theme'	=> array('theme', t('Display Theme:'), $theme_selected, '', $themes, 'preview'), | 			'$theme'	=> array('theme', t('Display Theme:'), $theme_selected, '', $themes, 'preview'), | ||||||
| 			'$mobile_theme'	=> array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, ''), | 			'$mobile_theme'	=> array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, ''), | ||||||
|  | 			'$user_scalable' => array('user_scalable', t("Enable user zoom on mobile devices"), $user_scalable, ''), | ||||||
| 			'$ajaxint'   => array('browser_update',  t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')), | 			'$ajaxint'   => array('browser_update',  t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')), | ||||||
| 			'$itemspage'   => array('itemspage',  t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 100 items')), | 			'$itemspage'   => array('itemspage',  t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 100 items')), | ||||||
| 			'$nosmile'	=> array('nosmile', t("Don't show emoticons"), $nosmile, ''), | 			'$nosmile'	=> array('nosmile', t("Don't show emoticons"), $nosmile, ''), | ||||||
| 			'$layout_editor' => t('System Page Layout Editor - (advanced)'), | 			'$layout_editor' => t('System Page Layout Editor - (advanced)'), | ||||||
| 			'$theme_config' => $theme_config, | 			'$theme_config' => $theme_config, | ||||||
|  | 			'$expert' => feature_enabled(local_user(),'expert'), | ||||||
| 		)); | 		)); | ||||||
| 		 | 		 | ||||||
| 		return $o; | 		return $o; | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | ||||||
| <base href="{{$baseurl}}/" /> | <base href="{{$baseurl}}/" /> | ||||||
| <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" /> | <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable={{$user_scalable}}" /> | ||||||
| <meta name="generator" content="{{$generator}}" /> | <meta name="generator" content="{{$generator}}" /> | ||||||
|  |  | ||||||
| <!--[if IE]> | <!--[if IE]> | ||||||
|   | |||||||
| @@ -6,6 +6,9 @@ | |||||||
|  |  | ||||||
| {{include file="field_themeselect.tpl" field=$theme}} | {{include file="field_themeselect.tpl" field=$theme}} | ||||||
| {{include file="field_themeselect.tpl" field=$mobile_theme}} | {{include file="field_themeselect.tpl" field=$mobile_theme}} | ||||||
|  | {{if $expert}} | ||||||
|  | {{include file="field_checkbox.tpl" field=$user_scalable}} | ||||||
|  | {{/if}} | ||||||
| {{include file="field_input.tpl" field=$ajaxint}} | {{include file="field_input.tpl" field=$ajaxint}} | ||||||
| {{include file="field_input.tpl" field=$itemspage}} | {{include file="field_input.tpl" field=$itemspage}} | ||||||
| {{include file="field_checkbox.tpl" field=$nosmile}} | {{include file="field_checkbox.tpl" field=$nosmile}} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user