mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
sf4 resolve errors and depreciations
This commit is contained in:
parent
7881efa5fe
commit
ced9d17d03
@ -134,17 +134,6 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
|||||||
|
|
||||||
public function prepend(ContainerBuilder $container)
|
public function prepend(ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$bundles = $container->getParameter('kernel.bundles');
|
|
||||||
//add ChillMain to assetic-enabled bundles
|
|
||||||
if (!isset($bundles['AsseticBundle'])) {
|
|
||||||
throw new MissingBundleException('AsseticBundle');
|
|
||||||
}
|
|
||||||
|
|
||||||
$asseticConfig = $container->getExtensionConfig('assetic');
|
|
||||||
$asseticConfig['bundles'][] = 'ChillMainBundle';
|
|
||||||
$container->prependExtensionConfig('assetic',
|
|
||||||
array('bundles' => array('ChillMainBundle')));
|
|
||||||
|
|
||||||
//add installation_name and date_format to globals
|
//add installation_name and date_format to globals
|
||||||
$chillMainConfig = $container->getExtensionConfig($this->getAlias());
|
$chillMainConfig = $container->getExtensionConfig($this->getAlias());
|
||||||
$config = $this->processConfiguration($this
|
$config = $this->processConfiguration($this
|
||||||
|
@ -37,8 +37,8 @@ class Configuration implements ConfigurationInterface
|
|||||||
*/
|
*/
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder('chill_main');
|
||||||
$rootNode = $treeBuilder->root('chill_main');
|
$rootNode = $treeBuilder->getRootNode('chill_main');
|
||||||
|
|
||||||
$rootNode
|
$rootNode
|
||||||
->children()
|
->children()
|
||||||
|
@ -149,8 +149,8 @@ trait AddWidgetConfigurationTrait
|
|||||||
*/
|
*/
|
||||||
protected function addWidgetsConfiguration($place, ContainerBuilder $containerBuilder)
|
protected function addWidgetsConfiguration($place, ContainerBuilder $containerBuilder)
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder($place);
|
||||||
$root = $treeBuilder->root($place)
|
$root = $treeBuilder->getRootNode($place)
|
||||||
->canBeUnset()
|
->canBeUnset()
|
||||||
->info('register widgets on place "'.$place.'"');
|
->info('register widgets on place "'.$place.'"');
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ namespace Chill\MainBundle\Notification;
|
|||||||
|
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
use Symfony\Component\Mailer\MailerInterface;
|
||||||
use Symfony\Component\Routing\RouterInterface;
|
use Symfony\Component\Routing\RouterInterface;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
@ -75,10 +76,10 @@ class Mailer
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
\Twig\Environment $twig,
|
\Twig\Environment $twig,
|
||||||
\Swift_Mailer $mailer,
|
MailerInterface $mailer,
|
||||||
// due to bug https://github.com/symfony/swiftmailer-bundle/issues/127
|
// due to bug https://github.com/symfony/swiftmailer-bundle/issues/127
|
||||||
\Swift_Transport $mailerTransporter,
|
// \Swift_Transport $mailerTransporter,
|
||||||
RouterInterface $router,
|
RouterInterface $router,
|
||||||
TranslatorInterface $translator,
|
TranslatorInterface $translator,
|
||||||
$routeParameters
|
$routeParameters
|
||||||
) {
|
) {
|
||||||
@ -88,7 +89,7 @@ class Mailer
|
|||||||
$this->router = $router;
|
$this->router = $router;
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
$this->routeParameters = $routeParameters;
|
$this->routeParameters = $routeParameters;
|
||||||
$this->forcedMailer = new \Swift_Mailer($mailerTransporter);
|
//$this->forcedMailer = new \Swift_Mailer($mailerTransporter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,13 +22,16 @@
|
|||||||
|
|
||||||
namespace Chill\MainBundle\Pagination;
|
namespace Chill\MainBundle\Pagination;
|
||||||
|
|
||||||
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\TwigFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add twig function to render pagination
|
* add twig function to render pagination
|
||||||
*
|
*
|
||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
* @author Champs Libres <info@champs-libres.coop>
|
* @author Champs Libres <info@champs-libres.coop>
|
||||||
*/
|
*/
|
||||||
class ChillPaginationTwig extends \Twig_Extension
|
class ChillPaginationTwig extends AbstractExtension
|
||||||
{
|
{
|
||||||
const LONG_TEMPLATE = 'ChillMainBundle:Pagination:long.html.twig';
|
const LONG_TEMPLATE = 'ChillMainBundle:Pagination:long.html.twig';
|
||||||
const SHORT_TEMPLATE = 'ChillMainBundle:Pagination:short.html.twig';
|
const SHORT_TEMPLATE = 'ChillMainBundle:Pagination:short.html.twig';
|
||||||
@ -41,7 +44,7 @@ class ChillPaginationTwig extends \Twig_Extension
|
|||||||
public function getFunctions()
|
public function getFunctions()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new \Twig_SimpleFunction(
|
new TwigFunction(
|
||||||
'chill_pagination',
|
'chill_pagination',
|
||||||
array($this, 'paginationRender'),
|
array($this, 'paginationRender'),
|
||||||
array(
|
array(
|
||||||
|
@ -4,7 +4,7 @@ services:
|
|||||||
- "@logger"
|
- "@logger"
|
||||||
- "@twig"
|
- "@twig"
|
||||||
- "@mailer"
|
- "@mailer"
|
||||||
- "@swiftmailer.transport"
|
# - "@swiftmailer.transport"
|
||||||
- "@router"
|
- "@router"
|
||||||
- "@translator"
|
- "@translator"
|
||||||
- "%chill_main.notifications%"
|
- "%chill_main.notifications%"
|
||||||
|
@ -6,5 +6,5 @@ services:
|
|||||||
- { name: kernel.event_subcriber }
|
- { name: kernel.event_subcriber }
|
||||||
|
|
||||||
Chill\MainBundle\Redis\ChillRedis:
|
Chill\MainBundle\Redis\ChillRedis:
|
||||||
factory: 'Chill\MainBundle\Redis\RedisConnectionFactory:create'
|
factory: [ '@Chill\MainBundle\Redis\RedisConnectionFactory', 'create' ]
|
||||||
|
|
@ -1,20 +1,20 @@
|
|||||||
services:
|
services:
|
||||||
twig_intl:
|
# twig_intl:
|
||||||
class: Twig_Extensions_Extension_Intl
|
# class: Twig_Extensions_Extension_Intl
|
||||||
tags:
|
# tags:
|
||||||
- { name: twig.extension }
|
# - { name: twig.extension }
|
||||||
|
#
|
||||||
twig_date:
|
# twig_date:
|
||||||
class: Twig_Extensions_Extension_Date
|
# class: Twig_Extensions_Extension_Date
|
||||||
arguments:
|
# arguments:
|
||||||
- "@translator"
|
# - "@translator"
|
||||||
tags:
|
# tags:
|
||||||
- { name: twig.extension }
|
# - { name: twig.extension }
|
||||||
|
#
|
||||||
twig_text:
|
# twig_text:
|
||||||
class: Twig_Extensions_Extension_Text
|
# class: Twig_Extensions_Extension_Text
|
||||||
tags:
|
# tags:
|
||||||
- { name: twig.extension }
|
# - { name: twig.extension }
|
||||||
|
|
||||||
Chill\MainBundle\Templating\ChillTwigHelper:
|
Chill\MainBundle\Templating\ChillTwigHelper:
|
||||||
tags:
|
tags:
|
||||||
|
@ -80,7 +80,6 @@ Create: Créer
|
|||||||
show: voir
|
show: voir
|
||||||
Show: Voir
|
Show: Voir
|
||||||
edit: modifier
|
edit: modifier
|
||||||
Edit: Modifier
|
|
||||||
Main admin menu: Menu d'administration principal
|
Main admin menu: Menu d'administration principal
|
||||||
Actions: Actions
|
Actions: Actions
|
||||||
Users and permissions: Utilisateurs et permissions
|
Users and permissions: Utilisateurs et permissions
|
||||||
@ -111,7 +110,6 @@ Permission group: Groupe de permissions
|
|||||||
Permissionsgroup: Group de permissions
|
Permissionsgroup: Group de permissions
|
||||||
New permission group: Nouveau groupe de permissions
|
New permission group: Nouveau groupe de permissions
|
||||||
PermissionsGroup "%name%" edit: Modification du groupe de permission '%name%'
|
PermissionsGroup "%name%" edit: Modification du groupe de permission '%name%'
|
||||||
Grant new permissions: Attribuer de nouvelles permissions
|
|
||||||
Role: Rôle
|
Role: Rôle
|
||||||
Choose amongst roles: Choisir parmi les rôles
|
Choose amongst roles: Choisir parmi les rôles
|
||||||
Add permission: Ajouter les permissions
|
Add permission: Ajouter les permissions
|
||||||
|
@ -24,13 +24,15 @@ namespace Chill\MainBundle\Routing;
|
|||||||
use Chill\MainBundle\Routing\MenuComposer;
|
use Chill\MainBundle\Routing\MenuComposer;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\TwigFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the filter 'chill_menu'
|
* Add the filter 'chill_menu'
|
||||||
*
|
*
|
||||||
* @author Julien Fastré <julien arobase fastre point info>
|
* @author Julien Fastré <julien arobase fastre point info>
|
||||||
*/
|
*/
|
||||||
class MenuTwig extends \Twig_Extension implements ContainerAwareInterface
|
class MenuTwig extends AbstractExtension implements ContainerAwareInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,7 +65,7 @@ class MenuTwig extends \Twig_Extension implements ContainerAwareInterface
|
|||||||
|
|
||||||
public function getFunctions()
|
public function getFunctions()
|
||||||
{
|
{
|
||||||
return [new \Twig_SimpleFunction('chill_menu',
|
return [new TwigFunction('chill_menu',
|
||||||
array($this, 'chillMenu'), array(
|
array($this, 'chillMenu'), array(
|
||||||
'is_safe' => array('html'),
|
'is_safe' => array('html'),
|
||||||
'needs_environment' => true
|
'needs_environment' => true
|
||||||
|
@ -22,13 +22,16 @@
|
|||||||
|
|
||||||
namespace Chill\MainBundle\Templating;
|
namespace Chill\MainBundle\Templating;
|
||||||
|
|
||||||
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\TwigFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Twig filter to transform a string in a safer way to be the content of a csv
|
* Twig filter to transform a string in a safer way to be the content of a csv
|
||||||
* cell.
|
* cell.
|
||||||
*
|
*
|
||||||
* This filter replace the char " by ""
|
* This filter replace the char " by ""
|
||||||
*/
|
*/
|
||||||
class CSVCellTwig extends \Twig_Extension
|
class CSVCellTwig extends AbstractExtension
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Returns a list of filters to add to the existing list.
|
* Returns a list of filters to add to the existing list.
|
||||||
@ -39,7 +42,7 @@ class CSVCellTwig extends \Twig_Extension
|
|||||||
public function getFilters()
|
public function getFilters()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new \Twig_SimpleFilter(
|
new TwigFilter(
|
||||||
'csv_cell',
|
'csv_cell',
|
||||||
array($this, 'csvCellFilter'),
|
array($this, 'csvCellFilter'),
|
||||||
array('is_safe' => array('html')))
|
array('is_safe' => array('html')))
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
namespace Chill\MainBundle\Templating;
|
namespace Chill\MainBundle\Templating;
|
||||||
|
|
||||||
use Twig\Extension\AbstractExtension;
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\Node\Node;
|
||||||
use Twig\TwigFunction;
|
use Twig\TwigFunction;
|
||||||
use Twig\TwigFilter;
|
use Twig\TwigFilter;
|
||||||
use Symfony\Component\HttpFoundation\RequestStack;
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
@ -72,7 +73,7 @@ class ChillTwigRoutingHelper extends AbstractExtension
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isUrlGenerationSafe(\Twig_Node $argsNode)
|
public function isUrlGenerationSafe(Node $argsNode)
|
||||||
{
|
{
|
||||||
return $this->originalExtension->isUrlGenerationSafe($argsNode);
|
return $this->originalExtension->isUrlGenerationSafe($argsNode);
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,10 @@
|
|||||||
namespace Chill\MainBundle\Templating;
|
namespace Chill\MainBundle\Templating;
|
||||||
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
||||||
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\TwigFilter;
|
||||||
|
|
||||||
class TranslatableStringTwig extends \Twig_Extension
|
class TranslatableStringTwig extends AbstractExtension
|
||||||
{
|
{
|
||||||
use ContainerAwareTrait;
|
use ContainerAwareTrait;
|
||||||
|
|
||||||
@ -51,7 +53,7 @@ class TranslatableStringTwig extends \Twig_Extension
|
|||||||
public function getFilters()
|
public function getFilters()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new \Twig_SimpleFilter(
|
new TwigFilter(
|
||||||
'localize_translatable_string', array($this, 'localize')));
|
'localize_translatable_string', array($this, 'localize')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,8 @@ namespace Chill\MainBundle\Templating\Widget;
|
|||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
use Chill\MainBundle\Templating\Widget\WidgetInterface;
|
use Chill\MainBundle\Templating\Widget\WidgetInterface;
|
||||||
use Chill\MainBundle\Templating\Events\DelegatedBlockRenderingEvent;
|
use Chill\MainBundle\Templating\Events\DelegatedBlockRenderingEvent;
|
||||||
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\TwigFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the function `chill_delegated_block`.
|
* Add the function `chill_delegated_block`.
|
||||||
@ -49,7 +51,7 @@ use Chill\MainBundle\Templating\Events\DelegatedBlockRenderingEvent;
|
|||||||
*
|
*
|
||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
*/
|
*/
|
||||||
class WidgetRenderingTwig extends \Twig_Extension
|
class WidgetRenderingTwig extends AbstractExtension
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,14 +92,14 @@ class WidgetRenderingTwig extends \Twig_Extension
|
|||||||
public function getFunctions()
|
public function getFunctions()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new \Twig_SimpleFunction('chill_delegated_block',
|
new TwigFunction('chill_delegated_block',
|
||||||
array($this, 'renderingWidget'),
|
array($this, 'renderingWidget'),
|
||||||
array(
|
array(
|
||||||
'is_safe' => array('html'),
|
'is_safe' => array('html'),
|
||||||
'needs_environment' => true,
|
'needs_environment' => true,
|
||||||
'deprecated' => true, 'alternative' => 'chill_widget'
|
'deprecated' => true, 'alternative' => 'chill_widget'
|
||||||
)),
|
)),
|
||||||
new \Twig_SimpleFunction('chill_widget',
|
new TwigFunction('chill_widget',
|
||||||
array($this, 'renderingWidget'),
|
array($this, 'renderingWidget'),
|
||||||
array('is_safe' => array('html'), 'needs_environment' => true))
|
array('is_safe' => array('html'), 'needs_environment' => true))
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user