diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-10-04 21:38:39 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-10-04 21:38:39 +0200 |
commit | d4af745fc8000be9fcc198d3d0205a6b134e374c (patch) | |
tree | 9f3742fcf21e5d3ba48ec4922de43d07f1e97031 /Zotlabs/Module | |
parent | 6e03104e3ee785954b4f755240d1595f702522b2 (diff) | |
download | volse-hubzilla-d4af745fc8000be9fcc198d3d0205a6b134e374c.tar.gz volse-hubzilla-d4af745fc8000be9fcc198d3d0205a6b134e374c.tar.bz2 volse-hubzilla-d4af745fc8000be9fcc198d3d0205a6b134e374c.zip |
move *_divmore_height setting to the module extra_settings, and fix issue where feature settings were not synced if rpath was provided
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Settings/Calendar.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Channel_home.php | 25 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Connections.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Directory.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Display.php | 11 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Editor.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Events.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Manage.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Network.php | 28 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Photos.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Profiles.php | 4 |
11 files changed, 83 insertions, 13 deletions
diff --git a/Zotlabs/Module/Settings/Calendar.php b/Zotlabs/Module/Settings/Calendar.php index b3a611cdf..a27bf0fa5 100644 --- a/Zotlabs/Module/Settings/Calendar.php +++ b/Zotlabs/Module/Settings/Calendar.php @@ -16,6 +16,10 @@ class Calendar { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Channel_home.php b/Zotlabs/Module/Settings/Channel_home.php index 1d1cc370b..23c7ee1ab 100644 --- a/Zotlabs/Module/Settings/Channel_home.php +++ b/Zotlabs/Module/Settings/Channel_home.php @@ -14,8 +14,18 @@ class Channel_home { $features = get_module_features($module); process_module_features_post(local_channel(), $features, $_POST); + + $channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400); + if($channel_divmore_height < 50) + $channel_divmore_height = 50; + + set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } @@ -26,6 +36,20 @@ class Channel_home { $features = get_module_features($module); $rpath = (($_GET['rpath']) ? $_GET['rpath'] : ''); + $channel_divmore_height = [ + 'channel_divmore_height', + t('Max height of content (in pixels)'), + ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), + t('Click to expand content exceeding this height') + ]; + + $extra_settings_html = replace_macros(get_markup_template('field_input.tpl'), + [ + '$field' => $channel_divmore_height + ] + ); + + $tpl = get_markup_template("settings_module.tpl"); $o .= replace_macros($tpl, array( @@ -34,6 +58,7 @@ class Channel_home { '$form_security_token' => get_form_security_token('settings_' . $module), '$title' => t('Channel Home Settings'), '$features' => process_module_features_get(local_channel(), $features), + '$extra_settings_html' => $extra_settings_html, '$submit' => t('Submit') )); diff --git a/Zotlabs/Module/Settings/Connections.php b/Zotlabs/Module/Settings/Connections.php index 70b4daa42..cac357791 100644 --- a/Zotlabs/Module/Settings/Connections.php +++ b/Zotlabs/Module/Settings/Connections.php @@ -16,6 +16,10 @@ class Connections { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Directory.php b/Zotlabs/Module/Settings/Directory.php index 6e24a2cfa..13fe6eb79 100644 --- a/Zotlabs/Module/Settings/Directory.php +++ b/Zotlabs/Module/Settings/Directory.php @@ -16,6 +16,10 @@ class Directory { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php index b4f8928e0..45d80e011 100644 --- a/Zotlabs/Module/Settings/Display.php +++ b/Zotlabs/Module/Settings/Display.php @@ -30,13 +30,6 @@ class Display { $manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0); $start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0); - $channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400); - if($channel_divmore_height < 50) - $channel_divmore_height = 50; - $network_divmore_height = ((x($_POST,'network_divmore_height')) ? intval($_POST['network_divmore_height']) : 400); - if($network_divmore_height < 50) - $network_divmore_height = 50; - $browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0); $browser_update = $browser_update * 1000; if($browser_update < 10000) @@ -53,8 +46,6 @@ class Display { set_pconfig(local_channel(),'system','itemspage', $itemspage); set_pconfig(local_channel(),'system','no_smilies',1-intval($nosmile)); set_pconfig(local_channel(),'system','title_tosource',$title_tosource); - set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height); - set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height); set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update); set_pconfig(local_channel(),'system','channel_menu', $channel_menu); set_pconfig(local_channel(),'system','start_menu', $start_menu); @@ -211,8 +202,6 @@ class Display { '$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is on, turning this off may increase screen jumping'), $yes_no), '$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no), '$theme_config' => $theme_config, - '$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')), - '$network_divmore_height' => array('network_divmore_height', t('Grid page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')), '$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no] )); diff --git a/Zotlabs/Module/Settings/Editor.php b/Zotlabs/Module/Settings/Editor.php index 93e3ce602..5e7a9473a 100644 --- a/Zotlabs/Module/Settings/Editor.php +++ b/Zotlabs/Module/Settings/Editor.php @@ -16,6 +16,10 @@ class Editor { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Events.php b/Zotlabs/Module/Settings/Events.php index fcb4441e1..eb6dda99b 100644 --- a/Zotlabs/Module/Settings/Events.php +++ b/Zotlabs/Module/Settings/Events.php @@ -16,6 +16,10 @@ class Events { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Manage.php b/Zotlabs/Module/Settings/Manage.php index 15d3216e9..9bae12022 100644 --- a/Zotlabs/Module/Settings/Manage.php +++ b/Zotlabs/Module/Settings/Manage.php @@ -16,6 +16,10 @@ class Manage { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Network.php b/Zotlabs/Module/Settings/Network.php index c51b780f1..aaafe9255 100644 --- a/Zotlabs/Module/Settings/Network.php +++ b/Zotlabs/Module/Settings/Network.php @@ -14,8 +14,18 @@ class Network { $features = get_module_features($module); process_module_features_post(local_channel(), $features, $_POST); + + $network_divmore_height = ((x($_POST,'network_divmore_height')) ? intval($_POST['network_divmore_height']) : 400); + if($network_divmore_height < 50) + $network_divmore_height = 50; + + set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } @@ -26,6 +36,19 @@ class Network { $features = get_module_features($module); $rpath = (($_GET['rpath']) ? $_GET['rpath'] : ''); + $network_divmore_height = [ + 'network_divmore_height', + t('Max height of content (in pixels)'), + ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400), + t('Click to expand content exceeding this height') + ]; + + $extra_settings_html = replace_macros(get_markup_template('field_input.tpl'), + [ + '$field' => $network_divmore_height + ] + ); + $tpl = get_markup_template("settings_module.tpl"); $o .= replace_macros($tpl, array( @@ -33,8 +56,9 @@ class Network { '$action_url' => 'settings/' . $module, '$form_security_token' => get_form_security_token('settings_' . $module), '$title' => t('Activity Settings'), - '$features' => process_module_features_get(local_channel(), $features), - '$submit' => t('Submit') + '$features' => process_module_features_get(local_channel(), $features), + '$extra_settings_html' => $extra_settings_html, + '$submit' => t('Submit') )); return $o; diff --git a/Zotlabs/Module/Settings/Photos.php b/Zotlabs/Module/Settings/Photos.php index f403b4d38..9edbaa929 100644 --- a/Zotlabs/Module/Settings/Photos.php +++ b/Zotlabs/Module/Settings/Photos.php @@ -16,6 +16,10 @@ class Photos { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Profiles.php b/Zotlabs/Module/Settings/Profiles.php index 78dc0160e..2dc037317 100644 --- a/Zotlabs/Module/Settings/Profiles.php +++ b/Zotlabs/Module/Settings/Profiles.php @@ -16,6 +16,10 @@ class Profiles { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } |