src/Controller/Module/MapController.php line 28

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 Pimcore\Controller\FrontendController;
  8. use Symfony\Component\HttpFoundation\Request;
  9. class MapController extends FrontendController
  10. {
  11.     public function brandlogogroupAction(Request $request,\Pimcore\Config\Config $websiteConfig)
  12.     {
  13.     }
  14.     public function mapAction(Request $request)
  15.     {
  16.         $konfiguration_projekt_obj \Pimcore\Config::getWebsiteConfig()->get('konfiguration_projekt');
  17.         $text_rent AppBundle::getValue($konfiguration_projekt_obj'getText_rent');
  18.         $text_homes AppBundle::getValue($konfiguration_projekt_obj'getText_homes');
  19.         $text_shops AppBundle::getValue($konfiguration_projekt_obj'getText_shopping');
  20.         $mapArray = [];
  21.         $multihrefObject $this->document->getEditable("objectGeolocationFolder");
  22.         
  23.         if(!empty($multihrefObject))
  24.         {
  25.             $count_multihrefObject count($multihrefObject->getElements());
  26.         }
  27.         else
  28.         {
  29.             $count_multihrefObject 0;
  30.         }
  31.         $allow_category = array("sports","fashion","ski-u-snowboard","bike","no-category");
  32.         if($count_multihrefObject 0)
  33.         {
  34.             foreach($multihrefObject as $e)
  35.             {
  36.                 $category =  $e->getProperty('category');
  37.                 if(in_array($category,$allow_category))
  38.                 {
  39.                     $map_arr AppBundle::mapArray($this$category );
  40.                     foreach( $map_arr as $key => $item ){
  41.                         $mapArray[$key] = $item;
  42.                     }
  43.                 }
  44.             }
  45.         }
  46.         else
  47.         {
  48.             $mapArray AppBundle::mapArray($this'');
  49.         }
  50.         //print_r($mapArray);
  51.         //$this->view->mapArray = $mapArray;
  52.         return $this->render('module/Map/__google-map-betriebe.html.twig', ["mapArray" =>  $mapArray"text_rent"=> $text_rent"text_homes" => $text_homes"text_shops" => $text_shops]);
  53.     }
  54. }