<?php
namespace App\Controller\Module;
use App\AppBundle;
use SaintElmos\BaseBundle\Templating\Helper\FrontendHelper;
use SaintElmos\BaseBundle\Utils\SETConf;
use SaintElmos\BaseBundle\Controller\BaseController;
use Pimcore\Controller\FrontendController;
use Symfony\Component\HttpFoundation\Request;
class MapController extends FrontendController
{
public function brandlogogroupAction(Request $request,\Pimcore\Config\Config $websiteConfig)
{
}
public function mapAction(Request $request)
{
$konfiguration_projekt_obj = \Pimcore\Config::getWebsiteConfig()->get('konfiguration_projekt');
$text_rent = AppBundle::getValue($konfiguration_projekt_obj, 'getText_rent');
$text_homes = AppBundle::getValue($konfiguration_projekt_obj, 'getText_homes');
$text_shops = AppBundle::getValue($konfiguration_projekt_obj, 'getText_shopping');
$mapArray = [];
$multihrefObject = $this->document->getEditable("objectGeolocationFolder");
if(!empty($multihrefObject))
{
$count_multihrefObject = count($multihrefObject->getElements());
}
else
{
$count_multihrefObject = 0;
}
$allow_category = array("sports","fashion","ski-u-snowboard","bike","no-category");
if($count_multihrefObject > 0)
{
foreach($multihrefObject as $e)
{
$category = $e->getProperty('category');
if(in_array($category,$allow_category))
{
$map_arr = AppBundle::mapArray($this, $category );
foreach( $map_arr as $key => $item ){
$mapArray[$key] = $item;
}
}
}
}
else
{
$mapArray = AppBundle::mapArray($this, '');
}
//print_r($mapArray);
//$this->view->mapArray = $mapArray;
return $this->render('module/Map/__google-map-betriebe.html.twig', ["mapArray" => $mapArray, "text_rent"=> $text_rent, "text_homes" => $text_homes, "text_shops" => $text_shops]);
}
}