Пример #1
0
 /**
  * Возвращает <img src="..." /> с аватаром пользователя
  */
 public function getAvatarImg($dim = '100x100', array $params = array())
 {
     return PsUserHelper::getAvatarImg($this, $dim, $params);
 }
Пример #2
0
 /**
  * Оснвной метод построения дискуссии - с кнопками управления и т.д.
  */
 public final function buildDiscussion($upDown = true, $threadId = null, $limited = true)
 {
     $threadId = $this->validateThreadId($threadId);
     //Form html
     $formParams['avatar'] = PsUserHelper::getAvatarImg(PsUser::instOrNull(), '42x', array('class' => 'small'));
     $formParams['themed'] = $this->SETTINGS->isThemed();
     $form = PSSmarty::template('discussion/common/comment_form.tpl', $formParams)->fetch();
     //Tree js data
     $treeData[self::JS_DATA_UPDOWN] = $upDown;
     $treeData[self::JS_DATA_THREAD] = $threadId;
     $treeData[self::JS_DATA_UNIQUE] = $this->SETTINGS->getUnique();
     $treeData[self::JS_DATA_THEMED] = $this->SETTINGS->isThemed();
     $params['tree'] = $this->buildLeafs($threadId, $this->makeDiscussionTree($this->loadMsgsPortion($threadId, $limited ? MAX_COMMENTS_COUNT : -1, $upDown, null, $hasMore), false));
     $params['has_more'] = $hasMore;
     $params['form'] = $form;
     $params['unique'] = $this->SETTINGS->getUnique();
     $params['data'] = PsHtml::data2string($treeData);
     return PSSmarty::template('discussion/common/discussion.tpl', $params)->fetch();
 }