/**
  * Chargement du template de formulaire.
  *
  * @access protected
  * @return string
  *
  * @author (c) Etienne de Longeaux <*****@*****.**>
  * @since 2012-09-11
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     // we get all entities
     //$listTableClasses = $this->container->get('sfynx.database.db')->listTables('table_class');
     //$listTableClasses = array_combine($listTableClasses, $listTableClasses);
     $ListsAvailableEntities = \Sfynx\CmfBundle\Util\PiWidget\PiGedmoManager::getAvailableOrganigram();
     $ListsAvailableEntities = array_combine(array_keys($ListsAvailableEntities), array_keys($ListsAvailableEntities));
     // we get all slide templates
     $listFiles = $this->container->get('sfynx.tool.file_manager')->ListFilesBundle("/Resources/views/Template/Organigram");
     $listFiles = array_map(function ($value) {
         return basename($value);
     }, array_values($listFiles));
     $listFiles = array_combine($listFiles, $listFiles);
     //
     $css = array();
     // actions
     $actions = array('org-chart-page' => 'Organigram par défault', 'org-tree-semantique' => 'Arbre sémantique');
     // we create the forme
     $builder->add('action', 'choice', array('choices' => $actions, 'required' => true, 'multiple' => false, 'expanded' => false, 'label' => "Action", "label_attr" => array("class" => "select_choice"), "attr" => array("class" => "pi_simpleselect")))->add('template', 'choice', array('choices' => $listFiles, 'multiple' => false, 'required' => true, 'expanded' => false, 'label' => 'pi.form.label.select.choose.template', "attr" => array("class" => "pi_simpleselect")))->add('css', 'choice', array('choices' => $css, 'multiple' => true, 'required' => false, 'expanded' => false, 'label' => 'pi.form.label.select.choose.css', "attr" => array("class" => "pi_multiselect")))->add('table', 'choice', array('choices' => $ListsAvailableEntities, 'multiple' => false, 'required' => true, 'expanded' => false, 'empty_value' => 'Choice a table', "attr" => array("class" => "pi_simpleselect"), "label_attr" => array("class" => "select_choice"), "attr" => array("class" => "pi_simpleselect")))->add('category', 'text', array('required' => false, 'label' => "Catégorie", "label_attr" => array("class" => "text_collection")))->add('node', 'text', array('required' => false, 'label' => "Noeud", "label_attr" => array("class" => "text_collection")))->add('enabled', 'choice', array('choices' => array(1 => 'pi.form.label.field.yes', 0 => 'pi.form.label.field.no'), 'required' => false, 'multiple' => false, 'expanded' => false, 'label' => "Activer", "label_attr" => array("class" => "select_choice"), "attr" => array("class" => "pi_simpleselect")))->add('query_function', 'text', array('required' => false, 'label' => "Nom de la fonction SQL", "label_attr" => array("class" => "text_collection")))->add('organigramsearchfields', 'collection', array('allow_add' => true, 'allow_delete' => true, 'prototype' => true, 'by_reference' => true, 'type' => new PiModelWidgetSearchFieldsType($this->_locale, $this->_container), 'options' => array('attr' => array('class' => 'collection_widget')), 'label' => ' '));
 }
 /**
  * Chargement du template de formulaire.
  *
  * @access protected
  * @return string
  *
  * @author (c) Etienne de Longeaux <*****@*****.**>
  * @since 2012-09-11
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     // we get all entities
     //$listTableClasses = $this->container->get('sfynx.database.db')->listTables('table_class');
     //$listTableClasses = array_combine($listTableClasses, $listTableClasses);
     $ListsAvailableEntities = \Sfynx\CmfBundle\Util\PiWidget\PiGedmoManager::getAvailableSlider();
     $ListsAvailableEntities = array_combine(array_keys($ListsAvailableEntities), array_keys($ListsAvailableEntities));
     // we get all slide templates
     $listFiles = $this->container->get('sfynx.tool.file_manager')->ListFilesBundle("/Resources/views/Template/Slider");
     $listFiles = array_map(function ($value) {
         return basename($value);
     }, array_values($listFiles));
     $listFiles = array_combine($listFiles, $listFiles);
     //
     $action = \PiApp\GedmoBundle\Util\PiJquery\PiFlexSliderManager::$actions;
     $action = array_combine($action, $action);
     //
     $menus = \PiApp\GedmoBundle\Util\PiJquery\PiFlexSliderManager::$menus;
     $menus = array_combine($menus, $menus);
     //
     $css = array("bundles/sfynxtemplate/js/slider/flexslider/css/flexslider_v1.css" => 'Default', "bundles/sfynxtemplate/js/slider/flexslider/css/flexslider_v2.css" => 'Default-2', "bundles/sfynxtemplate/js/slider/flexslider/css/flexslider_v3.css" => 'Default-3');
     // we create the forme
     $builder->add('action', 'choice', array('choices' => $action, 'required' => true, 'multiple' => false, 'expanded' => false, 'label' => "Action", "label_attr" => array("class" => "select_choice"), "attr" => array("class" => "pi_simpleselect")))->add('menu', 'choice', array('choices' => $menus, 'required' => true, 'multiple' => false, 'expanded' => false, 'preferred_choices' => array('entity'), 'label' => "Menu", "label_attr" => array("class" => "select_choice"), "attr" => array("class" => "pi_simpleselect")))->add('template', 'choice', array('choices' => $listFiles, 'multiple' => false, 'required' => true, 'expanded' => false, 'preferred_choices' => array('default.html.twig'), 'label' => 'pi.form.label.select.choose.template', "attr" => array("class" => "pi_simpleselect")))->add('css', 'choice', array('choices' => $css, 'multiple' => true, 'required' => true, 'expanded' => false, 'preferred_choices' => array("bundles/sfynxtemplate/js/slider/flexslider/css/flexslider_v1.css"), 'label' => 'pi.form.label.select.choose.css', "attr" => array("class" => "pi_multiselect")))->add('id', 'text', array('required' => false, 'label' => "Identifiant", "label_attr" => array("class" => "text_collection")))->add('class', 'text', array('required' => false, 'data' => "flexslider", 'label' => "Classe Css", "label_attr" => array("class" => "text_collection"), 'help_block' => 'ex: flexslider'))->add('height', 'text', array('required' => false, 'label' => "Hauteur", "label_attr" => array("class" => "text_collection"), 'help_block' => 'ex: 100px, 95%'))->add('width', 'text', array('required' => false, 'label' => "Largeur", "label_attr" => array("class" => "text_collection"), 'help_block' => 'ex: 100px, 95%'))->add('insert_js', 'choice', array('choices' => array(1 => 'pi.form.label.field.yes', 0 => 'pi.form.label.field.no'), 'required' => true, 'multiple' => false, 'expanded' => false, 'preferred_choices' => array(1), 'label' => "Insérer code JS", "label_attr" => array("class" => "text_collection")))->add('table', 'choice', array('choices' => $ListsAvailableEntities, 'multiple' => false, 'required' => true, 'expanded' => false, 'empty_value' => 'Choice a table', "attr" => array("class" => "pi_simpleselect"), "label_attr" => array("class" => "select_choice"), "attr" => array("class" => "pi_simpleselect")))->add('enabled', 'choice', array('choices' => array(1 => 'pi.form.label.field.yes', 0 => 'pi.form.label.field.no'), 'required' => false, 'multiple' => false, 'expanded' => false, 'label' => "Activer", "label_attr" => array("class" => "select_choice"), "attr" => array("class" => "pi_simpleselect")))->add('orderby_position', 'choice', array('choices' => array('ASC' => 'ASC', 'DESC' => 'DESC'), 'required' => false, 'multiple' => false, 'expanded' => false, 'label' => "Classer par position", "label_attr" => array("class" => "select_choice"), "attr" => array("class" => "pi_simpleselect")))->add('orderby_date', 'choice', array('choices' => array('ASC' => 'ASC', 'DESC' => 'DESC'), 'required' => false, 'multiple' => false, 'expanded' => false, 'label' => "Classer par date de publication", "label_attr" => array("class" => "select_choice"), "attr" => array("class" => "pi_simpleselect")))->add('MaxResults', 'text', array('required' => false, 'label' => "Nbr de resultat Max", "label_attr" => array("class" => "text_collection")))->add('query_function', 'text', array('required' => false, 'label' => "Nom de la fonction SQL", "label_attr" => array("class" => "text_collection")))->add('boucle_array', 'choice', array('choices' => array(1 => 'pi.form.label.field.yes', 0 => 'pi.form.label.field.no'), 'required' => true, 'multiple' => false, 'expanded' => false, 'preferred_choices' => array(0), 'label' => "Résultat boucles sous forme Tableau", "label_attr" => array("class" => "select_choice"), "attr" => array("class" => "pi_simpleselect")))->add('flexsliderparams', 'collection', array('allow_add' => true, 'allow_delete' => true, 'prototype' => true, 'by_reference' => true, 'type' => new PiModelWidgetSlideCollectionType($this->_locale, $this->_container), 'options' => array('attr' => array('class' => 'collection_widget')), 'label' => ' '))->add('flexslidersearchfields', 'collection', array('allow_add' => true, 'allow_delete' => true, 'prototype' => true, 'by_reference' => true, 'type' => new PiModelWidgetSearchFieldsType($this->_locale, $this->_container), 'options' => array('attr' => array('class' => 'collection_widget')), 'label' => ' '));
 }