src/Controller/Module/StartseiteController.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Module;
  3. use App\AppBundle;
  4. use SaintElmos\BaseBundle\Templating\Helper\FrontendHelper;
  5. use SaintElmos\BaseBundle\Utils\SETConf;
  6. use SaintElmos\BaseBundle\Controller\BaseController;
  7. use Symfony\Component\HttpFoundation\Request;
  8. use Pimcore\Controller\FrontendController;
  9. class StartseiteController extends FrontendController
  10. {
  11.     public function introAction(Request $request,\Pimcore\Config\Config $websiteConfig)
  12.     {
  13.         $template $this->document->getTemplate() ? $this->document->getTemplate() : 'module/Startseite/__startseite.html.twig';
  14.         $frontendhelper = new FrontendHelper();
  15.         $konfiguration_projekt_obj \Pimcore\Config::getWebsiteConfig()->get('konfiguration_projekt');
  16.         $bugfiximageurl AppBundle::getBugfiximageurl();
  17.         function getMainImageSrc($assetPath):string
  18.         {
  19.         
  20.             if ($assetPath != '') {
  21.                 $asset \Pimcore\Model\Asset::getByPath($assetPath);
  22.                 if ($asset) {
  23.                     $tumb $asset->getThumbnail('intro-large');
  24.                     return (string) $tumb->getPath();
  25.                 }
  26.                 return '';
  27.             }
  28.             return '';
  29.         }
  30.          $saison = (string)AppBundle::getValue($konfiguration_projekt_obj'getSaison');
  31.         if(trim($saison) != 'winter')
  32.         {
  33.             $saison 'sommer';
  34.             $img_rent      = (string)AppBundle::getValue($konfiguration_projekt_obj'getImg_rent_so');
  35.             $img_homes     = (string)AppBundle::getValue($konfiguration_projekt_obj'getImg_homes_so');
  36.             $img_shopping  = (string)AppBundle::getValue($konfiguration_projekt_obj'getImg_shopping_so');
  37.             $img_shopping_logo getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_shopping_2023'));
  38.             $img_shopping_logo_mobile getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_shopping_2023_mobile'));
  39.             $img_bike_logo getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_bike_2023'));
  40.             $img_bike_logo_mobile getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_bike_2023_mobile'));
  41.             $img_apartments_logo getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_apartments_2023'));
  42.             $img_apartments_logo_mobile getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_apartments_2023_mobile'));
  43.         }
  44.         else
  45.         {
  46.             $saison 'winter';
  47.             $img_rent    = (string)AppBundle::getValue($konfiguration_projekt_obj'getImg_rent_wi');
  48.             $img_homes    = (string)AppBundle::getValue($konfiguration_projekt_obj'getImg_homes_wi');
  49.             $img_shopping = (string)AppBundle::getValue($konfiguration_projekt_obj'getImg_shopping_wi');
  50.             $img_shopping_logo getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_shopping_2023'));
  51.             $img_shopping_logo_mobile getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_shopping_2023_mobile'));
  52.             $img_bike_logo getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_bike_2023'));
  53.             $img_bike_logo_mobile getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_bike_2023_mobile'));
  54.             $img_apartments_logo getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_apartments_2023'));
  55.             $img_apartments_logo_mobile getMainImageSrc(AppBundle::getValue($konfiguration_projekt_obj'getLogo_apartments_2023_mobile'));
  56.         }
  57.         $img_rent_thumb_large '';
  58.         if($img_rent != '')
  59.         {
  60.             $img_srent_obj \Pimcore\Model\Asset::getByPath($img_rent);
  61.             
  62.             if(is_object($img_srent_obj))
  63.             {
  64.                 $img_rent_thumb_large = (string)$img_srent_obj->getThumbnail('intro-large');
  65.                 $img_rent_thumb_medium = (string)$img_srent_obj->getThumbnail('intro-medium');
  66.                 $img_rent_thumb_small =  AppBundle::getValue($konfiguration_projekt_obj'getLogodomain');
  67.             }
  68.         }
  69.         $img_homes_thumb_medium '';
  70.         if($img_homes != '')
  71.         {
  72.             $img_homes_obj \Pimcore\Model\Asset::getByPath($img_homes);
  73.             if(is_object($img_homes_obj))
  74.             {
  75.                 $img_homes_thumb_large = (string)$img_homes_obj->getThumbnail('intro-large');
  76.                 $img_homes_thumb_medium = (string)$img_homes_obj->getThumbnail('intro-medium');
  77.                 $img_homes_thumb_small = (string)$img_homes_obj->getThumbnail('intro-small');
  78.             }
  79.         }
  80.         $img_hopping_thumb_large '';
  81.         if($img_shopping != '')
  82.         {
  83.             $img_shopping_obj \Pimcore\Model\Asset::getByPath($img_shopping);
  84.             if(is_object($img_shopping_obj))
  85.             {
  86.                 $img_shopping_thumb_large = (string)$img_shopping_obj->getThumbnail('intro-large');
  87.                 $img_shopping_thumb_medium = (string)$img_shopping_obj->getThumbnail('intro-medium');
  88.                 $img_shopping_thumb_small = (string)$img_shopping_obj->getThumbnail('intro-small');
  89.             }
  90.         }
  91.         $img_homes_thumb_medium '';
  92.         if($img_homes != '')
  93.         {
  94.             $img_homes_obj \Pimcore\Model\Asset::getByPath($img_homes);
  95.             if(is_object($img_homes_obj))
  96.             {
  97.                 $img_homes_thumb_large = (string)$img_homes_obj->getThumbnail('intro-large');
  98.                 $img_homes_thumb_medium = (string)$img_homes_obj->getThumbnail('intro-medium');
  99.                 $img_homes_thumb_small = (string)$img_homes_obj->getThumbnail('intro-small');
  100.             }
  101.         }
  102.         $title_rent      = (string)AppBundle::getValue($konfiguration_projekt_obj'getTitle_rent');
  103.         $title_rent      $frontendhelper->changeTextarea($title_rent);
  104.         $title_homes     = (string)AppBundle::getValue($konfiguration_projekt_obj'getTitle_homes');
  105.         $title_homes      $frontendhelper->changeTextarea($title_homes);
  106.         $title_shopping  = (string)AppBundle::getValue($konfiguration_projekt_obj'getTitle_shopping');
  107.         $title_shopping      $frontendhelper->changeTextarea($title_shopping);
  108.         $subhl_rent      = (string)AppBundle::getValue($konfiguration_projekt_obj'getSubhl_rent');
  109.         $subhl_homes     = (string)AppBundle::getValue($konfiguration_projekt_obj'getSubhl_homes');
  110.         $subhl_shopping  = (string)AppBundle::getValue($konfiguration_projekt_obj'getSubhl_shopping');
  111.         $url_rent = (string)AppBundle::getValue($konfiguration_projekt_obj'getUrl_rent');
  112.         $url_homes = (string)AppBundle::getValue($konfiguration_projekt_obj'getUrl_homes');
  113.         $url_shops = (string)AppBundle::getValue($konfiguration_projekt_obj'getUrl_shopping');
  114.         $url_glory = (string)AppBundle::getValue($konfiguration_projekt_obj'getUrl_glanz');  
  115.         /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  116.         $intro = array(
  117.             'saison'                    => $saison,
  118.             'title_rent'                => $title_rent,
  119.             'title_homes'               => $title_homes,
  120.             'title_shopping'            => $title_shopping,
  121.             'subhl_rent'                => $subhl_rent,
  122.             'subhl_homes'               => $subhl_homes,
  123.             'subhl_shopping'            => $subhl_shopping,
  124.             'img_rent_thumb_large'      => $img_rent_thumb_large,
  125.             'img_rent_thumb_medium'     => $img_rent_thumb_medium,
  126.             'img_rent_thumb_small'      => $img_rent_thumb_small,
  127.             'img_homes_thumb_large'     => $img_homes_thumb_large,
  128.             'img_homes_thumb_medium'    => $img_homes_thumb_medium,
  129.             'img_homes_thumb_small'     => $img_homes_thumb_small,
  130.             'img_shopping_thumb_large'  => $img_shopping_thumb_large,
  131.             'img_shopping_thumb_medium' => $img_shopping_thumb_medium,
  132.             'img_shopping_thumb_small'  => $img_shopping_thumb_small,
  133.             'glanzerLogo'               => $img_shopping_logo,
  134.             'intersportlogo'            => $img_bike_logo,
  135.             'glanzGlory'                => $img_apartments_logo,
  136.             'glanzerMain'               => $img_shopping_thumb_large,
  137.             'intersportMain'            => $img_rent_thumb_large,
  138.             'gloryGlanzMain'            => $img_homes_thumb_large,
  139.             'glanzerMobileLogo'         => $img_shopping_logo_mobile,
  140.             'intersportMobilelogo'      => $img_bike_logo_mobile,
  141.             'gloryGlanzMobileLogo'      => $img_apartments_logo_mobile,
  142.             'url_rent'                  => $url_rent,
  143.             'url_homes'                 => $url_homes,
  144.             'url_shops'                 => $url_shops
  145.         );
  146. //        $this->view->intro = $intro;
  147.         return $this->render('module/Startseite/__startseite.html.twig', ['intro' => $intro]);
  148.     }
  149. }