public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if (isset($_POST['_cmfpage_translations_tags_'])) {
         $array_tags = $_POST['_cmfpage_translations_tags_'];
     } else {
         $array_tags = null;
     }
     $format_date = $this->_container->get('sfynx.tool.twig.extension.tool')->getDatePatternByLocalFunction($this->_locale);
     $builder->add('enabled', 'checkbox', array('label' => 'pi.form.label.field.enabled'))->add('secure', 'checkbox', array('label' => 'pi.page.form.secure', 'required' => false))->add('heritage', 'sfynx_security_roles', array('multiple' => true, 'required' => false, 'label' => 'pi.page.form.heritage', "attr" => array("class" => "pi_multiselect")))->add('indexable', 'hidden', array('label' => 'pi.page.form.indexable', 'required' => false))->add('published_at', 'date', array('widget' => 'single_text', 'input' => 'datetime', 'format' => $format_date, "attr" => array("class" => "pi_datepicker"), 'label' => 'pi.form.label.date.publication'))->add('archive_at', 'date', array('widget' => 'single_text', 'input' => 'datetime', 'format' => $format_date, "attr" => array("class" => "pi_datepicker"), 'label' => 'pi.form.label.date.archivage'))->add('langCode', 'entity', array('class' => 'SfynxAuthBundle:Langue', 'query_builder' => function (EntityRepository $er) {
         return $er->getAllLanguages();
     }, 'property' => 'label', "label" => "pi.form.label.field.language", "attr" => array("class" => "pi_simpleselect")))->add('status', 'choice', array('choices' => TranslationPageRepository::getAvailableStatus(), 'label' => 'pi.page.form.status', 'required' => true, 'multiple' => false, 'expanded' => true))->add('tags', 'entity', array('class' => 'SfynxCmfBundle:Tag', 'query_builder' => function (EntityRepository $er) use($array_tags) {
         $translatableListener = $this->_container->get('gedmo.listener.translatable');
         $translatableListener->setTranslationFallback(true);
         return $er->createQueryBuilder('a')->select('a')->where("a.id IN (:id)")->andWhere('a.enabled = 1')->setParameter('id', $array_tags)->orderBy('a.id', 'ASC');
     }, 'empty_value' => 'pi.form.label.select.choose.tag', 'label' => "Tag", 'multiple' => true, 'required' => false, "attr" => array("class" => "pi_multiselect ajaxselect", "data-url" => $this->_container->get('sfynx.tool.route.factory')->getRoute("admin_content_tag_selectentity_ajax"), "data-selectid" => json_encode($array_tags), "data-max" => 40)))->add('breadcrumb', 'hidden', array('label' => 'pi.page.form.breadcrumb', 'required' => false))->add('slug', 'text', array('label' => 'pi.page.form.slug', 'required' => false))->add('meta_title', 'text', array("label" => "pi.form.label.field.meta_title", 'required' => false))->add('meta_keywords', 'text', array("label" => "pi.form.label.field.meta_keywords", 'required' => false))->add('meta_description', 'text', array("label" => "pi.form.label.field.meta_description", 'required' => false));
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('enabled', 'checkbox', array('data' => true, 'label' => 'pi.form.label.field.enabled'))->add('langCode', 'entity', array('class' => 'SfynxAuthBundle:Langue', 'query_builder' => function (EntityRepository $er) {
         return $er->createQueryBuilder('k')->select('k')->where('k.enabled = :enabled')->orderBy('k.label', 'ASC')->setParameter('enabled', 1);
     }, "label" => "pi.form.label.field.language", "attr" => array("class" => "pi_simpleselect")))->add('langStatus', 'choice', array('choices' => TranslationPageRepository::getAvailableLangStatus(), 'required' => true, 'multiple' => false, 'expanded' => true, "attr" => array("class" => "greyarrow")))->add('status', 'choice', array('choices' => TranslationPageRepository::getAvailableStatus(), 'required' => true, 'multiple' => false, 'expanded' => true))->add('texte', 'textarea', array("attr" => array("class" => "pi_editor")));
 }