Put "Everyone" and "Everyone at [local instance]" at the top of ToSelector

This commit is contained in:
Mikael Nordfeldth 2016-02-18 00:32:09 +01:00
parent 543d968b81
commit f68d1ade3f

View File

@ -80,16 +80,7 @@ class ToSelector extends Widget
function show() function show()
{ {
$choices = array(); $choices = array();
$default = 'public:site'; $default = common_config('site', 'private') ? 'public:site' : 'public:everyone';
if (!common_config('site', 'private')) {
// TRANS: Option in drop-down of potential addressees.
$choices['public:everyone'] = _m('SENDTO','Everyone');
$default = 'public:everyone';
}
// TRANS: Option in drop-down of potential addressees.
// TRANS: %s is a StatusNet sitename.
$choices['public:site'] = sprintf(_('Everyone at %s'), common_config('site', 'name'));
$groups = $this->user->getGroups(); $groups = $this->user->getGroups();
@ -125,6 +116,21 @@ class ToSelector extends Widget
// alphabetical order // alphabetical order
asort($choices); asort($choices);
// Reverse so we can add entries at the end (can't unshift with a key)
$choices = array_reverse($choices);
// TRANS: Option in drop-down of potential addressees.
// TRANS: %s is a StatusNet sitename.
$choices['public:site'] = sprintf(_('Everyone at %s'), common_config('site', 'name'));
if (!common_config('site', 'private')) {
// TRANS: Option in drop-down of potential addressees.
$choices['public:everyone'] = _m('SENDTO','Everyone');
}
// Return the order
$choices = array_reverse($choices);
$this->out->dropdown($this->id, $this->out->dropdown($this->id,
// TRANS: Label for drop-down of potential addressees. // TRANS: Label for drop-down of potential addressees.
_m('LABEL','To:'), _m('LABEL','To:'),