예제 #1
0
 /**
  * @param   KunenaForumTopic    $topic
  * @param   null                $action
  * @param   null                $content
  * @param   null                $title
  * @param   null                $class
  * @param   KunenaForumCategory $category
  *
  * @return mixed
  */
 public function getTopicLink(KunenaForumTopic $topic, $action = null, $content = null, $title = null, $class = null, KunenaForumCategory $category = null)
 {
     KUNENA_PROFILER ? KunenaProfiler::instance()->start('function ' . __CLASS__ . '::' . __FUNCTION__ . '()') : null;
     $url = $topic->getUrl($category ? $category : (isset($this->category) ? $this->category : $topic->getCategory()), true, $action);
     if (!$content) {
         $content = KunenaHtmlParser::parseText($topic->subject);
     }
     if ($title === null) {
         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));
             }
         }
     }
     $link = JHtml::_('kunenaforum.link', $url, $content, $title, $class, 'nofollow');
     KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function ' . __CLASS__ . '::' . __FUNCTION__ . '()') : null;
     return $link;
 }