Skip to content

Commit bd47fbf

Browse files
authored
Merge pull request #245 from etienne-monsieurbiz/feature/link-type
2 parents 168a4c3 + 5e7930a commit bd47fbf

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

src/Form/Type/LinkType.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/*
4+
* This file is part of Monsieur Biz' Rich Editor plugin for Sylius.
5+
*
6+
* (c) Monsieur Biz <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.txt
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace MonsieurBiz\SyliusRichEditorPlugin\Form\Type;
15+
16+
use Symfony\Component\Form\Extension\Core\Type\TextType;
17+
18+
final class LinkType extends TextType
19+
{
20+
/**
21+
* Custom type to identify TextType which need to be considered as a Link.
22+
*/
23+
}

src/Form/Type/UiElement/ButtonLinkType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\AlignmentType;
1717
use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\LevelType;
18+
use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\LinkType;
1819
use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\LinkTypeType;
1920
use Symfony\Component\Form\AbstractType;
20-
use Symfony\Component\Form\Extension\Core\Type\TextType;
2121
use Symfony\Component\Form\Extension\Core\Type\TextType as FormTextType;
2222
use Symfony\Component\Form\FormBuilderInterface;
2323
use Symfony\Component\Validator\Constraints as Assert;
@@ -69,7 +69,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
6969
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.label',
7070
'constraints' => $constraintsLabel,
7171
])
72-
->add('link', TextType::class, [
72+
->add('link', LinkType::class, [
7373
'required' => $required,
7474
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.link',
7575
'constraints' => $constraintsLink,

src/Form/Type/UiElement/ImageType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\ImageType as MediaManagerImageType;
1717
use MonsieurBiz\SyliusRichEditorPlugin\Form\Constraints\RichEditorConstraints;
1818
use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\AlignmentType;
19+
use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\LinkType;
1920
use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\LinkTypeType;
2021
use MonsieurBiz\SyliusRichEditorPlugin\MonsieurBizSyliusRichEditorPlugin;
2122
use Symfony\Component\Form\AbstractType;
2223
use Symfony\Component\Form\Extension\Core\Type\FileType;
2324
use Symfony\Component\Form\Extension\Core\Type\TextType as FormTextType;
24-
use Symfony\Component\Form\Extension\Core\Type\UrlType;
2525
use Symfony\Component\Form\FormBuilderInterface;
2626
use Symfony\Component\Form\FormEvent;
2727
use Symfony\Component\Form\FormEvents;
@@ -58,7 +58,7 @@ public function addFields(FormBuilderInterface $builder, array $options): void
5858
'required' => false,
5959
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.field.title',
6060
])
61-
->add('link', UrlType::class, [
61+
->add('link', LinkType::class, [
6262
'required' => false,
6363
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.field.link',
6464
'constraints' => [

0 commit comments

Comments
 (0)