diff options
author | zotlabs <mike@macgirvin.com> | 2016-11-02 18:40:50 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-11-02 18:40:50 -0700 |
commit | 9e2ccbd2a7cda195de5ae03ea8729561762d157a (patch) | |
tree | cf18d5edc88381ca93cc3d13b08685e030ec526f | |
parent | 6a6494d9475b0c9b87408f648c8988d7444b3793 (diff) | |
download | volse-hubzilla-9e2ccbd2a7cda195de5ae03ea8729561762d157a.tar.gz volse-hubzilla-9e2ccbd2a7cda195de5ae03ea8729561762d157a.tar.bz2 volse-hubzilla-9e2ccbd2a7cda195de5ae03ea8729561762d157a.zip |
convert manual page updates to a display setting instead of a feature
-rw-r--r-- | Zotlabs/Module/Channel.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Display.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Network.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Pubstream.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Search.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Display.php | 3 | ||||
-rw-r--r-- | include/channel.php | 11 | ||||
-rw-r--r-- | include/features.php | 9 | ||||
-rwxr-xr-x | view/tpl/settings_display.tpl | 1 |
9 files changed, 20 insertions, 14 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 41b396c5c..45da92184 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -111,7 +111,7 @@ class Channel extends \Zotlabs\Web\Controller { if(! $update) { - $static = intval(feature_enabled(\App::$profile['profile_uid'],'static_updates')); + $static = channel_manual_conv_update(\App::$profile['profile_uid']); $o .= profile_tabs($a, $is_owner, \App::$profile['channel_address']); diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 25153839c..42f6dd4ac 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -138,7 +138,7 @@ class Display extends \Zotlabs\Web\Controller { if((! $update) && (! $load)) { - $static = ((local_channel()) ? intval(feature_enabled(local_channel(),'static_updates')) : 0); + $static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 0); $o .= '<div id="live-display"></div>' . "\r\n"; $o .= "<script> var profile_uid = " . ((intval(local_channel())) ? local_channel() : (-1)) diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index ed6ee1cc0..8263420b6 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -188,7 +188,7 @@ class Network extends \Zotlabs\Web\Controller { $status_editor = status_editor($a,$x); $o .= $status_editor; - $static = intval(feature_enabled(local_channel(),'static_updates')); + $static = channel_manual_conv_update(local_channel()); } diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index 54f3b7937..6c4d479d4 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -27,7 +27,7 @@ class Pubstream extends \Zotlabs\Web\Controller { if(! $update) { - $static = ((local_channel()) ? intval(feature_enabled(local_channel(),'static_updates')) : 0); + $static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 0); $maxheight = get_config('system','home_divmore_height'); if(! $maxheight) diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php index 9ebd50a2c..b319b19d6 100644 --- a/Zotlabs/Module/Search.php +++ b/Zotlabs/Module/Search.php @@ -101,7 +101,7 @@ class Search extends \Zotlabs\Web\Controller { if((! $update) && (! $load)) { - $static = ((local_channel()) ? intval(feature_enabled(local_channel(),'static_updates')) : 0); + $static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 0); // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php index 8da875de7..d03b64db7 100644 --- a/Zotlabs/Module/Settings/Display.php +++ b/Zotlabs/Module/Settings/Display.php @@ -28,6 +28,7 @@ class Display { $title_tosource = ((x($_POST,'title_tosource')) ? intval($_POST['title_tosource']) : 0); $channel_list_mode = ((x($_POST,'channel_list_mode')) ? intval($_POST['channel_list_mode']) : 0); $network_list_mode = ((x($_POST,'network_list_mode')) ? intval($_POST['network_list_mode']) : 0); + $manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0); $channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400); if($channel_divmore_height < 50) @@ -61,6 +62,7 @@ class Display { set_pconfig(local_channel(),'system','network_list_mode', $network_list_mode); 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); $newschema = ''; if($theme == $existing_theme){ @@ -204,6 +206,7 @@ class Display { '$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')), '$nosmile' => array('nosmile', t("Show emoticons (smilies) as images"), 1-intval($nosmile), '', $yes_no), + '$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is automatic, which may increase screen jumping'), $yes_no), '$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no), '$layout_editor' => t('System Page Layout Editor - (advanced)'), '$theme_config' => $theme_config, diff --git a/include/channel.php b/include/channel.php index 39ffef2d2..6d180da01 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1930,4 +1930,15 @@ function channel_reddress($channel) { return ''; return strtolower($channel['channel_address'] . '@' . App::get_hostname()); +} + + +function channel_manual_conv_update($channel_id) { + + $x = get_pconfig($channel_id, 'system','manual_conversation_update'); + if($x === false) + $x = get_config('system','manual_conversation_update'); + + return intval($x); + }
\ No newline at end of file diff --git a/include/features.php b/include/features.php index 83a9c9178..1ccdbf015 100644 --- a/include/features.php +++ b/include/features.php @@ -157,15 +157,6 @@ function get_features($filtered = true) { feature_level('smart_birthdays',2), ], - [ - 'static_updates', - t('Manual Page Updates'), - t('Off = automatically update changing conversations. On = Wait until the page is re-loaded.'), - false, - get_config('feature_lock','static_updates'), - feature_level('static_updates',1), - ], - [ 'advanced_dirsearch', t('Advanced Directory Search'), diff --git a/view/tpl/settings_display.tpl b/view/tpl/settings_display.tpl index 2e11fdbaa..a85a067be 100755 --- a/view/tpl/settings_display.tpl +++ b/view/tpl/settings_display.tpl @@ -69,6 +69,7 @@ {{include file="field_checkbox.tpl" field=$network_list_mode}} {{include file="field_checkbox.tpl" field=$user_scalable}} {{include file="field_checkbox.tpl" field=$preload_images}} + {{include file="field_checkbox.tpl" field=$manual_update}} {{if $expert}} <div class="form-group"> <a class="btn btn-default "href="pdledit">{{$layout_editor}}</a> |