From 6e03104e3ee785954b4f755240d1595f702522b2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 4 Oct 2018 20:48:22 +0200 Subject: move *_list_mode to features --- Zotlabs/Module/Channel.php | 2 +- Zotlabs/Module/Network.php | 2 +- Zotlabs/Module/Settings/Display.php | 6 ------ include/features.php | 16 ++++++++++++++++ view/tpl/settings_display.tpl | 2 -- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 8b2e35709..f1537ed15 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -182,7 +182,7 @@ class Channel extends Controller { $item_normal_update = item_normal_update(); $sql_extra = item_permissions_sql(App::$profile['profile_uid']); - if(get_pconfig(App::$profile['profile_uid'],'system','channel_list_mode') && (! $mid)) + if(feature_enabled(App::$profile['profile_uid'], 'channel_list_mode') && (! $mid)) $page_mode = 'list'; else $page_mode = 'client'; diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 919996943..015351cbf 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -437,7 +437,7 @@ class Network extends \Zotlabs\Web\Controller { $abook_uids = " and abook.abook_channel = " . local_channel() . " "; $uids = " and item.uid = " . local_channel() . " "; - if(get_pconfig(local_channel(),'system','network_list_mode')) + if(feature_enabled(local_channel(), 'network_list_mode')) $page_mode = 'list'; else $page_mode = 'client'; diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php index 0c63a3056..b4f8928e0 100644 --- a/Zotlabs/Module/Settings/Display.php +++ b/Zotlabs/Module/Settings/Display.php @@ -27,8 +27,6 @@ class Display { $user_scalable = ((x($_POST,'user_scalable')) ? intval($_POST['user_scalable']) : 0); $nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0); $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); $start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0); @@ -55,8 +53,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_list_mode', $channel_list_mode); - 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); @@ -215,8 +211,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_list_mode' => array('channel_list_mode', t('Use blog/list mode on channel page'), get_pconfig(local_channel(),'system','channel_list_mode'), t('(comments displayed separately)'), $yes_no), - '$network_list_mode' => array('network_list_mode', t('Use blog/list mode on grid page'), get_pconfig(local_channel(),'system','network_list_mode'), t('(comments displayed separately)'), $yes_no), '$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/include/features.php b/include/features.php index b75dc0383..fc4877424 100644 --- a/include/features.php +++ b/include/features.php @@ -103,6 +103,14 @@ function get_features($filtered = true, $level = (-1)) { t('Provide a personal tag cloud on your channel page'), false, get_config('feature_lock','tagadelic'), + ], + + [ + 'channel_list_mode', + t('Use blog/list mode'), + t('Comments will be displayed separately'), + false, + get_config('feature_lock','channel_list_mode'), ] ], @@ -360,6 +368,14 @@ function get_features($filtered = true, $level = (-1)) { t('Show friend and connection suggestions'), false, get_config('feature_lock','suggest') + ], + + [ + 'network_list_mode', + t('Use blog/list mode'), + t('Comments will be displayed separately'), + false, + get_config('feature_lock','network_list_mode'), ] ], diff --git a/view/tpl/settings_display.tpl b/view/tpl/settings_display.tpl index f96e7f84c..8267ab27c 100755 --- a/view/tpl/settings_display.tpl +++ b/view/tpl/settings_display.tpl @@ -63,8 +63,6 @@ {{include file="field_checkbox.tpl" field=$nosmile}} {{include file="field_checkbox.tpl" field=$channel_menu}} {{include file="field_checkbox.tpl" field=$title_tosource}} - {{include file="field_checkbox.tpl" field=$channel_list_mode}} - {{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}} -- cgit v1.2.3