public function getTopicLink(KunenaForumTopic $topic, $action = null, $content = null, $title = null, $class = null, KunenaForumCategory $category = NULL) { $uri = $topic->getUri($category ? $category : (isset($this->category) ? $this->category : $topic->category_id), $action); if (!$content) { $content = KunenaHtmlParser::parseText($topic->subject); } $rel = 'follow'; if ($title === null) { $rel = 'nofollow'; if ($action instanceof KunenaForumMessage) { $title = JText::sprintf('COM_KUNENA_TOPIC_MESSAGE_LINK_TITLE', $this->escape($topic->subject)); } else { switch ($action) { case 'first': $title = JText::sprintf('COM_KUNENA_TOPIC_FIRST_LINK_TITLE', $this->escape($topic->subject)); break; case 'last': $title = JText::sprintf('COM_KUNENA_TOPIC_LAST_LINK_TITLE', $this->escape($topic->subject)); break; case 'unread': $title = JText::sprintf('COM_KUNENA_TOPIC_UNREAD_LINK_TITLE', $this->escape($topic->subject)); break; default: $title = JText::sprintf('COM_KUNENA_TOPIC_LINK_TITLE', $this->escape($topic->subject)); } } } return JHtml::_('kunenaforum.link', $uri, $content, $title, $class, $rel); }
public static function getTopicUrl(KunenaForumTopic $topic, $xhtml = true, $action = null, KunenaForumCategory $category = null) { if (!$category) { $category = $topic->getCategory(); } return KunenaRoute::_($topic->getUri($category, $action), $xhtml); }