/** * 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) { $content = $this->contentRepository->findOneByContentId($block->getAttribute('contentId')); $contentAttributes = array(); if ($content) { $contentAttributes = $content->getAttributes(); } return $this->render('OpenOrchestraBackofficeBundle:Block/ConfigurableContent:show.html.twig', array('contentAttributes' => $contentAttributes, 'contentTemplateEnabled' => $block->getAttribute('contentTemplateEnabled'))); }
/** * Get nodes to display * * @param ReadBlockInterface $block * * @return array */ protected function getNodes(ReadBlockInterface $block) { $nodes = null; $nodeName = $block->getAttribute('nodeName'); $siteId = $this->currentSiteManager->getCurrentSiteId(); if (!is_null($nodeName)) { $nodes = $this->nodeRepository->getSubMenu($nodeName, $block->getAttribute('nbLevel'), $this->request->getLocale(), $siteId); } return $nodes; }
/** * Return block specific cache tags * * @param ReadBlockInterface $block * * @return array */ public function getCacheTags(ReadBlockInterface $block) { $tags = array(); $medias = $block->getAttribute('pictures'); if ($medias) { foreach ($medias as $media) { $tags[] = $this->tagManager->formatMediaIdTag(ltrim($media, MediaInterface::MEDIA_PREFIX)); } } return $tags; }
/** * Return block specific cache tags * * @param ReadBlockInterface $block * * @return array */ public function getCacheTags(ReadBlockInterface $block) { $medias = $this->getMediasByKeywords($block->getAttribute('keywords')); $tags = array(); if ($medias) { foreach ($medias as $media) { $tags[] = $this->tagManager->formatMediaIdTag($media->getId()); } } return $tags; }
/** * 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); }
/** * @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) { $formParameters = array('method' => 'GET'); if ('' != $block->getAttribute('contentNodeId')) { $language = $this->currentSiteManager->getCurrentSiteDefaultLanguage(); $siteId = $this->currentSiteManager->getCurrentSiteId(); $nodeId = $this->nodeRepository->findOneCurrentlyPublished($block->getAttribute('contentNodeId'), $language, $siteId)->getId(); $formParameters['action'] = $this->router->generate($nodeId); } $formData = $this->requestStack->getCurrentRequest()->get('elastica_search'); $form = $this->formFactory->create(new SearchType(), $formData, $formParameters); return $this->render('OpenOrchestraElasticaFrontBundle:Block/Search:show.html.twig', array('form' => $form->createView())); }
/** * 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 */ public function show(ReadBlockInterface $block) { $request = $this->requestStack->getCurrentRequest(); $data = $request->get('elastica_search'); $searchData = array(); if (is_array($data) && array_key_exists('search', $data) && null !== $data['search']) { $searchParameter = $data['search']; $index = $this->client->getIndex($this->indexName); $qb = new QueryBuilder(); $search = new Search($this->client); $search->addIndex($index); $search->setQuery($qb->query()->filtered($qb->query()->query_string($searchParameter), $qb->filter()->bool()->addMust($qb->filter()->term(array('language' => $request->getLocale()))))); $searchData = $search->search(null, array('limit' => $block->getAttribute('searchLimit'))); } return $this->render('OpenOrchestraElasticaFrontBundle:Block/List:show.html.twig', array('searchData' => $searchData)); }
/** * 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) { $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) { return $this->render('OpenOrchestraElasticaAdminBundle:Block/List: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) { $htmlContent = $block->getAttribute('htmlContent'); return $this->render('OpenOrchestraBackofficeBundle:Block/TinyMCEWysiwyg:show.html.twig', array('htmlContent' => strip_tags($htmlContent))); }
/** * 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) { return $this->render('OpenOrchestraDisplayBundle:Block/AudienceAnalysis:' . $block->getAttribute('tag_type') . '.html.twig', array('attributes' => $block->getAttributes(), 'page' => $this->requestStack->getCurrentRequest()->attributes->get('nodeId'))); }
/** * Check if the strategy support this block * * @param ReadBlockInterface $block * * @return boolean */ public function support(ReadBlockInterface $block) { return BaseGalleryStrategy::NAME == $block->getComponent(); }
/** * 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())); }
/** * Return block specific cache tags * * @param ReadBlockInterface $block * * @return array */ public function getCacheTags(ReadBlockInterface $block) { $tags = array(); $contents = $this->getContents($block->getAttribute('contentSearch')); if ($contents) { foreach ($contents as $content) { $tags[] = $this->tagManager->formatContentIdTag($content->getContentId()); $contentTypeTag = $this->tagManager->formatContentTypeTag($content->getContentType()); if (!in_array($contentTypeTag, $tags)) { $tags[] = $contentTypeTag; } } } return $tags; }
/** * Return view parameters for a vimeo video * * @param ReadBlockInterface $block * * @return array */ protected function getVimeoParameters(ReadBlockInterface $block) { $urlParams = array(); foreach (array('vimeoAutoplay', 'vimeoFullscreen', 'vimeoLoop') as $key) { if ($block->getAttribute($key) === true) { $urlParams[strtolower(substr($key, 5))] = 1; } } foreach (array('vimeoTitle', 'vimeoByline', 'vimeoPortrait', 'vimeoBadge') as $key) { if ($block->getAttribute($key) === false) { $urlParams[strtolower(substr($key, 5))] = 0; } } if ($block->getAttribute('vimeoColor') !== '') { $urlParams['color'] = str_replace('#', '', $block->getAttribute('vimeoColor')); } $url = "//player.vimeo.com/video/" . $block->getAttribute('vimeoVideoId') . "?" . http_build_query($urlParams, '', '&'); return array('url' => $url, 'width' => $block->getAttribute('vimeoWidth'), 'height' => $block->getAttribute('vimeoHeight')); }
/** * 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'))); }
/** * Return block specific cache tags * * @param ReadBlockInterface $block * * @return array */ public function getCacheTags(ReadBlockInterface $block) { return array($this->tagManager->formatContentTypeTag($block->getAttribute('contentTypeId')), $this->tagManager->formatContentIdTag($block->getAttribute('contentId'))); }
/** * Perform the show action for a block * * @param ReadBlockInterface $block * * @return Response */ public function show(ReadBlockInterface $block) { return $this->render('OpenOrchestraBackofficeBundle:Block/AudienceAnalysis:show.html.twig', array('attributes' => $block->getAttributes())); }
/** * 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'))); }
/** * Check if the strategy support this block * * @param ReadBlockInterface $block * * @return boolean */ public function support(ReadBlockInterface $block) { return self::LOGIN == $block->getComponent(); }
/** * 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('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) { 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) { $parameters = array('latitude' => $block->getAttribute('latitude'), 'longitude' => $block->getAttribute('longitude'), 'zoom' => $block->getAttribute('zoom')); return $this->render('OpenOrchestraBackofficeBundle:Block/Gmap:show.html.twig', $parameters); }