forked from GNUsocial/gnu-social
Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x
This commit is contained in:
commit
229692be3a
@ -384,7 +384,7 @@ class QnAPlugin extends MicroAppPlugin
|
|||||||
$nli = new NoticeListItem($notice, $out);
|
$nli = new NoticeListItem($notice, $out);
|
||||||
$nli->showNotice();
|
$nli->showNotice();
|
||||||
|
|
||||||
$out->elementStart('div', array('class' => 'entry-content question-desciption'));
|
$out->elementStart('div', array('class' => 'entry-content question-description'));
|
||||||
|
|
||||||
$question = QnA_Question::getByNotice($notice);
|
$question = QnA_Question::getByNotice($notice);
|
||||||
|
|
||||||
|
@ -205,31 +205,31 @@ class QnA_Answer extends Managed_DataObject
|
|||||||
{
|
{
|
||||||
$notice = $question->getNotice();
|
$notice = $question->getNotice();
|
||||||
|
|
||||||
$fmt = '';
|
$out = new XMLStringer();
|
||||||
|
|
||||||
|
$cls = array('qna_answer');
|
||||||
if (!empty($answer->best)) {
|
if (!empty($answer->best)) {
|
||||||
$fmt = '<p class="qna_answer best">';
|
$cls[] = 'best';
|
||||||
} else {
|
|
||||||
$fmt = '<p class="qna_answer">';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$fmt .= '<span class="answer_author"><a href="%1$s">answer</a> by <a href="%2$s">%3$s</a></span>';
|
$out->elementStart('p', array('class' => implode(' ', $cls)));
|
||||||
$fmt .= '<span class="answer_content">%4$s</span>';
|
$out->elementStart('span', 'answer-content');
|
||||||
|
$out->raw(QnAPlugin::shorten($answer->content, $notice));
|
||||||
|
$out->elementEnd('span');
|
||||||
|
|
||||||
if (!empty($answer->revisions)) {
|
if (!empty($answer->revisions)) {
|
||||||
$fmt .= '<span class="answer_revisions">'
|
$out->elementstart('span', 'answer-revisions');
|
||||||
. $answer->revisions
|
$out->text(
|
||||||
. _m('revisions')
|
htmlspecialchars(
|
||||||
. '</span>';
|
sprintf(_m('%s revisions'), $answer->revisions)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$out->elementEnd('span');
|
||||||
}
|
}
|
||||||
$fmt .= '</p>';
|
|
||||||
|
|
||||||
return sprintf(
|
$out->elementEnd('p');
|
||||||
$fmt,
|
|
||||||
htmlspecialchars($notice->bestUrl()),
|
return $out->getString();
|
||||||
htmlspecialchars($profile->profileurl),
|
|
||||||
htmlspecialchars($profile->getBestName()),
|
|
||||||
htmlspecialchars($answer->content)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static function toString($profile, $question, $answer)
|
static function toString($profile, $question, $answer)
|
||||||
|
@ -213,14 +213,12 @@ class QnA_Question extends Managed_DataObject
|
|||||||
{
|
{
|
||||||
$notice = $question->getNotice();
|
$notice = $question->getNotice();
|
||||||
|
|
||||||
$fmt = '<span class="question_description">%s</span>';
|
$out = new XMLStringer();
|
||||||
|
$out->elementStart('span', 'question_description');
|
||||||
|
$out->raw(QnAPlugin::shorten($question->description, $notice));
|
||||||
|
$out->elementEnd('span');
|
||||||
|
|
||||||
$q = sprintf(
|
return $out->getString();
|
||||||
$fmt,
|
|
||||||
htmlspecialchars($question->description)
|
|
||||||
);
|
|
||||||
|
|
||||||
return $q;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static function toString($profile, $question, $answers)
|
static function toString($profile, $question, $answers)
|
||||||
|
Loading…
Reference in New Issue
Block a user