X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2FPoll%2FPoll_response.php;h=2518ac2bebd057f8a35e9b6b5a070c8cd99e6238;hb=31556e3c004b17fbf59db3c2cc8cd0abb3044ca4;hp=8543d1c245dc75acbc8e40b81fe631e15c9d2995;hpb=76bffe1a64a0d077492d577d11472492646f6c27;p=quix0rs-gnu-social.git diff --git a/plugins/Poll/Poll_response.php b/plugins/Poll/Poll_response.php index 8543d1c245..2518ac2beb 100644 --- a/plugins/Poll/Poll_response.php +++ b/plugins/Poll/Poll_response.php @@ -46,6 +46,7 @@ class Poll_response extends Managed_DataObject { public $__table = 'poll_response'; // table name public $id; // char(36) primary key not null -> UUID + public $uri; // varchar(255) public $poll_id; // char(36) -> poll.id UUID public $profile_id; // int -> profile.id public $selection; // int -> choice # @@ -162,6 +163,7 @@ class Poll_response extends Managed_DataObject } if (!$poll->isValidSelection($selection)) { + // TRANS: Client exception thrown when responding to a poll with an invalid option. throw new ClientException(_m('Invalid poll selection.')); } $opts = $poll->getOptions(); @@ -189,19 +191,20 @@ class Poll_response extends Managed_DataObject common_log(LOG_DEBUG, "Saving poll response: $pr->id $pr->uri"); $pr->insert(); + // TRANS: Notice content voting for a poll. + // TRANS: %s is the chosen option in the poll. $content = sprintf(_m('voted for "%s"'), $answer); - $rendered = sprintf(_m('voted for “%s”'), - htmlspecialchars($poll->uri), - htmlspecialchars($answer)); + $link = '' . htmlspecialchars($answer) . ''; + // TRANS: Rendered version of the notice content voting for a poll. + // TRANS: %s a link to the poll with the chosen option as link description. + $rendered = sprintf(_m('voted for "%s"'), $link); $tags = array(); - $replies = array(); $options = array_merge(array('urls' => array(), 'rendered' => $rendered, 'tags' => $tags, - 'replies' => $replies, 'reply_to' => $poll->getNotice()->id, 'object_type' => PollPlugin::POLL_RESPONSE_OBJECT), $options);