From 38646fe0e1302b3be932a4d59e9431c7afe5c847 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 28 Dec 2017 14:06:30 -0800 Subject: Make affinity widget settings work. It's entirely possible they never did work correctly. I'm not comfortable over-riding the network_page_default config in this way but this is the way I've always set the affinity and it has worked just fine for me for several years and there haven't been any other requests to extend the network page default options. --- Zotlabs/Module/Settings/Featured.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Zotlabs/Module/Settings') diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php index ebe2996d3..6a8d10b2d 100644 --- a/Zotlabs/Module/Settings/Featured.php +++ b/Zotlabs/Module/Settings/Featured.php @@ -11,15 +11,21 @@ class Featured { call_hooks('feature_settings_post', $_POST); if($_POST['affinity_slider-submit']) { - if(intval($_POST['affinity_cmax'])) { - set_pconfig(local_channel(),'affinity','cmax',intval($_POST['affinity_cmax'])); + $cmax = intval($_POST['affinity_cmax']); + if($cmax < 0 || $cmax > 99) + $cmax = 99; + $cmin = intval($_POST['affinity_cmin']); + if($cmin < 0 || $cmin > 99) + $cmin = 0; + if($cmin !== 0 || $cmax !== 99) { + set_pconfig(local_channel(),'system','network_page_default','cmin=' . $cmin . '&cmax=' . $cmax); } - if(intval($_POST['affinity_cmin'])) { - set_pconfig(local_channel(),'affinity','cmin',intval($_POST['affinity_cmin'])); - } - if(intval($_POST['affinity_cmax']) || intval($_POST['affinity_cmin'])) { - info( t('Affinity Slider settings updated.') . EOL); + else { + set_pconfig(local_channel(),'system','network_page_default',''); } + + info( t('Affinity Slider settings updated.') . EOL); + } build_sync_packet(); -- cgit v1.2.3 From 5cfb63da50f21f0f9591599cde476b575cb1266e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 28 Dec 2017 15:12:20 -0800 Subject: a different (hopefully better) implementation of affinity presets, but not for 3.0 because strings have changed. --- Zotlabs/Module/Settings/Featured.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'Zotlabs/Module/Settings') diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php index 6a8d10b2d..9c5a7b16c 100644 --- a/Zotlabs/Module/Settings/Featured.php +++ b/Zotlabs/Module/Settings/Featured.php @@ -17,12 +17,8 @@ class Featured { $cmin = intval($_POST['affinity_cmin']); if($cmin < 0 || $cmin > 99) $cmin = 0; - if($cmin !== 0 || $cmax !== 99) { - set_pconfig(local_channel(),'system','network_page_default','cmin=' . $cmin . '&cmax=' . $cmax); - } - else { - set_pconfig(local_channel(),'system','network_page_default',''); - } + set_pconfig(local_channel(),'affinity','cmin',$cmin); + set_pconfig(local_channel(),'affinity','cmax',$cmax); info( t('Affinity Slider settings updated.') . EOL); @@ -46,12 +42,12 @@ class Featured { $cmax = intval(get_pconfig(local_channel(),'affinity','cmax')); $cmax = (($cmax) ? $cmax : 99); $setting_fields .= replace_macros(get_markup_template('field_input.tpl'), array( - '$field' => array('affinity_cmax', t('Default maximum affinity level'), $cmax, '') + '$field' => array('affinity_cmax', t('Default maximum affinity level'), $cmax, t('0-99 default 99')) )); $cmin = intval(get_pconfig(local_channel(),'affinity','cmin')); $cmin = (($cmin) ? $cmin : 0); $setting_fields .= replace_macros(get_markup_template('field_input.tpl'), array( - '$field' => array('affinity_cmin', t('Default minimum affinity level'), $cmin, '') + '$field' => array('affinity_cmin', t('Default minimum affinity level'), $cmin, t('0-99 - default 0')) )); $settings_addons .= replace_macros(get_markup_template('generic_addon_settings.tpl'), array( -- cgit v1.2.3 From 5967360991cb3766a6517759369b6d6fd8563c61 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 22 Jan 2018 16:49:45 -0800 Subject: hubzilla issue #920 - unable to delete permission groups with space in name --- Zotlabs/Module/Settings/Permcats.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module/Settings') diff --git a/Zotlabs/Module/Settings/Permcats.php b/Zotlabs/Module/Settings/Permcats.php index 336f69653..535399083 100644 --- a/Zotlabs/Module/Settings/Permcats.php +++ b/Zotlabs/Module/Settings/Permcats.php @@ -49,7 +49,7 @@ class Permcats { if(argc() > 2) - $name = argv(2); + $name = hex2bin(argv(2)); if(argc() > 3 && argv(3) === 'drop') { \Zotlabs\Lib\Permcat::delete(local_channel(),$name); @@ -70,7 +70,7 @@ class Permcats { if(($pc['name']) && ($name) && ($pc['name'] == $name)) $existing = $pc['perms']; if(! $pc['system']) - $permcats[$pc['name']] = $pc['localname']; + $permcats[bin2hex($pc['name'])] = $pc['localname']; } } -- cgit v1.2.3 From cadd958339323f5fcf4c2b438f7a5e311e477d52 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 5 Feb 2018 18:06:25 -0800 Subject: remove mobile_detect (outdated and unmaintainable) --- Zotlabs/Module/Settings/Display.php | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'Zotlabs/Module/Settings') 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')), -- cgit v1.2.3 From 63107f5b2f5031a7cc971063b9344592cc2257e3 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 11 Feb 2018 18:17:17 -0800 Subject: second part of hubzilla issue #972 --- Zotlabs/Module/Settings/Channel.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Zotlabs/Module/Settings') diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php index 5e9e88a6d..fb8284d2e 100644 --- a/Zotlabs/Module/Settings/Channel.php +++ b/Zotlabs/Module/Settings/Channel.php @@ -331,22 +331,21 @@ class Channel { ); $limits = \Zotlabs\Access\PermissionLimits::Get(local_channel()); + $anon_comments = get_config('system','anonymous_comments',true); foreach($global_perms as $k => $perm) { $options = array(); + $can_be_public = ((strstr($k,'view') || ($k === 'post_comments' && $anon_comments)) ? true : false); foreach($perm_opts as $opt) { - if(((! strstr($k,'view')) && $k !== 'post_comments') && $opt[1] == PERMS_PUBLIC) + if($opt[1] == PERMS_PUBLIC && (! $can_be_public)) continue; $options[$opt[1]] = $opt[0]; } $permiss[] = array($k,$perm,$limits[$k],'',$options); } - - + // logger('permiss: ' . print_r($permiss,true)); - - $username = $channel['channel_name']; $nickname = $channel['channel_address']; $timezone = $channel['channel_timezone']; -- cgit v1.2.3 From 048a636315671b7e9aaf9152273d101994e37c43 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 23 Feb 2018 12:44:07 -0800 Subject: Usability and member experience: remove street address info from the default basic profile fields, mention that the site banner can be full HTML, mention on the techlevel setting that this also controls what additional features may be visible. --- Zotlabs/Module/Settings/Account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Module/Settings') diff --git a/Zotlabs/Module/Settings/Account.php b/Zotlabs/Module/Settings/Account.php index 18890e89f..9643c5958 100644 --- a/Zotlabs/Module/Settings/Account.php +++ b/Zotlabs/Module/Settings/Account.php @@ -113,7 +113,7 @@ class Account { '$origpass' => array('origpass', t('Current Password'), ' ',''), '$password1'=> array('npassword', t('Enter New Password'), '', ''), '$password2'=> array('confirm', t('Confirm New Password'), '', t('Leave password fields blank unless changing')), - '$techlevel' => [ 'techlevel', t('Your technical skill level'), $def_techlevel, t('Used to provide a member experience matched to your comfort level'), $techlevels ], + '$techlevel' => [ 'techlevel', t('Your technical skill level'), $def_techlevel, t('Used to provide a member experience and additional features consistent with your comfort level'), $techlevels ], '$techlock' => $techlock, '$submit' => t('Submit'), '$email' => array('email', t('Email Address:'), $email, ''), -- cgit v1.2.3 From be5187718c0f1791a692b7743aca51ea5f37649e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 27 Feb 2018 19:34:51 -0800 Subject: provide usage hint on addon settings page to save each panel before opening another. [String change, not for 3.2] --- Zotlabs/Module/Settings/Featured.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs/Module/Settings') diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php index 9c5a7b16c..3740eddfa 100644 --- a/Zotlabs/Module/Settings/Featured.php +++ b/Zotlabs/Module/Settings/Featured.php @@ -62,6 +62,7 @@ class Featured { $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_featured"), '$title' => t('Feature/Addon Settings'), + '$descrip' => t('Please save/submit changes to any panel before opening another.'), '$settings_addons' => $settings_addons )); return $o; -- cgit v1.2.3 From 6c60be9e8d57c26e92f704de0712def767ab8705 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 27 Feb 2018 19:51:29 -0800 Subject: rename Addon/Feature settings to addon settings [string change] --- Zotlabs/Module/Settings/Featured.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Module/Settings') diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php index 3740eddfa..1da139206 100644 --- a/Zotlabs/Module/Settings/Featured.php +++ b/Zotlabs/Module/Settings/Featured.php @@ -61,7 +61,7 @@ class Featured { $tpl = get_markup_template("settings_addons.tpl"); $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_featured"), - '$title' => t('Feature/Addon Settings'), + '$title' => t('Addon Settings'), '$descrip' => t('Please save/submit changes to any panel before opening another.'), '$settings_addons' => $settings_addons )); -- cgit v1.2.3