]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
To-selector padlock only shown if site config notice/allowprivate is true
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 17 Feb 2016 22:05:44 +0000 (23:05 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 17 Feb 2016 22:06:11 +0000 (23:06 +0100)
lib/default.php
lib/toselector.php

index 79480483ce411cc5f4f483e9fe492039a4b2efe5..3518bb4cb9e73aaf2bd9b3865366b632ab8b96ab 100644 (file)
@@ -291,6 +291,7 @@ $default =
         ),
         'notice' =>
         array('contentlimit' => null,
+              'allowprivate' => false,  // whether to allow users to "check the padlock" to publish notices available for their subscribers.
               'defaultscope' => null, // null means 1 if site/private, 0 otherwise
               'hidespam' => true), // Whether to hide silenced users from timelines
         'message' =>
index 153d9001b54aef0882e291168083db9882d01638..aed38e1cf6f1f833108d74c6db689dbd74724e68 100644 (file)
@@ -127,10 +127,12 @@ class ToSelector extends Widget
                              $default);
 
         $this->out->elementStart('span', 'checkbox-wrapper');
-        $this->out->checkbox('notice_private',
-                             // TRANS: Checkbox label in widget for selecting potential addressees to mark the notice private.
-                             _('Private?'),
-                             $this->private);
+        if (common_config('notice', 'allowprivate')) {
+            $this->out->checkbox('notice_private',
+                                 // TRANS: Checkbox label in widget for selecting potential addressees to mark the notice private.
+                                 _('Private?'),
+                                 $this->private);
+        }
         $this->out->elementEnd('span');
     }
 
@@ -138,7 +140,7 @@ class ToSelector extends Widget
     {
         // XXX: make arg name selectable
         $toArg = $action->trimmed('notice_to');
-        $private = $action->boolean('notice_private');
+        $private = common_config('notice', 'allowprivate') ? $action->boolean('notice_private') : false;
 
         if (empty($toArg)) {
             return;