function OnPreRender() { /* @var $o_top_level Category */ $review_item = $this->o_topic->GetReviewItem(); $s_suggested_title = urlencode(StringFormatter::PlainText(trim($review_item->GetTitle()))); $s_page = urlencode($_SERVER['REQUEST_URI']); $s_subscribe_link = '/play/subscribe.php?type=' . $review_item->GetType() . '&item=' . $review_item->GetId() . '&title=' . $s_suggested_title . '&page=' . $s_page; $s_subscribe_title = 'Get an email alert every time there are new comments on this page'; $this->AddControl('<div class="forumSubscribe"><a href="' . $s_subscribe_link . '" title="' . $s_subscribe_title . '">Subscribe to comments</a></div>'); if (!$this->authentication_manager->GetUser()->Permissions()->HasPermission(PermissionType::ForumAddMessage())) { $add = $this->o_topic->GetCount() ? 'Add your comments' : 'Be the first to add your comments!'; $this->AddControl('<div class="forumPost"><a href="' . Html::Encode($this->authentication_manager->GetPermissionUrl()) . urlencode('#forumMessageForm') . '">' . $add . '</a></div>'); } }