mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 14:24:24 +00:00
remove unused locale and request stack
The locale resolving is delegated to TranslatableStringHelper
This commit is contained in:
parent
9bf7b4ac60
commit
b97a550e2b
@ -45,12 +45,6 @@ class CustomFieldChoice extends AbstractCustomField
|
|||||||
const MULTIPLE = 'multiple';
|
const MULTIPLE = 'multiple';
|
||||||
const EXPANDED = 'expanded';
|
const EXPANDED = 'expanded';
|
||||||
const CHOICES = 'choices';
|
const CHOICES = 'choices';
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @var RequestStack
|
|
||||||
*/
|
|
||||||
private $requestStack;
|
|
||||||
|
|
||||||
private $defaultLocales;
|
private $defaultLocales;
|
||||||
|
|
||||||
@ -66,12 +60,10 @@ class CustomFieldChoice extends AbstractCustomField
|
|||||||
private $translatableStringHelper;
|
private $translatableStringHelper;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
RequestStack $requestStack,
|
|
||||||
Translator $translator,
|
Translator $translator,
|
||||||
TwigEngine $templating,
|
TwigEngine $templating,
|
||||||
TranslatableStringHelper $translatableStringHelper)
|
TranslatableStringHelper $translatableStringHelper)
|
||||||
{
|
{
|
||||||
$this->requestStack = $requestStack;
|
|
||||||
$this->defaultLocales = $translator->getFallbackLocales();
|
$this->defaultLocales = $translator->getFallbackLocales();
|
||||||
$this->templating = $templating;
|
$this->templating = $templating;
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
@ -80,7 +72,6 @@ class CustomFieldChoice extends AbstractCustomField
|
|||||||
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
|
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
|
||||||
{
|
{
|
||||||
//prepare choices
|
//prepare choices
|
||||||
$locale = $this->requestStack->getCurrentRequest()->getLocale();
|
|
||||||
$choices = array();
|
$choices = array();
|
||||||
$customFieldOptions = $customField->getOptions();
|
$customFieldOptions = $customField->getOptions();
|
||||||
|
|
||||||
|
@ -61,7 +61,6 @@ services:
|
|||||||
chill.custom_field.choice:
|
chill.custom_field.choice:
|
||||||
class: Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice
|
class: Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice
|
||||||
arguments:
|
arguments:
|
||||||
- "@request_stack"
|
|
||||||
- "@translator.default"
|
- "@translator.default"
|
||||||
- "@templating"
|
- "@templating"
|
||||||
- "@chill.main.helper.translatable_string"
|
- "@chill.main.helper.translatable_string"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user