|
|
|
|
|
|
|
|
use Lc\SovBundle\Component\MetaComponent; |
|
|
use Lc\SovBundle\Component\MetaComponent; |
|
|
use Lc\SovBundle\Component\StringComponent; |
|
|
use Lc\SovBundle\Component\StringComponent; |
|
|
use Lc\SovBundle\Form\Newsletter\NewsletterType; |
|
|
use Lc\SovBundle\Form\Newsletter\NewsletterType; |
|
|
|
|
|
use Lc\SovBundle\Model\File\FileInterface; |
|
|
use Lc\SovBundle\Repository\Reminder\ReminderStore; |
|
|
use Lc\SovBundle\Repository\Reminder\ReminderStore; |
|
|
use Lc\SovBundle\Translation\TranslatorAdmin; |
|
|
use Lc\SovBundle\Translation\TranslatorAdmin; |
|
|
use Liip\ImagineBundle\Imagine\Cache\CacheManager; |
|
|
use Liip\ImagineBundle\Imagine\Cache\CacheManager; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TwigExtension extends AbstractExtension |
|
|
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 FormFactoryInterface $formFactory; |
|
|
protected StringComponent $stringComponent; |
|
|
protected StringComponent $stringComponent; |
|
|
|
|
|
protected MetaComponent $metaComponent; |
|
|
|
|
|
|
|
|
public function __construct( |
|
|
public function __construct( |
|
|
KernelInterface $kernel, |
|
|
KernelInterface $kernel, |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
return [ |
|
|
return [ |
|
|
new TwigFunction('sov_liip', [$this, 'liip']), |
|
|
new TwigFunction('sov_liip', [$this, 'liip']), |
|
|
|
|
|
new TwigFunction('liip', [$this, 'liip']), |
|
|
new TwigFunction('sov_get_by_devalias', [$this, 'getByDevAlias']), |
|
|
new TwigFunction('sov_get_by_devalias', [$this, 'getByDevAlias']), |
|
|
new TwigFunction('sov_parameter', [$this, 'getParameter']), |
|
|
new TwigFunction('sov_parameter', [$this, 'getParameter']), |
|
|
new TwigFunction('sov_homepage_route', [$this, 'getHomepageRoute']), |
|
|
new TwigFunction('sov_homepage_route', [$this, 'getHomepageRoute']), |
|
|
|
|
|
|
|
|
$fileManagerFolder = substr($this->getFileManagerFolder(), 1); |
|
|
$fileManagerFolder = substr($this->getFileManagerFolder(), 1); |
|
|
|
|
|
|
|
|
if (strpos($path, $fileManagerFolder) === false) { |
|
|
if (strpos($path, $fileManagerFolder) === false) { |
|
|
$path = $fileManagerFolder.'/'.$path; |
|
|
|
|
|
|
|
|
$path = $fileManagerFolder . '/' . $path; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (file_exists($path)) { |
|
|
if (file_exists($path)) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return $this->cacheManager->getBrowserPath($this->getFileManagerFolder().'/'.$default, $thumb); |
|
|
|
|
|
|
|
|
return $this->cacheManager->getBrowserPath($this->getFileManagerFolder() . '/' . $default, $thumb); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getFileManagerFolder() |
|
|
public function getFileManagerFolder() |