X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Ftoselector.php;h=6d424dc259ccc8433c2e5996cd392bc16fe51dbe;hb=4e26527447852f88d48bf40a4f208079fcb77a49;hp=7234a603d8e398d4c0253558ae44cc6a7511d601;hpb=674e3c2a0ef4d91f502974b34c8f58029accced7;p=quix0rs-gnu-social.git diff --git a/lib/toselector.php b/lib/toselector.php index 7234a603d8..6d424dc259 100644 --- a/lib/toselector.php +++ b/lib/toselector.php @@ -94,7 +94,7 @@ class ToSelector extends Widget $groups = $this->user->getGroups(); - while ($groups->fetch()) { + while ($groups instanceof User_group && $groups->fetch()) { $value = 'group:'.$groups->id; if (($this->to instanceof User_group) && $this->to->id == $groups->id) { $default = $value; @@ -118,10 +118,12 @@ class ToSelector extends Widget false, $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'), + _('Private?'), $this->private); + $this->out->elementEnd('span'); } static function fillOptions($action, &$options) @@ -130,6 +132,10 @@ class ToSelector extends Widget $toArg = $action->trimmed('notice_to'); $private = $action->boolean('notice_private'); + if (empty($toArg)) { + return; + } + list($prefix, $value) = explode(':', $toArg); switch ($prefix) { case 'group': @@ -139,8 +145,8 @@ class ToSelector extends Widget } break; case 'profile': - $profile = Profile::staticGet('id', $value); - $options['replies'] = $profile->getUri(); + $profile = Profile::getKV('id', $value); + $options['replies'] = array($profile->getUri()); if ($private) { $options['scope'] = Notice::ADDRESSEE_SCOPE; }