<commit_before><?php

namespace Opifer\ContentBundle\Block\Service;

use Opifer\CmsBundle\Form\Type\CKEditorType;
use Opifer\ContentBundle\Block\Tool\Tool;
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;
use Symfony\Component\Validator\Constraints\NotBlank;

/**
 * Class JumbotronBlockService
 *
 * @package Opifer\ContentBundle\Block
 */
class JumbotronBlockService extends AbstractBlockService implements BlockServiceInterface, ToolsetMemberInterface
{
    /**
     * {@inheritdoc}
     */
    public function buildManageForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildManageForm($builder, $options);

        $propertiesForm = $builder->get('properties')
            ->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id'],'required' => false])
            ->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes'],'required' => false])
            ->add('autoplay', ChoiceType::class, [
                'choices' => [
                    'No' => false,
                    'Yes' => true,
                ],
                'attr' => [
                    'help_text' => 'help.autoplay'
                ],
            ])
            ->add('loop', ChoiceType::class, [
                'choices' => [
                    'No' => false,
                    'Yes' => true,
                ],
                'attr' => [
                    'help_text' => 'help.loop'
                ],
            ])
        ;

        if ($this->config['styles']) {
            $builder->get('properties')
                ->add('styles', ChoiceType::class, [
                    'label' => 'label.styling',
                    'choices'  => array_flip($this->config['styles']),
                    'required' => false,
                    'expanded' => true,
                    'multiple' => true,
                    'attr' => ['help_text' => 'help.html_styles','tag' => 'styles'],
                ]);
        }

        if (isset($this->config['templates'])) {
            $builder->get('properties')
                ->add('template', ChoiceType::class, [
                    'label'       => 'label.template',
                    'placeholder' => 'placeholder.choice_optional',
                    'attr'        => ['help_text' => 'help.block_template','tag' => 'styles'],
                    'choices'     => array_flip($this->config['templates']),
                    'required'    => false,
                ]);
        }<commit_msg>Revert "Flip array for jumbotron templates"<commit_after><?php

namespace Opifer\ContentBundle\Block\Service;

use Opifer\CmsBundle\Form\Type\CKEditorType;
use Opifer\ContentBundle\Block\Tool\Tool;
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;
use Symfony\Component\Validator\Constraints\NotBlank;

/**
 * Class JumbotronBlockService
 *
 * @package Opifer\ContentBundle\Block
 */
class JumbotronBlockService extends AbstractBlockService implements BlockServiceInterface, ToolsetMemberInterface
{
    /**
     * {@inheritdoc}
     */
    public function buildManageForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildManageForm($builder, $options);

        $propertiesForm = $builder->get('properties')
            ->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id'],'required' => false])
            ->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes'],'required' => false])
            ->add('autoplay', ChoiceType::class, [
                'choices' => [
                    'No' => false,
                    'Yes' => true,
                ],
                'attr' => [
                    'help_text' => 'help.autoplay'
                ],
            ])
            ->add('loop', ChoiceType::class, [
                'choices' => [
                    'No' => false,
                    'Yes' => true,
                ],
                'attr' => [
                    'help_text' => 'help.loop'
                ],
            ])
        ;

        if ($this->config['styles']) {
            $builder->get('properties')
                ->add('styles', ChoiceType::class, [
                    'label' => 'label.styling',
                    'choices'  => $this->config['styles'],
                    'required' => false,
                    'expanded' => true,
                    'multiple' => true,
                    'attr' => ['help_text' => 'help.html_styles','tag' => 'styles'],
                ]);
        }

        if (isset($this->config['templates'])) {
            $builder->get('properties')
                ->add('template', ChoiceType::class, [
                    'label'       => 'label.template',
                    'placeholder' => 'placeholder.choice_optional',
                    'attr'        => ['help_text' => 'help.block_template','tag' => 'styles'],
                    'choices'     => $this->config['templates'],
                    'required'    => false,
                ]);
        }
{'fraction_non_alphanumeric': 0.15117891816920942, 'fraction_numerical': 0.0, 'mean_word_length': 1.898994974874372, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1369018', 'n_tokens_mistral': 1590, 'n_tokens_neox': 1532, 'n_words': 235}