To-selector padlock only shown if site config notice/allowprivate is true

This commit is contained in:
Mikael Nordfeldth 2016-02-17 23:05:44 +01:00
parent 5fbb01130a
commit d2c11925bf
2 changed files with 8 additions and 5 deletions

View File

@ -291,6 +291,7 @@ $default =
), ),
'notice' => 'notice' =>
array('contentlimit' => null, 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 'defaultscope' => null, // null means 1 if site/private, 0 otherwise
'hidespam' => true), // Whether to hide silenced users from timelines 'hidespam' => true), // Whether to hide silenced users from timelines
'message' => 'message' =>

View File

@ -127,10 +127,12 @@ class ToSelector extends Widget
$default); $default);
$this->out->elementStart('span', 'checkbox-wrapper'); $this->out->elementStart('span', 'checkbox-wrapper');
if (common_config('notice', 'allowprivate')) {
$this->out->checkbox('notice_private', $this->out->checkbox('notice_private',
// TRANS: Checkbox label in widget for selecting potential addressees to mark the notice private. // TRANS: Checkbox label in widget for selecting potential addressees to mark the notice private.
_('Private?'), _('Private?'),
$this->private); $this->private);
}
$this->out->elementEnd('span'); $this->out->elementEnd('span');
} }
@ -138,7 +140,7 @@ class ToSelector extends Widget
{ {
// XXX: make arg name selectable // XXX: make arg name selectable
$toArg = $action->trimmed('notice_to'); $toArg = $action->trimmed('notice_to');
$private = $action->boolean('notice_private'); $private = common_config('notice', 'allowprivate') ? $action->boolean('notice_private') : false;
if (empty($toArg)) { if (empty($toArg)) {
return; return;