* Startseite
* Sidebar-Widgets: Reisemagazin, Reiseführer, Angebote git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3301 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
353b758bcd
commit
4278e110fc
12 changed files with 305 additions and 381 deletions
|
|
@ -5,7 +5,7 @@ namespace AppBundle\Controller;
|
|||
use AppBundle\Entity\BreadcrumbEntry;
|
||||
use AppBundle\Entity\ContactRequest;
|
||||
use AppBundle\Entity\Page;
|
||||
use AppBundle\Entity\TravelProgram;
|
||||
use AppBundle\Entity\TravelCountry;
|
||||
use AppBundle\Form\ContactRequestType;
|
||||
use AppBundle\Form\SearchRequestType;
|
||||
use AppBundle\Form\TtSearchRequestType;
|
||||
|
|
@ -16,7 +16,6 @@ use Gedmo\Tree\TreeListener;
|
|||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Stopwatch\Stopwatch;
|
||||
|
||||
class DefaultController extends Controller
|
||||
{
|
||||
|
|
@ -44,6 +43,8 @@ class DefaultController extends Controller
|
|||
'show_search_sidebar_widget' => false,
|
||||
'search_form' => $this->createForm(SearchRequestType::class)->createView(),
|
||||
'tt_search_form' => $this->createForm(TtSearchRequestType::class)->createView(),
|
||||
'offers' => $this->getEntityManager()->getRepository('AppBundle:Page')->findOffers(),
|
||||
'country_pages' => $this->getEntityManager()->getRepository('AppBundle:Page')->findCountryPages(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -256,7 +257,7 @@ class DefaultController extends Controller
|
|||
$this->get('mailer')->send(\Swift_Message::newInstance()
|
||||
->setSubject('Kontaktformular (stern-tours.de)')
|
||||
->setFrom('stern@stern-tours.de', 'STERN TOURS')
|
||||
->setTo('ulrich.hecht@hecht-software.de')
|
||||
->setTo('stern@stern-tours.de')
|
||||
->setBody(
|
||||
$this->renderView('default/email/contactServiceEmail.txt.twig', [
|
||||
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
||||
|
|
@ -284,19 +285,7 @@ class DefaultController extends Controller
|
|||
|
||||
public function headerAction()
|
||||
{
|
||||
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||
$navPages = $qb
|
||||
->from('AppBundle:Page', 'page')
|
||||
->select('page')
|
||||
->leftJoin('page.children', 'childPage', Expr\Join::WITH, 'childPage.status > 0')
|
||||
->addSelect('childPage')
|
||||
->where('page.status > 0')
|
||||
->andWhere('page.template = \'overview\'')
|
||||
->andWhere('page.lvl = 0')
|
||||
->orderBy('page.lft,page.title,childPage.lft,childPage.title')
|
||||
->getQuery()
|
||||
->execute()
|
||||
;
|
||||
$navPages = $this->getEntityManager()->getRepository('AppBundle:Page')->findTopCountryNavPages();
|
||||
return $this->render('default/components/header.html.twig', [
|
||||
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
||||
'nav_pages' => $navPages,
|
||||
|
|
@ -383,6 +372,47 @@ class DefaultController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
public function travelGuideSidebarWidgetAction(TravelCountry $country)
|
||||
{
|
||||
$repo = $this->getEntityManager()->getRepository('AppBundle:Page');
|
||||
$rootPage = $repo->find(13);
|
||||
$pages = $repo->getChildrenQueryBuilder($rootPage)
|
||||
->andWhere('IDENTITY(node.country) = '. $country->getId())
|
||||
->setMaxResults(3)
|
||||
->getQuery()
|
||||
->execute()
|
||||
;
|
||||
return $this->render('default/components/sidebar/textSliderSidebarWidget.html.twig', [
|
||||
'slider_title' => 'Reiseführer',
|
||||
'slides' => $pages
|
||||
]);
|
||||
}
|
||||
|
||||
public function travelMagazineSidebarWidgetAction(TravelCountry $country)
|
||||
{
|
||||
$repo = $this->getEntityManager()->getRepository('AppBundle:Page');
|
||||
$rootPage = $repo->find(2803);
|
||||
$pages = $repo->getChildrenQueryBuilder($rootPage)
|
||||
->andWhere('IDENTITY(node.country) = '. $country->getId())
|
||||
->setMaxResults(3)
|
||||
->getQuery()
|
||||
->execute()
|
||||
;
|
||||
return $this->render('default/components/sidebar/textSliderSidebarWidget.html.twig', [
|
||||
'slider_title' => 'Reisemagazin',
|
||||
'slides' => $pages
|
||||
]);
|
||||
}
|
||||
|
||||
public function offersSidebarWidgetAction(TravelCountry $country)
|
||||
{
|
||||
$pages = $this->getEntityManager()->getRepository('AppBundle:Page')->findWithTravelProgramsOfCountry($country);
|
||||
return $this->render('default/components/sidebar/pageSliderSidebarWidget.html.twig', [
|
||||
'slider_title' => 'Angebote',
|
||||
'pages' => $pages
|
||||
]);
|
||||
}
|
||||
|
||||
/*
|
||||
Suche Kindknoten
|
||||
Für jeden Kindknoten
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue