|
|
@@ -7,6 +7,7 @@ use Doctrine\ORM\EntityManagerInterface; |
|
|
|
use Lc\SovBundle\Component\MetaComponent; |
|
|
|
use Lc\SovBundle\Component\StringComponent; |
|
|
|
use Lc\SovBundle\Form\Newsletter\NewsletterType; |
|
|
|
use Lc\SovBundle\Model\File\FileInterface; |
|
|
|
use Lc\SovBundle\Repository\Reminder\ReminderStore; |
|
|
|
use Lc\SovBundle\Translation\TranslatorAdmin; |
|
|
|
use Liip\ImagineBundle\Imagine\Cache\CacheManager; |
|
|
@@ -23,18 +24,19 @@ use Twig\TwigFunction; |
|
|
|
|
|
|
|
class TwigExtension extends AbstractExtension |
|
|
|
{ |
|
|
|
protected $em; |
|
|
|
protected $kernel; |
|
|
|
protected $parameterBag; |
|
|
|
protected $cacheManager; |
|
|
|
protected $requestStack; |
|
|
|
protected $router; |
|
|
|
protected $translator; |
|
|
|
protected $translatorAdmin; |
|
|
|
protected $reminderStore; |
|
|
|
protected $security; |
|
|
|
protected EntityManagerInterface $em; |
|
|
|
protected KernelInterface $kernel; |
|
|
|
protected ParameterBagInterface $parameterBag; |
|
|
|
protected CacheManager $cacheManager; |
|
|
|
protected RequestStack $requestStack; |
|
|
|
protected UrlGeneratorInterface $router; |
|
|
|
protected TranslatorInterface $translator; |
|
|
|
protected TranslatorAdmin $translatorAdmin; |
|
|
|
protected ReminderStore $reminderStore; |
|
|
|
protected Security $security; |
|
|
|
protected FormFactoryInterface $formFactory; |
|
|
|
protected StringComponent $stringComponent; |
|
|
|
protected MetaComponent $metaComponent; |
|
|
|
|
|
|
|
public function __construct( |
|
|
|
KernelInterface $kernel, |
|
|
@@ -70,6 +72,7 @@ class TwigExtension extends AbstractExtension |
|
|
|
{ |
|
|
|
return [ |
|
|
|
new TwigFunction('sov_liip', [$this, 'liip']), |
|
|
|
new TwigFunction('liip', [$this, 'liip']), |
|
|
|
new TwigFunction('sov_get_by_devalias', [$this, 'getByDevAlias']), |
|
|
|
new TwigFunction('sov_parameter', [$this, 'getParameter']), |
|
|
|
new TwigFunction('sov_homepage_route', [$this, 'getHomepageRoute']), |
|
|
@@ -128,7 +131,7 @@ class TwigExtension extends AbstractExtension |
|
|
|
$fileManagerFolder = substr($this->getFileManagerFolder(), 1); |
|
|
|
|
|
|
|
if (strpos($path, $fileManagerFolder) === false) { |
|
|
|
$path = $fileManagerFolder.'/'.$path; |
|
|
|
$path = $fileManagerFolder . '/' . $path; |
|
|
|
} |
|
|
|
|
|
|
|
if (file_exists($path)) { |
|
|
@@ -136,7 +139,7 @@ class TwigExtension extends AbstractExtension |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return $this->cacheManager->getBrowserPath($this->getFileManagerFolder().'/'.$default, $thumb); |
|
|
|
return $this->cacheManager->getBrowserPath($this->getFileManagerFolder() . '/' . $default, $thumb); |
|
|
|
} |
|
|
|
|
|
|
|
public function getFileManagerFolder() |