Ejemplo n.º 1
0
 /**
  * Method to get the last post link
  *
  * @param   KunenaForumCategory $category The KunenaCategory object
  * @param   string              $content  The content of last topic subject
  * @param   string              $title    The title of the link
  * @param   string              $class    The class attribute of the link
  *
  * @see KunenaLayout::getLastPostLink()
  *
  * @return string
  */
 public function getLastPostLink($category, $content = null, $title = null, $class = null, $length = 20)
 {
     $lastTopic = $category->getLastTopic();
     $channels = $category->getChannels();
     if (!isset($channels[$lastTopic->category_id])) {
         $category = $lastTopic->getCategory();
     }
     $uri = $lastTopic->getUri($category, 'last');
     if (!$content) {
         $content = KunenaHtmlParser::parseText($category->getLastTopic()->subject, $length);
     }
     if ($title === null) {
         $title = JText::sprintf('COM_KUNENA_TOPIC_LAST_LINK_TITLE', $this->escape($category->getLastTopic()->subject));
     }
     return JHtml::_('kunenaforum.link', $uri, $content, $title, $class, 'nofollow');
 }