/** * Generates html block with question info. * * @todo also get count and N first * followers * Followers to be selected from USERS collection * using find() by a_f_q and using limit 5 * and then link to 'show more' if i_flwrs in Question is > 5 * * * @param Question $Question * @return string */ public function getHtml(Question $Question) { $this->Question = $Question; $tagsBlock = \tplBoxrecent::parse(array('title' => '@@Question tags@@', 'id' => 'question_tags', $this->getTags()), false); $ret = \tplQuestionInfo::parse(array('tags' => $tagsBlock, 'asked' => TimeAgo::format(new \DateTime(str_replace(' AEST', ' UTC+10', $Question['hts']))) . ' ago', 'updated' => TimeAgo::format(new \DateTime(date('r', $Question['i_lm_ts']))) . ' ago', 'views' => $this->Question['i_views'], 'ans_count' => $this->Question->getAnswerCount(), 'asked_label' => '@@Asked@@', 'updated_label' => '@@Last updated@@', 'ans_count_label' => '@@Number of Answers@@', 'views_label' => '@@Number of Views@@')); return $ret; }
/** * Generates html block with question info. * * @todo also get count and N first * followers * Followers to be selected from USERS collection * using find() by a_f_q and using limit 5 * and then link to 'show more' if i_flwrs in Question is > 5 * * * @param Question $Question */ public function getHtml(Question $Question) { $this->Question = $Question; $Tr = $this->Registry->Tr; /** * @todo translate Title string */ $tagsBlock = \tplBoxrecent::parse(array('title' => $Tr['Topic tags'], 'id' => 'question_tags', $this->getTags()), false); /** * @todo translate labels used * in tplQuestionsInfo template * */ $ret = \tplQuestionInfo::parse(array('tags' => $tagsBlock, 'asked' => TimeAgo::format(new \DateTime($Question['hts'])) . ' ago', 'updated' => TimeAgo::format(new \DateTime(date('r', $Question['i_lm_ts']))) . ' ago', 'views' => $this->Question['i_views'], 'ans_count' => $this->Question->getAnswerCount(), 'asked_label' => $Tr['Posted'], 'updated_label' => $Tr['Last updated'], 'ans_count_label' => $Tr['Number of posts'], 'views_label' => $Tr['Number of Views'])); d('$ret: ' . $ret); return $ret; }