function smarty_modifier_post_meta(PostContentProvider $postCP, $news = false) { $post = $postCP->getPost(); $postId = $post->getId(); $type = $post->getPostType(); $pp = Handlers::getInstance()->getPostsProcessorByPostType($type); $rp = Handlers::getInstance()->getRubricsProcessorByPostType($type, false); $trStateToggle = null; $rubHref = null; $commentsHref = null; $name = null; if ($news) { $name = $post->getName(); $name = "<span class=\"name\">{$name}</span>"; } if (!$news && $post->getPostType() == POST_TYPE_TRAINING && AuthManager::isAuthorized()) { $trStateToggle = '<a href="#' . $postId . '" title="Изменить состояние урока" class="toggle">Пройден</a>'; } $rubHref = $rp ? $rp->rubricHref($post->getRubricId(), null, 'rubric') : null; // if (!$news) { $commentsCnt = $post->getCommentsCount(); $commentsHref = $pp->postHref($post, "Комментариев: {$commentsCnt}", 'comments', array('class' => 'commentcount')); // } if ($name || $trStateToggle || $rubHref || $commentsHref) { echo '<div class="post_meta">'; echo "{$name} {$trStateToggle} {$rubHref} {$commentsHref}"; echo '</div>'; } }
function smarty_modifier_post_content_showcase(PostContentProvider $cp) { if ($cp->getPost()->is(POST_TYPE_ISSUE)) { return SmartyModifiers::post_anons_placeholder($cp); } return $cp->getPostContentShowcase()->getContent(); }
function smarty_modifier_post_full_read(PostContentProvider $postCP) { $post = $postCP->getPost(); $type = $post->getPostType(); $text = 'Читать полностью »'; switch ($type) { case POST_TYPE_ISSUE: $text = 'Читать выпуск полностью »'; break; case POST_TYPE_TRAINING: $text = 'Перейти к занятию »'; break; } $tpl = PSSmarty::template('post/full_read.tpl'); $tpl->assign('text', $text); $tpl->assign('post', $post); $tpl->display(); }
function smarty_modifier_post_bottom(PostContentProvider $postCP) { $tpl = PSSmarty::template('post/bottom.tpl'); $tpl->assign('post', $postCP->getPost()); $tpl->display(); }
/** * Заголовок поста */ function smarty_modifier_post_header(PostContentProvider $postCP, $buildControl = true) { return PSSmarty::template('common/post_header.tpl', array('post' => $postCP->getPost(), 'controls' => $buildControl))->fetch(); }
function smarty_modifier_post_discussion(PostContentProvider $postCP, $limited = true) { $post = $postCP->getPost(); echo Handlers::getInstance()->getCommentsProcessorByPostType($post->getPostType())->buildDiscussion($post->getId(), $limited); }
public function getTitle() { return $this->postCP->getPost()->getName() . ' (версия для печати)'; }