]> git.mxchange.org Git - friendica.git/commitdiff
Add disabled_cw user setting
authorHypolite Petovan <mrpetovan@gmail.com>
Sun, 1 Apr 2018 06:23:26 +0000 (02:23 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Thu, 5 Apr 2018 03:08:47 +0000 (23:08 -0400)
mod/settings.php
view/templates/settings/connectors.tpl
view/theme/frio/templates/settings/connectors.tpl

index f4ad58412ccc3b4ff918f243dfe1523de9fb6866..3850c095b25dcaa60cbbb5eda4bf498d085c6df3 100644 (file)
@@ -19,7 +19,6 @@ use Friendica\Model\GContact;
 use Friendica\Model\Group;
 use Friendica\Model\User;
 use Friendica\Protocol\Email;
-use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Network;
 use Friendica\Util\Temporal;
 
@@ -213,6 +212,7 @@ function settings_post(App $a)
                check_form_security_token_redirectOnErr('/settings/connectors', 'settings_connectors');
 
                if (x($_POST, 'general-submit')) {
+                       PConfig::set(local_user(), 'social', 'disable_cw', intval($_POST['disable_cw']));
                        PConfig::set(local_user(), 'system', 'no_intelligent_shortening', intval($_POST['no_intelligent_shortening']));
                        PConfig::set(local_user(), 'system', 'ostatus_autofriend', intval($_POST['snautofollow']));
                        PConfig::set(local_user(), 'ostatus', 'default_group', $_POST['group-selection']);
@@ -787,6 +787,7 @@ function settings_content(App $a)
        }
 
        if (($a->argc > 1) && ($a->argv[1] === 'connectors')) {
+               $disable_cw                = intval(PConfig::get(local_user(), 'social', 'disable_cw'));
                $no_intelligent_shortening = intval(PConfig::get(local_user(), 'system', 'no_intelligent_shortening'));
                $ostatus_autofriend        = intval(PConfig::get(local_user(), 'system', 'ostatus_autofriend'));
                $default_group             = PConfig::get(local_user(), 'ostatus', 'default_group');
@@ -844,6 +845,7 @@ function settings_content(App $a)
                        '$ostat_enabled' => $ostat_enabled,
 
                        '$general_settings' => L10n::t('General Social Media Settings'),
+                       '$disable_cw' => ['disable_cw', L10n::t('Disable Content Warning'), $disable_cw, L10n::t('Users on networks like Mastodon or Pleroma are able to set a content warning field which collapse their post by default. You can disable this default behavior to always show post with an author-set content warning. Doesn\'t affect any other content filtering you eventually set up.')],
                        '$no_intelligent_shortening' => ['no_intelligent_shortening', L10n::t('Disable intelligent shortening'), $no_intelligent_shortening, L10n::t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.')],
                        '$ostatus_autofriend' => ['snautofollow', L10n::t("Automatically follow any GNU Social \x28OStatus\x29 followers/mentioners"), $ostatus_autofriend, L10n::t('If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user.')],
                        '$default_group' => Group::displayGroupSelection(local_user(), $default_group, L10n::t("Default group for OStatus contacts")),
index 83ebd74f5fb19d68bd64d0c92063b2239f23f344..19b7306dd5835ebe68588d349ec2aee4630e296e 100644 (file)
@@ -15,6 +15,7 @@
                <h3 class="connector">{{$general_settings}}</h3>
        </span>
 
+       {{include file="field_checkbox.tpl" field=$disable_cw}}
        {{include file="field_checkbox.tpl" field=$no_intelligent_shortening}}
        {{include file="field_checkbox.tpl" field=$ostatus_autofriend}}
        {{$default_group}}
index e5d21158c250d7eb86720a05148636bb8885fae3..7a18c46f778b7e8be5d7084ffa4989352b7c019e 100644 (file)
@@ -20,6 +20,7 @@
                                <div id="content-settings-content" class="panel-collapse collapse" role="tabpanel" aria-labelledby="content-settings">
                                        <div class="section-content-wrapper">
 
+                                               {{include file="field_checkbox.tpl" field=$disable_cw}}
                                                {{include file="field_checkbox.tpl" field=$no_intelligent_shortening}}
                                                {{include file="field_checkbox.tpl" field=$ostatus_autofriend}}
                                                {{$default_group}}