Permalink
Browse files

Fixed Form deprecations

  • Loading branch information...
rvanlaarhoven committed Jan 29, 2016
1 parent 88ec657 commit 21970f38fb38f40e6368f793ae6493246dba6fc1
Showing with 256 additions and 276 deletions.
  1. +1 −1 Block/BlockManager.php
  2. +1 −1 Block/RevertVisitor.php
  3. +4 −4 Block/Service/AbstractBlockService.php
  4. +1 −1 Block/Service/BlockServiceInterface.php
  5. +16 −19 Block/Service/ButtonBlockService.php
  6. +8 −5 Block/Service/CarouselSlideBlockService.php
  7. +14 −9 Block/Service/ColumnBlockService.php
  8. +14 −15 Block/Service/ContainerBlockService.php
  9. +9 −6 Block/Service/HtmlBlockService.php
  10. +1 −1 Block/Service/ImageBlockService.php
  11. +10 −6 Block/Service/JumbotronBlockService.php
  12. +6 −4 Block/Service/ListBlockService.php
  13. +2 −1 Block/Service/NavigationBlockService.php
  14. +6 −4 Block/Service/PointerBlockService.php
  15. +12 −10 Block/Service/SectionBlockService.php
  16. +2 −2 Controller/Api/ContentController.php
  17. +4 −4 Controller/Api/ContentEditorController.php
  18. +3 −3 Controller/Backend/ContentEditorController.php
  19. +3 −3 Controller/Backend/FormTypeController.php
  20. +5 −5 Controller/Backend/TemplateController.php
  21. +3 −3 Controller/Frontend/ContentController.php
  22. +1 −1 DependencyInjection/Compiler/BlockCompilerPass.php
  23. +1 −1 Designer/TemplateSuite.php
  24. +4 −4 Entity/Block.php
  25. +2 −2 Entity/BlockLogEntry.php
  26. +1 −1 Entity/ButtonBlock.php
  27. +1 −1 Entity/CarouselBlock.php
  28. +1 −1 Entity/CarouselSlideBlock.php
  29. +1 −1 Entity/CollectionBlock.php
  30. +1 −1 Entity/ContentListValue.php
  31. +1 −1 Entity/HtmlBlock.php
  32. +1 −1 Entity/ImageBlock.php
  33. +1 −1 Entity/JumbotronBlock.php
  34. +1 −1 Entity/ListBlock.php
  35. +1 −1 Entity/NavigationBlock.php
  36. +1 −1 Entity/SectionBlock.php
  37. +2 −2 Entity/Template.php
  38. +1 −1 Environment/ContentEnvironment.php
  39. +2 −2 Environment/Environment.php
  40. +1 −1 EventListener/BlockListener.php
  41. +1 −1 Form/DataTransformer/SlugTransformer.php
  42. +5 −6 Form/Type/BlockAdapterFormType.php
  43. +2 −2 Form/Type/ColumnEnumType.php
  44. +8 −16 Form/Type/ColumnGutterType.php
  45. +1 −1 Form/Type/ContentEditorType.php
  46. +0 −10 Form/Type/ContentListPickerType.php
  47. +3 −13 Form/Type/ContentPickerType.php
  48. +24 −17 Form/Type/ContentType.php
  49. +2 −2 Form/Type/ContentTypeType.php
  50. +7 −6 Form/Type/GutterCollectionType.php
  51. +5 −6 Form/Type/SpanCollectionType.php
  52. +6 −26 Form/Type/TemplateType.php
  53. +2 −2 Handler/AliasHandler.php
  54. +3 −3 Handler/SlugHandler.php
  55. +4 −4 Model/Content.php
  56. +4 −4 Model/ContentManager.php
  57. +2 −2 OpiferContentBundle.php
  58. +6 −5 Resources/config/services.yml
  59. +7 −7 Router/ContentRouter.php
  60. +1 −1 Tests/Router/ContentRouterTest.php
  61. +5 −5 Twig/ContentExtension.php
  62. +5 −3 ValueProvider/ContentListValueProvider.php
  63. +3 −2 ValueProvider/ContentValueProvider.php
View
@@ -3,10 +3,10 @@
namespace Opifer\ContentBundle\Block;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface;
use Gedmo\SoftDeleteable\SoftDeleteableListener;
use Opifer\CmsBundle\EventListener\LoggableListener;
use Opifer\ContentBundle\Block\Service\BlockServiceInterface;
use Doctrine\ORM\EntityManagerInterface;
use Opifer\ContentBundle\Block\Tool\ContentTool;
use Opifer\ContentBundle\Block\Tool\ToolsetMemberInterface;
use Opifer\ContentBundle\Entity\PointerBlock;
View
@@ -2,8 +2,8 @@
namespace Opifer\ContentBundle\Block;
use Opifer\ContentBundle\Model\BlockInterface;
use Opifer\ContentBundle\Block\BlockManager;
use Opifer\ContentBundle\Model\BlockInterface;
/**
* Class RevertVisitor
@@ -4,14 +4,14 @@
use Opifer\ContentBundle\Entity\Block;
use Opifer\ContentBundle\Environment\Environment;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
use Opifer\ContentBundle\Model\BlockInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* Class AbstractBlockService
@@ -3,9 +3,9 @@
namespace Opifer\ContentBundle\Block\Service;
use Opifer\ContentBundle\Model\BlockInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Form\FormBuilderInterface;
/**
* Interface BlockServiceInterface
@@ -6,6 +6,9 @@
use Opifer\ContentBundle\Block\Tool\ToolsetMemberInterface;
use Opifer\ContentBundle\Entity\ButtonBlock;
use Opifer\ContentBundle\Model\BlockInterface;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
/**
@@ -20,23 +23,19 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
{
parent::buildManageForm($builder, $options);
$propertiesForm = $builder->create('properties', 'form')
->add('url', 'text', ['label' => 'label.url'])
->add(
'target',
'choice',
[
'label' => 'label.target',
'choices' => ['_blank' => '_blank', '_self' => '_self'],
'required' => false,
]
)
->add('id', 'text', ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', 'text', ['attr' => ['help_text' => 'help.extra_classes']]);
$propertiesForm = $builder->create('properties', FormType::class)
->add('url', TextType::class, ['label' => 'label.url'])
->add('target', ChoiceType::class, [
'label' => 'label.target',
'choices' => ['_blank' => '_blank', '_self' => '_self'],
'required' => false,
])
->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
if ($this->config['styles']) {
$propertiesForm->add('styles', 'choice', [
$propertiesForm->add('styles', ChoiceType::class, [
'label' => 'label.styling',
'choices' => array_combine($this->config['styles'], $this->config['styles']),
'required' => false,
@@ -46,8 +45,8 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
}
$builder->add(
$builder->create('default', 'form', ['inherit_data' => true])
->add('value', 'text', ['label' => 'label.label'])
$builder->create('default', FormType::class, ['inherit_data' => true])
->add('value', TextType::class, ['label' => 'label.label'])
)->add(
$propertiesForm
);
@@ -81,6 +80,4 @@ public function getTool()
return $tool;
}
}
}
@@ -2,11 +2,14 @@
namespace Opifer\ContentBundle\Block\Service;
use Opifer\CmsBundle\Form\Type\CKEditorType;
use Opifer\ContentBundle\Block\Tool\ContentTool;
use Opifer\ContentBundle\Block\Tool\ToolsetMemberInterface;
use Opifer\ContentBundle\Entity\CarouselSlideBlock;
use Opifer\ContentBundle\Model\BlockInterface;
use Opifer\MediaBundle\Form\Type\MediaPickerType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
/**
@@ -21,9 +24,9 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
{
parent::buildManageForm($builder, $options);
$propertiesForm = $builder->create('properties', 'form')
->add('id', 'text', ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', 'text', ['attr' => ['help_text' => 'help.extra_classes']]);
$propertiesForm = $builder->create('properties', FormType::class)
->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
if ($this->config['styles']) {
@@ -40,12 +43,12 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
}
$builder->add(
$builder->create('default', 'form', ['inherit_data' => true])
$builder->create('default', FormType::class, ['inherit_data' => true])
->add('media', MediaPickerType::class, [
'required' => false,
'multiple' => false,
])
->add('value', 'ckeditor', ['label' => 'label.rich_text', 'attr' => ['label_col' => 12, 'widget_col' => 12]])
->add('value', CKEditorType::class, ['label' => 'label.rich_text', 'attr' => ['label_col' => 12, 'widget_col' => 12]])
)->add(
$propertiesForm
);
@@ -4,13 +4,18 @@
use Opifer\ContentBundle\Block\Tool\ColumnTool;
use Opifer\ContentBundle\Block\Tool\ToolsetMemberInterface;
use Opifer\ContentBundle\Entity\ColumnBlock;
use Opifer\ContentBundle\Form\Type\GutterCollectionType;
use Opifer\ContentBundle\Form\Type\SpanCollectionType;
use Opifer\ContentBundle\Model\BlockInterface;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\HttpFoundation\Response;
use Opifer\ContentBundle\Entity\ColumnBlock;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
/**
* Class ColumnBlockService
@@ -59,9 +64,9 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
{
parent::buildManageForm($builder, $options);
$propertiesForm = $builder->create('properties', 'form')
->add('id', 'text', ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', 'text', ['attr' => ['help_text' => 'help.extra_classes']]);
$propertiesForm = $builder->create('properties', FormType::class)
->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
$builder->add($propertiesForm);
@@ -82,7 +87,7 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
}
$styles = ['row-space-top-2', 'row-space-top-4', 'row-space-top-8', 'row-space-2', 'row-space-4', 'row-space-8'];
$form->get('properties')->add('styles', 'choice', [
$form->get('properties')->add('styles', ChoiceType::class, [
'label' => 'label.styling',
'choices' => $styles,
'required' => false,
@@ -92,8 +97,8 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
]);
$form->get('properties')->add('spans', 'span_collection', ['column_count' => $block->getColumnCount(), 'label' => 'label.spans', 'attr' => ['help_text' => 'help.column_spans']]);
$form->get('properties')->add('gutters', 'gutter_collection', ['column_count' => $block->getColumnCount(), 'label' => 'label.gutters', 'attr' => ['help_text' => 'help.column_gutters']]);
$form->get('properties')->add('spans', SpanCollectionType::class, ['column_count' => $block->getColumnCount(), 'label' => 'label.spans', 'attr' => ['help_text' => 'help.column_spans']]);
$form->get('properties')->add('gutters', GutterCollectionType::class, ['column_count' => $block->getColumnCount(), 'label' => 'label.gutters', 'attr' => ['help_text' => 'help.column_gutters']]);
});
}
@@ -5,9 +5,12 @@
use Opifer\ContentBundle\Block\Tool\ContainerTool;
use Opifer\ContentBundle\Block\Tool\ToolsetMemberInterface;
use Opifer\ContentBundle\Entity\ContainerBlock;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
/**
* Class ColumnBlockService
@@ -25,9 +28,9 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
parent::buildManageForm($builder, $options);
$propertiesForm = $builder->create('properties', 'form')
->add('id', 'text', ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', 'text', ['attr' => ['help_text' => 'help.extra_classes']]);
$propertiesForm = $builder->create('properties', FormType::class)
->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
$builder->add($propertiesForm);
@@ -36,7 +39,7 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
$form = $event->getForm();
$form->get('properties')->add('styles', 'choice', [
$form->get('properties')->add('styles', ChoiceType::class, [
'label' => 'label.styling',
'choices' => $this->config['styles'],
'required' => false,
@@ -45,16 +48,12 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
'attr' => ['help_text' => 'help.html_styles'],
]);
$form->get('properties')->add(
'container_size',
'choice',
[
'label' => 'label.container_sizing',
'choices' => ['fluid' => 'label.container_fluid', '' => 'label.container_fixed', 'smooth' => 'label.container_smooth'],
'required' => true,
'attr' => ['help_text' => 'help.container_sizing'],
]
);
$form->get('properties')->add('container_size', ChoiceType::class, [
'label' => 'label.container_sizing',
'choices' => ['fluid' => 'label.container_fluid', '' => 'label.container_fixed', 'smooth' => 'label.container_smooth'],
'required' => true,
'attr' => ['help_text' => 'help.container_sizing'],
]);
});
}
@@ -2,11 +2,14 @@
namespace Opifer\ContentBundle\Block\Service;
use Opifer\CmsBundle\Form\Type\CKEditorType;
use Opifer\ContentBundle\Block\Tool\ContentTool;
use Opifer\ContentBundle\Block\Tool\ToolsetMemberInterface;
use Opifer\ContentBundle\Entity\HtmlBlock;
use Symfony\Component\Form\FormBuilderInterface;
use Opifer\ContentBundle\Model\BlockInterface;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
/**
* HTML Block Service
@@ -22,12 +25,12 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
// Default panel
$builder->add(
$builder->create('default', 'form', ['inherit_data' => true])
->add('value', 'ckeditor', ['label' => 'label.rich_text', 'attr' => ['label_col' => 12, 'widget_col' => 12]])
$builder->create('default', FormType::class, ['inherit_data' => true])
->add('value', CKEditorType::class, ['label' => 'label.rich_text', 'attr' => ['label_col' => 12, 'widget_col' => 12]])
)->add(
$builder->create('properties', 'form')
->add('id', 'text', ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', 'text', ['attr' => ['help_text' => 'help.extra_classes']])
$builder->create('properties', FormType::class)
->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']])
);
}
@@ -57,7 +57,7 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
'attr' => array('label_col' => 12, 'widget_col' => 12),
])
)->add(
$builder->create('properties', 'form')
$builder->create('properties', FormType::class)
->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']])
->add('filter', ChoiceType::class, [
@@ -2,11 +2,15 @@
namespace Opifer\ContentBundle\Block\Service;
use Opifer\CmsBundle\Form\Type\CKEditorType;
use Opifer\ContentBundle\Block\Tool\ContentTool;
use Opifer\ContentBundle\Block\Tool\ToolsetMemberInterface;
use Opifer\ContentBundle\Entity\JumbotronBlock;
use Opifer\ContentBundle\Model\BlockInterface;
use Opifer\MediaBundle\Form\Type\MediaPickerType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
/**
@@ -23,15 +27,15 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
{
parent::buildManageForm($builder, $options);
$propertiesForm = $builder->create('properties', 'form')
->add('id', 'text', ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', 'text', ['attr' => ['help_text' => 'help.extra_classes']]);
$propertiesForm = $builder->create('properties', FormType::class)
->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])
->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
if ($this->config['styles']) {
$propertiesForm
->add('styles', 'choice', [
->add('styles', ChoiceType::class, [
'label' => 'label.styling',
'choices' => $this->config['styles'],
'required' => false,
@@ -42,13 +46,13 @@ public function buildManageForm(FormBuilderInterface $builder, array $options)
}
$builder->add(
$builder->create('default', 'form', ['inherit_data' => true])
$builder->create('default', FormType::class, ['inherit_data' => true])
->add('media', MediaPickerType::class, [
'required' => false,
'multiple' => false,
'attr' => array('label_col' => 12, 'widget_col' => 12),
])
->add('value', 'ckeditor', ['label' => 'label.rich_text', 'attr' => ['label_col' => 12, 'widget_col' => 12]])
->add('value', CKEditorType::class, ['label' => 'label.rich_text', 'attr' => ['label_col' => 12, 'widget_col' => 12]])
)->add(
$propertiesForm
);
Oops, something went wrong.

0 comments on commit 21970f3

Please sign in to comment.