<commit_before><?php

namespace Dezull\Bundle\HelpBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;

class HelpTopicType extends AbstractType
{
    protected $container;
    protected $transformers;
    
    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;       
    }

    /**
     * {@inheritDoc}
     */
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('title')
            ->add('category', 'entity', array(
                'class' => 'DezullHelpBundle:HelpCategory',
                'property' => 'name',
            ))
            ->add('content', 'ckeditor', array(
                'transformers'           => array('strip_js', 'strip_css', 'strip_comments', 'strip_tags'),
                'toolbar'                => array('document', 'insert', 'basicstyles', 'styles', 'paragraph'),
                'toolbar_groups'         => array(
                    'document' => array('Source'),
                    'insert' => array('Image'),
                    'styles' => array('Format'),
                ),
                'ui_color'               => '#fff',
                'startup_outline_blocks' => false,
                'width'                  => $options['width'],
                'height'                 => $options['height'],
                'language'               => $options['language'],
                'filebrowser_image_upload_url'   => $options['filebrowser_image_upload_url'],
            ))
        ;
    }

    /**
     * {@inheritdoc}
     */
    public function getDefaultOptions(array $options = array())
    {
        $c = $this->container;

        return array(
            'width' => $c->getParameter('dezull_help.topic.content.width'),
            'height' => $c->getParameter('dezull_help.topic.content.height'),
            'language' => $c->getParameter('dezull_help.topic.content.language'),
            'filebrowser_image_upload_url' => $c->get('router')->generate(
                $c->getParameter('dezull_help.topic.content.filebrowser_image_upload_url')),
        );
    }
<commit_msg>Allow anchor in ckeditor by default<commit_after><?php

namespace Dezull\Bundle\HelpBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;

class HelpTopicType extends AbstractType
{
    protected $container;
    protected $transformers;
    
    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;       
    }

    /**
     * {@inheritDoc}
     */
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('title')
            ->add('category', 'entity', array(
                'class' => 'DezullHelpBundle:HelpCategory',
                'property' => 'name',
            ))
            ->add('content', 'ckeditor', array(
                'transformers'           => array('strip_js', 'strip_css', 'strip_comments', 'strip_tags'),
                'toolbar'                => array('document', 'insert', 'basicstyles', 'styles', 'paragraph', 'links'),
                'toolbar_groups'         => array(
                    'document' => array('Source'),
                    'insert' => array('Image'),
                    'styles' => array('Format'),
                    'links' => array('Link', 'Unlink'),
                ),
                'ui_color'               => '#fff',
                'startup_outline_blocks' => false,
                'width'                  => $options['width'],
                'height'                 => $options['height'],
                'language'               => $options['language'],
                'filebrowser_image_upload_url'   => $options['filebrowser_image_upload_url'],
            ))
        ;
    }

    /**
     * {@inheritdoc}
     */
    public function getDefaultOptions(array $options = array())
    {
        $c = $this->container;

        return array(
            'width' => $c->getParameter('dezull_help.topic.content.width'),
            'height' => $c->getParameter('dezull_help.topic.content.height'),
            'language' => $c->getParameter('dezull_help.topic.content.language'),
            'filebrowser_image_upload_url' => $c->get('router')->generate(
                $c->getParameter('dezull_help.topic.content.filebrowser_image_upload_url')),
        );
    }

{'fraction_non_alphanumeric': 0.1441657579062159, 'fraction_numerical': 0.0, 'mean_word_length': 1.8824638592080452, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 62, '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': '5135508', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1190, 'n_words': 193}