protected function createForTopic(\Symbb\Core\ForumBundle\Entity\Topic $object, $breadcrumb) { if ($object->getId() > 0) { $uri = $this->router->generate('symbb_forum_topic_show', array('id' => $object->getId(), 'name' => $object->getSeoName(), 'page' => 1)); $breadcrumb[] = array('name' => $object->getName(), 'link' => $uri); } $forum = $object->getForum(); $breadcrumb = $this->createForForum($forum, $breadcrumb); return $breadcrumb; }
public function sendTopicNotifications(Topic $topic, $user) { if (is_numeric($user)) { $user = $this->em->getRepository('SymbbCoreUserBundle:User')->find($user); } $templateBundle = $this->siteManager->getTemplate("email"); $subject = $this->translator->trans('It was written a new answer to "%topic%"', array('%topic%' => $topic->getName()), 'symbb_email'); $sender = $this->siteManager->getSite()->getEmail(); if (!empty($sender)) { $recipient = $user->getEmail(); $message = \Swift_Message::newInstance()->setSubject($subject)->setFrom($sender)->setTo($recipient)->setBody($this->container->get('twig')->render($templateBundle . ':Email:topic_notify.' . $this->getLocale() . '.html.twig', array('topic' => $topic, 'user' => $user, 'site' => $this->siteManager->getSite())), 'text/html'); $this->mailer->send($message); } }
public function getBreadcrumbData(\Symbb\Core\ForumBundle\Entity\Topic $object, ForumManager $forumManager) { $breadcrumb = array(); $forum = $object->getForum(); if (\is_object($forum) && $forum->getId() > 0) { $breadcrumb = $forumManager->getBreadcrumbData($forum); $breadcrumb[] = array('type' => 'topic', 'name' => $object->getName(), 'seoName' => $object->getSeoName(), 'id' => $object->getId()); } return $breadcrumb; }