* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class QnashowanswerAction extends ShownoticeAction
{
protected $answer = null;
*
* @return boolean true
*/
-
function prepare($argarray)
{
OwnerDesignAction::prepare($argarray);
$this->answer = QnA_Answer::staticGet('id', $this->id);
if (empty($this->answer)) {
- throw new ClientException(_('No such answer.'), 404);
+ throw new ClientException(_m('No such answer.'), 404);
}
$this->question = $this->answer->getQuestion();
if (empty($this->question)) {
- throw new ClientException(_('No question for this answer.'), 404);
+ throw new ClientException(_m('No question for this answer.'), 404);
}
$this->notice = Notice::staticGet('uri', $this->answer->uri);
if (empty($this->notice)) {
// Did we used to have it, and it got deleted?
- throw new ClientException(_('No such answer.'), 404);
+ throw new ClientException(_m('No such answer.'), 404);
}
$this->user = User::staticGet('id', $this->answer->profile_id);
if (empty($this->user)) {
- throw new ClientException(_('No such user.'), 404);
+ throw new ClientException(_m('No such user.'), 404);
}
$this->profile = $this->user->getProfile();
if (empty($this->profile)) {
- throw new ServerException(_('User without a profile.'));
+ throw new ServerException(_m('User without a profile.'));
}
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
*
* @return string page tile
*/
-
function title()
{
$question = $this->answer->getQuestion();
return sprintf(
- _('%s\'s answer to "%s"'),
+ _m('%s\'s answer to "%s"'),
$this->user->nickname,
$question->title
);
*
* @return void
*/
-
function showPageTitle()
{
$this->elementStart('h1');
{
$notice = $question->getNotice();
- $fmt = '<span class="answer_author"><a href="%1s">answer</a> by <a href="%2s">%3s</a></span>';
- $fmt .= '<span class="answer_content">%4s</span>';
+ $fmt = '<span class="answer_author"><a href="%1$s">answer</a> by <a href="%2$s">%3$s</a></span>';
+ $fmt .= '<span class="answer_content">%4$s</span>';
return sprintf(
$fmt,
{
$notice = $question->getNotice();
- $fmt = _(
- '%1s answered the question "%2s": %3s'
+ $fmt = _m(
+ '%1$s answered the question "%2$s": %3$s'
);
return sprintf(
$notice = $question->getNotice();
$fmt = '<div class="qna_question">';
- $fmt .= '<span class="question_title"><a href="%1s">%2s</a></span>';
- $fmt .= '<span class="question_description">%3s</span>';
- $fmt .= '<span class="question_author">asked by <a href="%4s">%5s</a></span>';
+ $fmt .= '<span class="question_title"><a href="%1$s">%2$s</a></span>';
+ $fmt .= '<span class="question_description">%3$s</span>';
+ $fmt .= '<span class="question_author">asked by <a href="%4$s">%5$s</a></span>';
$fmt .= '</div>';
$q = sprintf(
static function toString($profile, $question, $answers)
{
- $fmt = _(
- '%1s asked the question "%2s": %3s'
+ $fmt = _m(
+ '%1$s asked the question "%2$s": %3$s'
);
return sprintf(