From: Mikael Nordfeldth Date: Wed, 17 Feb 2016 23:32:09 +0000 (+0100) Subject: Put "Everyone" and "Everyone at [local instance]" at the top of ToSelector X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f68d1ade3f0a06d94e8f3059b8b2bc6049c8404a;p=quix0rs-gnu-social.git Put "Everyone" and "Everyone at [local instance]" at the top of ToSelector --- diff --git a/lib/toselector.php b/lib/toselector.php index a295dcd8ab..2026c1dfdd 100644 --- a/lib/toselector.php +++ b/lib/toselector.php @@ -80,16 +80,7 @@ class ToSelector extends Widget function show() { $choices = array(); - $default = 'public:site'; - - 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')); + $default = common_config('site', 'private') ? 'public:site' : 'public:everyone'; $groups = $this->user->getGroups(); @@ -125,6 +116,21 @@ class ToSelector extends Widget // alphabetical order 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, // TRANS: Label for drop-down of potential addressees. _m('LABEL','To:'),