From: Hypolite Petovan Date: Sun, 1 Apr 2018 06:23:26 +0000 (-0400) Subject: Add disabled_cw user setting X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=180f7d8218cb33553a4668d23f4ab13c29e7919d;p=friendica.git Add disabled_cw user setting --- diff --git a/mod/settings.php b/mod/settings.php index f4ad58412c..3850c095b2 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -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")), diff --git a/view/templates/settings/connectors.tpl b/view/templates/settings/connectors.tpl index 83ebd74f5f..19b7306dd5 100644 --- a/view/templates/settings/connectors.tpl +++ b/view/templates/settings/connectors.tpl @@ -15,6 +15,7 @@

{{$general_settings}}

+ {{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}} diff --git a/view/theme/frio/templates/settings/connectors.tpl b/view/theme/frio/templates/settings/connectors.tpl index e5d21158c2..7a18c46f77 100644 --- a/view/theme/frio/templates/settings/connectors.tpl +++ b/view/theme/frio/templates/settings/connectors.tpl @@ -20,6 +20,7 @@
+ {{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}}