/**
  * 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->getStyle()));
 }
 /**
  * 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->getStyle(), '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')));
 }
 /**
  * @param ReadBlockInterface $block
  *
  * @return Response
  *
  * @throws ContentNotFoundException
  */
 public function show(ReadBlockInterface $block)
 {
     $contentId = $this->requestStack->getCurrentRequest()->get('contentId');
     $content = $this->getContent($contentId);
     if ($content instanceof ReadContentInterface) {
         $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->getStyle(), '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
  */
 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->findOneCurrentlyPublished($nodeToLink, $language, $siteId);
     }
     $parameters = array('picture' => $block->getAttribute('picture'), 'linkUrl' => $linkUrl, 'id' => $block->getId(), 'class' => $block->getStyle());
     return $this->render($this->template, $parameters);
 }
 /**
  * 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();
     if (!\is_null($site)) {
         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->getStyle(), '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->getStyle(), '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->findOneCurrentlyPublished($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
  *
  * @throw ContentNotFoundException
  */
 public function show(ReadBlockInterface $block)
 {
     $contentSearch = $block->getAttribute('contentSearch');
     if (!isset($contentSearch['contentId'])) {
         throw new \InvalidArgumentException();
     }
     $contentId = $contentSearch['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->getStyle(), '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)
 {
     $currentRequest = $this->requestStack->getCurrentRequest();
     $routeAttributes = array_merge($currentRequest->get('_route_params'), array('previous' => $currentRequest->get('currentRouteName'), 'aliasId' => $currentRequest->get('aliasId')));
     $form = $this->formFactory->create(ContactType::class, null, array('method' => 'POST', 'action' => $this->urlGenerator->generate('open_orchestra_front_block', $routeAttributes)));
     $form->handleRequest($currentRequest);
     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->getStyle()));
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     return $this->render('OpenOrchestraBackofficeBundle:Block/Content:show.html.twig', array('id' => $block->getId(), 'class' => $block->getStyle(), 'contentTemplateEnabled' => $block->getAttribute('contentTemplateEnabled')));
 }
 /**
  * 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->getStyle(), '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)
 {
     $parameters = array('latitude' => $block->getAttribute('latitude'), 'longitude' => $block->getAttribute('longitude'), 'zoom' => $block->getAttribute('zoom'), 'class' => $block->getStyle(), '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->getStyle(), '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)
 {
     $contentSearch = $block->getAttribute('contentSearch');
     $attributes = array('id' => $block->getId(), 'class' => $block->getStyle(), 'contentNodeId' => $block->getAttribute('contentNodeId'), 'characterNumber' => $block->getAttribute('characterNumber'), 'keywords' => !is_null($contentSearch) && array_key_exists('keywords', $contentSearch) ? $contentSearch['keywords'] : '', 'choiceType' => !is_null($contentSearch) && array_key_exists('choiceType', $contentSearch) ? $contentSearch['choiceType'] : '', 'contentType' => !is_null($contentSearch) && array_key_exists('contentType', $contentSearch) ? $contentSearch['contentType'] : '', 'contentTemplateEnabled' => $block->getAttribute('contentTemplateEnabled'), 'contentTemplate' => $block->getAttribute('contentTemplate'));
     return $this->render('OpenOrchestraBackofficeBundle:Block/ContentList:show.html.twig', $attributes);
 }
 /**
  * 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(), 'style' => $block->getStyle()));
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     return $this->render('OpenOrchestraMediaAdminBundle:Block/MediaList:show.html.twig', array('id' => $block->getId(), 'class' => $block->getStyle(), 'keywords' => $block->getAttribute('keywords')));
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     return $this->render('OpenOrchestraBackofficeBundle:Block/SubMenu:show.html.twig', array('id' => $block->getId(), 'class' => $block->getStyle(), 'nbLevel' => $block->getAttribute('nbLevel'), 'node' => $block->getAttribute('nodeName')));
 }
 /**
  * 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->getStyle(), 'id' => $block->getId(), 'width' => $block->getAttribute('youtubeWidth'), 'height' => $block->getAttribute('youtubeHeight'));
 }
 /**
  * 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->getStyle(), 'medias' => $medias));
 }
 /**
  * Perform the show action for a block
  *
  * @param ReadBlockInterface $block
  *
  * @return Response
  */
 public function show(ReadBlockInterface $block)
 {
     return $this->render('OpenOrchestraBackofficeBundle:Block/Contact:show.html.twig', array('id' => $block->getId(), 'class' => $block->getStyle()));
 }
 /**
  * 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->getStyle()));
 }