Exemple #1
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $tags = $this->topicManager->getAvailableTags();
     $builder->add('mainPost', "post")->add('tags', 'entity', array("choices" => $tags, 'class' => 'SymbbCoreForumBundle:Topic\\Tag', 'required' => false, "multiple" => true))->add('locked', 'checkbox', array('required' => false, 'label' => 'close topic'))->add('id', 'hidden')->add('forum', 'entity', array('class' => 'SymbbCoreForumBundle:Forum', 'disabled' => true));
     // create Event to manipulate Post Form
     $event = new FormTopicEvent($builder, $this->translator, $this->topicManager, $this->userManager, $this->groupManager);
     $this->dispatcher->dispatch('symbb.core.forum.topic.form.create', $event);
 }
Exemple #2
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('name', "text", array('label' => 'Titel', 'required' => true, 'attr' => array('placeholder' => 'Enter a name here')));
     $builder->add('text', 'textarea', array('attr' => array('placeholder' => 'Give Your text here', "class" => "symbb-editable")));
     $builder->add('id', 'hidden');
     $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use($builder) {
         $data = $event->getData();
         /* Check we're looking at the right data/form */
         if ($data instanceof Post) {
             $form = $event->getForm();
             $form->add('notifyMe', 'checkbox', array("mapped" => false, 'required' => false, 'label' => 'Notify me', "data" => $this->topicManager->checkFlag($data->getTopic(), "notify", $this->userManager->getCurrentUser())));
         }
     });
     // create Event to manipulate Post Form
     $event = new \Symbb\Core\EventBundle\Event\FormPostEvent($builder, $this->translator, $this->postManager, $this->userManager, $this->groupManager);
     $this->dispatcher->dispatch('symbb.core.forum.topic.post.create', $event);
 }
Exemple #3
0
 public function getBreadcrumbData(Post $object, TopicManager $topicManager, ForumManager $forumManager)
 {
     $breadcrumb = $topicManager->getBreadcrumbData($object->getTopic(), $forumManager);
     return $breadcrumb;
 }