/**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     $htmlContent = $block->getAttribute('htmlContent');
     $this->parser->parse($htmlContent);
     $htmlContent = $this->parser->getAsHTML();
     return $this->render('OpenOrchestraDisplayBundle:Block/TinyMCEWysiwyg:show.html.twig', array('htmlContent' => $htmlContent, 'id' => $block->getId(), 'class' => $block->getClass()));
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     $parameters = $this->getParameters();
     $currentPage = $this->request->get(NavigatorExtension::PARAMETER_PAGE);
     if (!$currentPage) {
         $currentPage = 1;
     }
     return $this->render($this->template, array('galleryClass' => $block->getClass(), 'id' => $block->getId(), 'pictures' => $this->filterMedias($block->getAttribute('pictures'), $currentPage, $block->getAttribute('itemNumber')), 'numberOfColumns' => $block->getAttribute('columnNumber'), 'thumbnailFormat' => $block->getAttribute('thumbnailFormat'), 'imageFormat' => $block->getAttribute('imageFormat'), 'numberOfPages' => $block->getAttribute('itemNumber') == 0 ? 1 : ceil(count($block->getAttribute('pictures')) / $block->getAttribute('itemNumber')), 'parameters' => $parameters, 'currentPage' => $currentPage, 'width' => $block->getAttribute('width')));
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     $linkUrl = null;
     $nodeToLink = $block->getAttribute('nodeToLink');
     if (!empty($nodeToLink)) {
         $language = $this->currentSiteManager->getCurrentSiteDefaultLanguage();
         $siteId = $this->currentSiteManager->getCurrentSiteId();
         $linkUrl = $this->nodeRepository->findPublishedInLastVersion($nodeToLink, $language, $siteId);
     }
     $parameters = array('picture' => $block->getAttribute('picture'), 'linkUrl' => $linkUrl, 'id' => $block->getId(), 'class' => $block->getClass());
     return $this->render($this->template, $parameters);
 }
 /**
  * @param ReadBlockInterface $block
  *
  * @return Response
  *
  * @throws ContentNotFoundException
  */
 public function show(ReadBlockInterface $block)
 {
     $contentId = $this->requestStack->getCurrentRequest()->get('contentId');
     $content = $this->getContent($contentId);
     if (!is_null($content)) {
         $contentTemplate = $block->getAttribute('contentTemplate');
         $this->parser->parse($contentTemplate);
         $contentTemplate = $this->parser->getAsHTML();
         return $this->render('OpenOrchestraDisplayBundle:Block/Content:show.html.twig', array('content' => $content, 'class' => $block->getClass(), 'id' => $block->getId(), 'contentTemplateEnabled' => $block->getAttribute('contentTemplateEnabled'), 'contentTemplate' => $contentTemplate));
     }
     throw new ContentNotFoundException($contentId);
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  *
  * @throw ContentNotFoundException
  */
 public function show(ReadBlockInterface $block)
 {
     $contentId = $block->getAttribute('contentId');
     $language = $this->currentSiteManager->getCurrentSiteDefaultLanguage();
     $content = $this->contentRepository->findLastPublishedVersion($contentId, $language);
     if ($content) {
         $contentTemplate = $block->getAttribute('contentTemplate');
         $this->parser->parse($contentTemplate);
         $contentTemplate = $this->parser->getAsHTML();
         $parameters = array('class' => $block->getClass(), 'id' => $block->getId(), 'content' => $content, 'contentTemplateEnabled' => $block->getAttribute('contentTemplateEnabled'), 'contentTemplate' => $contentTemplate);
         return $this->render('OpenOrchestraDisplayBundle:Block/ConfigurableContent:show.html.twig', $parameters);
     }
     throw new ContentNotFoundException($contentId);
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     $site = $this->siteRepository->findOneBySiteId($this->currentSiteIdInterface->getCurrentSiteId());
     $nodeId = $this->request->get('nodeId');
     $routes = array();
     foreach ($site->getLanguages() as $language) {
         try {
             $routes[$language] = $this->urlGenerator->generate($nodeId, array(OpenOrchestraUrlGenerator::REDIRECT_TO_LANGUAGE => $language));
         } catch (ResourceNotFoundException $e) {
         } catch (RouteNotFoundException $e) {
         }
     }
     return $this->render($this->template, array('class' => $block->getClass(), 'id' => $block->getId(), 'routes' => $routes));
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  *
  * @throws ContentNotFoundException
  */
 public function show(ReadBlockInterface $block)
 {
     $contents = $this->getContents($block->getAttribute('contentSearch'));
     if (!is_null($contents)) {
         $contentTemplate = $block->getAttribute('contentTemplate');
         $this->parser->parse($contentTemplate);
         $contentTemplate = $this->parser->getAsHTML();
         $parameters = array('contents' => $contents, 'class' => $block->getClass(), 'id' => $block->getId(), 'characterNumber' => $block->getAttribute('characterNumber'), 'contentTemplateEnabled' => $block->getAttribute('contentTemplateEnabled'), 'contentTemplate' => $contentTemplate);
         if ('' != $block->getAttribute('contentNodeId')) {
             $language = $this->currentSiteManager->getCurrentSiteDefaultLanguage();
             $siteId = $this->currentSiteManager->getCurrentSiteId();
             $parameters['contentNodeId'] = $this->nodeRepository->findPublishedInLastVersion($block->getAttribute('contentNodeId'), $language, $siteId)->getId();
         }
         return $this->render('OpenOrchestraDisplayBundle:Block/ContentList:show.html.twig', $parameters);
     }
     throw new ContentNotFoundException();
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     $request = $this->requestStack->getCurrentRequest();
     $routeName = $request->query->get('currentRouteName');
     $newsletterSubscriber = $this->factory->create();
     $form = $this->formFactory->create('newsletter_subscriber', $newsletterSubscriber, array('action' => $this->urlGenerator->generate($routeName), 'method' => 'POST'));
     $sendData = $request->query->get('newsletter_subscriber');
     $confirmationMessage = null;
     if (is_array($sendData)) {
         $form->submit($sendData);
         if ($form->isValid()) {
             $confirmationMessage = 'open_orchestra_newsletter.registration.success';
             $this->objectManager->persist($newsletterSubscriber);
             $this->objectManager->flush($newsletterSubscriber);
         }
     }
     return $this->render('OpenOrchestraNewsletterBundle:DisplayBlock/Newsletter:show.html.twig', array('id' => $block->getId(), 'class' => $block->getClass(), 'form' => $form->createView(), 'confirmation_message' => $confirmationMessage));
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     $form = $this->formFactory->create(new ContactType(), null, array('method' => 'POST'));
     $form->handleRequest($this->request);
     if ($form->isValid()) {
         $recipient = $block->getAttribute("recipient");
         $signature = $block->getAttribute("signature");
         $formData = $form->getData();
         //send alert message to webmaster
         $messageToAdmin = \Swift_Message::newInstance()->setSubject($formData['subject'])->setFrom($formData['email'])->setTo($recipient)->setBody($this->renderView('OpenOrchestraDisplayBundle:Block/Email:show_admin.txt.twig', array('name' => $formData['name'], 'message' => $formData['message'], 'mail' => $formData['email'])));
         $event = new MailerEvent($messageToAdmin);
         $this->dispatcher->dispatch(MailerEvents::SEND_MAIL, $event);
         //send confirm e-mail for the user
         $messageToUser = \Swift_Message::newInstance()->setSubject('open_orchestra_display.contact.contact_received')->setFrom($recipient)->setTo($formData['email'])->setBody($this->renderView('OpenOrchestraDisplayBundle:Block/Email:show_user.txt.twig', array('signature' => $signature)));
         $event = new MailerEvent($messageToUser);
         $this->dispatcher->dispatch(MailerEvents::SEND_MAIL, $event);
     }
     return $this->render('OpenOrchestraDisplayBundle:Block/Contact:show.html.twig', array('form' => $form->createView(), 'id' => $block->getId(), 'class' => $block->getClass()));
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     return $this->render('OpenOrchestraElasticaAdminBundle:Block/Search:show.html.twig', array('id' => $block->getId(), 'class' => $block->getClass()));
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     $parameters = array('latitude' => $block->getAttribute('latitude'), 'longitude' => $block->getAttribute('longitude'), 'zoom' => $block->getAttribute('zoom'), 'class' => $block->getClass(), 'id' => $block->getId());
     return $this->render('OpenOrchestraDisplayBundle:Block/Gmap:show.html.twig', $parameters);
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     $parameters = array('slideshow_class' => $block->getClass(), 'slideshow_id' => $block->getId(), 'width' => $block->getAttribute('width'), 'height' => $block->getAttribute('height'), 'pictures' => $block->getAttribute('pictures'));
     return $this->render('OpenOrchestraMediaBundle:Block/Slideshow:show.html.twig', $parameters);
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     $parameters = array('pubid' => $block->getAttribute('pubid'), 'class' => $block->getClass(), 'id' => $block->getId(), 'addThisClass' => $block->getAttribute('addThisClass'));
     return $this->render('OpenOrchestraDisplayBundle:Block/AddThis:show.html.twig', $parameters);
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     $nodes = $this->getNodes();
     return $this->render('OpenOrchestraDisplayBundle:Block/Menu:tree.html.twig', array('tree' => $nodes, 'id' => $block->getId(), 'class' => $block->getClass()));
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     $medias = $this->getMediasByKeywords($block->getAttribute('keywords'));
     return $this->render($this->template, array('id' => $block->getId(), 'class' => $block->getClass(), 'medias' => $medias));
 }
 /**
  * Return view parameters for a youtube video
  * 
  * @param ReadBlockInterface $block
  * 
  * @return array
  */
 protected function getYoutubeParameters(ReadBlockInterface $block)
 {
     $urlParams = array();
     foreach (array('youtubeAutoplay', 'youtubeShowinfo', 'youtubeFs', 'youtubeRel', 'youtubeDisablekb', 'youtubeLoop') as $key) {
         if ($block->getAttribute($key) === true) {
             $urlParams[strtolower(substr($key, 7))] = 1;
         }
     }
     if ($block->getAttribute('youtubeControls') === false) {
         $urlParams['controls'] = 0;
     }
     if ($block->getAttribute('youtubeTheme') === true) {
         $urlParams['theme'] = 'light';
     }
     if ($block->getAttribute('youtubeColor') === true) {
         $urlParams['color'] = 'white';
     }
     if ($block->getAttribute('youtubeHl') !== '') {
         $urlParams['hl'] = $block->getAttribute('youtubeHl');
     }
     $url = "//www.youtube.com/embed/" . $block->getAttribute('youtubeVideoId') . "?" . http_build_query($urlParams, '', '&');
     return array('url' => $url, 'class' => $block->getClass(), 'id' => $block->getId(), 'width' => $block->getAttribute('youtubeWidth'), 'height' => $block->getAttribute('youtubeHeight'));
 }