Unverified Commit afa1cd7f authored by Sebastian Castro's avatar Sebastian Castro
Browse files

Fix sonata basics after upgrade

parent eb8f6a6a
......@@ -68,10 +68,7 @@ twig:
"%kernel.root_dir%/../web": RootDir
"%kernel.root_dir%/../src/Biopen/SaasBundle/Resources/views": BiopenSaasBundle
form_themes:
- 'SonataFormatterBundle:Form:formatter.html.twig'
# form:
# resources:
# - 'SonataFormatterBundle:Form:formatter.html.twig'
- '@SonataFormatter/Form/formatter.html.twig'
# Doctrine Configuration
doctrine:
......
......@@ -16,7 +16,7 @@ sonata_doctrine_mongo_db_admin:
- "@BiopenAdmin/core_custom/form_admin_fields.html.twig"
sonata_formatter:
default_formatter: "text"
default_formatter: text
formatters:
markdown:
service: sonata.formatter.text.markdown
......
......@@ -43,7 +43,7 @@ file that was distributed with this source code.
{% set firstRole = roles_group|first %}
{% if 'ROLE_ADMIN_' in firstRole.label or 'ROLE_SONATA_USER_ADMIN_' in firstRole.label %}
{% set title = firstRole.label|split('ROLE_ADMIN_')|last|split('ROLE_SONATA_USER_ADMIN_')|last %}
{% set title = title|replace('_', ' ')|slice(0,-5) %}
{% set title = title|replace({'_': ' '})|slice(0,-5) %}
{% set hidden = 'HIDDEN' in title %}
{% if title in ["GENERAL CONFIG", "ELEMENTS", "PROJECT"]%}<hr>{% endif %}
......
......@@ -12,6 +12,7 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\FormatterBundle\Form\Type\SimpleFormatterType;
class AboutAdmin extends AbstractAdmin
{
......@@ -24,7 +25,7 @@ class AboutAdmin extends AbstractAdmin
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper->add('name', 'text');
$formMapper->add('content', 'sonata_simple_formatter_type', array(
$formMapper->add('content', SimpleFormatterType::class, array(
'format' => 'richhtml', 'ckeditor_context' => 'full'
));
}
......
......@@ -12,6 +12,7 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\FormatterBundle\Form\Type\SimpleFormatterType;
class AutomatedMailConfigurationAdmin extends AbstractAdmin
{
......@@ -20,10 +21,10 @@ class AutomatedMailConfigurationAdmin extends AbstractAdmin
$formMapper
->add('active', null, ['required'=>false, 'label' => "Activé"])
->add('subject', null, ['required'=>false, 'label' => "Objet du message"])
->add('content', 'sonata_simple_formatter_type', array(
->add('content', SimpleFormatterType::class, array(
'format' => 'richhtml',
'ckeditor_context' => 'full',
'required'=>false,
'required'=>false,
'label' => "Contenu du message"
));
}
......
......@@ -12,6 +12,7 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Form\Type\ModelType;
class ConfigurationAdmin extends ConfigurationAbstractAdmin
{
......@@ -38,16 +39,16 @@ class ConfigurationAdmin extends ConfigurationAbstractAdmin
$formMapper
->with('Le site', array('class' => 'col-md-6', "description" => '<div class="iframe-container"><iframe height="110" sandbox="allow-same-origin allow-scripts" src="https://video.colibris-outilslibres.org/videos/embed/fc7d3784-7bd1-4f3a-b915-ab6daefdd52d" frameborder="0" allowfullscreen></iframe></div>'))
->add('appName', null, array('label' => 'Nom du site'))
->add('appNameShort', null, array('label' => 'Nom Court (utilisé par les téléphones)', 'required' => false, 'max_length' => 12))
->add('appNameShort', null, array('label' => 'Nom Court (utilisé par les téléphones, 12 caractères max.)', 'required' => false))
->add('appBaseline', null, array('label' => 'Description du site (baseline)','required' => false))
->add('appTags', null, array('label' => 'Mot clés pour le référencement (séparés par une virgule)', 'required' => false))
->add('dataLicenseUrl', null, array('label' => 'Url de la licence qui protège vos données', 'required' => false))
->end()
->with('Images générales', array('class' => 'col-md-6'))
->add('logo', 'sonata_type_model', $imagesOptions)
->add('logoInline', 'sonata_type_model', array_replace($imagesOptions,['label' => 'Logo pour la barre de menu']))
->add('socialShareImage', 'sonata_type_model', array_replace($imagesOptions,['label' => "Image à afficher lors d'un partage sur les réseaux sociaux"]))
->add('favicon', 'sonata_type_model', array_replace($imagesOptions,['label' => 'Favicon']))
->add('logo', ModelType::class, $imagesOptions)
->add('logoInline', ModelType::class, array_replace($imagesOptions,['label' => 'Logo pour la barre de menu']))
->add('socialShareImage', ModelType::class, array_replace($imagesOptions,['label' => "Image à afficher lors d'un partage sur les réseaux sociaux"]))
->add('favicon', ModelType::class, array_replace($imagesOptions,['label' => 'Favicon']))
->end()
->with('Fonctions principales', array('class' => 'col-md-6'))
->add('activateHomePage', null, array('label' => "Activer la page d'accueil", 'required' => false))
......
......@@ -12,6 +12,7 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\FormatterBundle\Form\Type\SimpleFormatterType;
class ConfigurationContributionsAdmin extends ConfigurationAbstractAdmin
{
......@@ -44,7 +45,7 @@ class ConfigurationContributionsAdmin extends ConfigurationAbstractAdmin
->add('minVoteToForceChangeStatus', null, ['required'=>false, 'label' => "Nombre votes pour valider/refuser automatiquement, sans attendre de jours minimum"])
->end()
->with('Textes')
->add('collaborativeModerationExplanations', 'sonata_simple_formatter_type', array(
->add('collaborativeModerationExplanations', SimpleFormatterType::class, array(
'format' => 'richhtml',
'label' => 'Explications au sujet de la modération collaborative',
'ckeditor_context' => 'full',
......
......@@ -12,6 +12,7 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Form\Type\ModelType;
class ConfigurationHomeAdmin extends ConfigurationAbstractAdmin
{
......@@ -24,7 +25,7 @@ class ConfigurationHomeAdmin extends ConfigurationAbstractAdmin
$imagesOptions = array(
'class'=> 'Biopen\CoreBundle\Document\ConfImage',
'placeholder' => "Séléctionnez une image déjà importée, ou ajoutez en une !",
'required' => false,
'required' => false,
'choices_as_values' => true,
'label' => 'Logo',
'mapped' => true
......@@ -37,7 +38,7 @@ class ConfigurationHomeAdmin extends ConfigurationAbstractAdmin
$featureFormTypeOption = ['edit' => 'inline'];
$formMapper
->add('activateHomePage', null, array('label' => "Activer la page d'accueil", 'required' => false))
->add('backgroundImage', 'sonata_type_model', array_replace($imagesOptions,['label' => 'Image de fond (le nom du fichier ne doit pas contenir d\'espaces ou de caractères spéciaux']))
->add('backgroundImage', ModelType::class, array_replace($imagesOptions,['label' => 'Image de fond (le nom du fichier ne doit pas contenir d\'espaces ou de caractères spéciaux']))
->add('home.displayCategoriesToPick', 'checkbox', array('label' => "Afficher les catégories principales selectionnables pour la recherche", 'required' => false))
->add('home.addElementHintText', 'text', array('label' => "Texte au dessus du bouton \"Ajouter un élément\"", 'required' => false, 'attr' => ['placeholder' => "Exemple: Aidez nous à renrichir la base de donnée en ajoutant un élément !"]))
->add('home.seeMoreButtonText', 'text', array('label' => "Texte pour inviter à scroller (si des bandeaux de la page d'accueil existent)", 'required' => false, 'attr' => ['placeholder' => "Exemple: Plus d'informations"]))
......
......@@ -12,6 +12,8 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\FormatterBundle\Form\Type\SimpleFormatterType;
use Sonata\AdminBundle\Form\Type\ModelType;
class ConfigurationMapAdmin extends ConfigurationAbstractAdmin
{
......@@ -31,7 +33,7 @@ class ConfigurationMapAdmin extends ConfigurationAbstractAdmin
$formMapper
->tab('Paramètres de la carte')
->with('La carte')
->add('defaultTileLayer', 'sonata_type_model', array(
->add('defaultTileLayer', ModelType::class, array(
'class'=> 'Biopen\CoreBundle\Document\TileLayer',
'required' => true,
'choices_as_values' => true,
......@@ -87,7 +89,7 @@ class ConfigurationMapAdmin extends ConfigurationAbstractAdmin
->tab('Message personnalisé')
->with('Message personnalisé à faire apparaitre dans un coin de la carte', ['class' => 'gogo-feature'])
->add('customPopupFeature','sonata_type_admin', $featureFormOption, $featureFormTypeOption)
->add('customPopupText', 'sonata_simple_formatter_type', array(
->add('customPopupText', SimpleFormatterType::class, array(
'format' => 'richhtml',
'label' => 'Texte à afficher (Exemple: "Ce site est encore en version bêta !")',
'label_attr' => ['style' => 'margin-top: 20px'],
......
......@@ -12,16 +12,17 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
class FeatureConfigurationAdmin extends AbstractAdmin
{
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('active', null, ['required'=>false, 'label' => "Activé"])
->add('activeInIframe', null, ['required'=>false, 'label' => "Activé en Iframe"])
->add('allow_role_anonymous', null, ['required'=>false, 'label' => "Autoriser Anonymes"])
->add('allow_role_user', null, ['required'=>false, 'label' => "Autoriser Utilisateurs"])
->add('allow_role_admin', null, ['required'=>false, 'label' => "Autoriser Modérateurs"]);
->add('active', CheckboxType::class, ['required'=>false, 'label' => "Activé"])
->add('activeInIframe', CheckboxType::class, ['required'=>false, 'label' => "Activé en Iframe"])
->add('allow_role_anonymous', CheckboxType::class, ['required'=>false, 'label' => "Autoriser Anonymes"])
->add('allow_role_user', CheckboxType::class, ['required'=>false, 'label' => "Autoriser Utilisateurs"])
->add('allow_role_admin', CheckboxType::class, ['required'=>false, 'label' => "Autoriser Modérateurs"]);
}
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Biopen\CoreBundle\Admin\FeatureConfigurationAdmin;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
class InteractionConfigurationAdmin extends FeatureConfigurationAdmin
{
......@@ -20,6 +21,6 @@ class InteractionConfigurationAdmin extends FeatureConfigurationAdmin
{
parent::configureFormFields($formMapper);
$formMapper
->add('allow_role_anonymous_with_mail', null, ['required'=>false, 'label' => "Autoriser Anonymes avec Mail"]);
->add('allow_role_anonymous_with_mail', CheckboxType::class, ['required'=>false, 'label' => "Autoriser Anonymes avec Mail"]);
}
}
\ No newline at end of file
......@@ -12,6 +12,8 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\FormatterBundle\Form\Type\SimpleFormatterType;
use Sonata\AdminBundle\Form\Type\ModelType;
class PartnerAdmin extends AbstractAdmin
{
......@@ -25,13 +27,13 @@ class PartnerAdmin extends AbstractAdmin
{
$formMapper
->add('name', 'text', ['required' => false])
->add('content', 'sonata_simple_formatter_type', array(
->add('content', SimpleFormatterType::class, array(
'format' => 'richhtml', 'required' => false, 'ckeditor_context' => 'full',
))
->add('logo', 'sonata_type_model', array(
'class'=> 'Biopen\CoreBundle\Document\PartnerImage',
->add('logo', ModelType::class, array(
'class'=> 'Biopen\CoreBundle\Document\PartnerImage',
'placeholder' => "Séléctionnez une image déjà importée, ou ajoutez en une !",
'required' => false,
'required' => false,
'choices_as_values' => true,
'label' => 'Logo',
'mapped' => true))
......
......@@ -17,6 +17,8 @@ use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\AdminBundle\Form\Type\ModelType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
class UserAdmin extends AbstractAdmin
{
......@@ -114,7 +116,7 @@ class UserAdmin extends AbstractAdmin
$filterMapper
->add('id')
->add('username')
->add('locked')
// ->add('locked')
->add('newsletterFrequency', 'doctrine_mongo_callback', array(
'label' => 'Reception newsletter',
'field_type' => 'checkbox',
......@@ -191,7 +193,7 @@ class UserAdmin extends AbstractAdmin
$userGenderType = 'sonata_user_gender';
$localeType = 'locale';
$timezoneType = 'timezone';
$modelType = 'sonata_type_model';
$modelType = ModelType::class;
$securityRolesType = 'sonata_security_roles';
$formMapper
......@@ -210,10 +212,10 @@ class UserAdmin extends AbstractAdmin
))
->end()
->with('Status')
->add('locked', null, array('required' => false))
->add('expired', null, array('required' => false))
->add('enabled', null, array('required' => false))
->add('credentialsExpired', null, array('required' => false))
->add('locked', CheckboxType::class, array('required' => false))
->add('expired', CheckboxType::class, array('required' => false))
->add('enabled', CheckboxType::class, array('required' => false))
->add('credentialsExpired', CheckboxType::class, array('required' => false))
->end()
->with('Groups')
->add('groups', $modelType, array(
......
......@@ -12,6 +12,7 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\FormatterBundle\Form\Type\SimpleFormatterType;
class WrapperAdmin extends AbstractAdmin
{
......@@ -24,7 +25,7 @@ class WrapperAdmin extends AbstractAdmin
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper->add('title', 'text');
$formMapper->add('content', 'sonata_simple_formatter_type', array(
$formMapper->add('content', SimpleFormatterType::class, array(
'format' => 'richhtml',
'label' => 'Contenu du bandeau',
'required' => false,
......
......@@ -450,6 +450,18 @@ class User extends BaseUser
return $this->enabled;
}
/**
* Set Enabled
*
* @param boolean $salt
* @return $this
*/
public function setEnabled($enabled)
{
$this->enabled = $enabled;
return $this;
}
/**
* Set salt
*
......@@ -472,6 +484,18 @@ class User extends BaseUser
return $this->locked;
}
/**
* Set Locked
*
* @param boolean $salt
* @return $this
*/
public function setLocked($locked)
{
$this->locked = $locked;
return $this;
}
/**
* Get expired
*
......@@ -482,6 +506,18 @@ class User extends BaseUser
return $this->expired;
}
/**
* Set Expired
*
* @param boolean $salt
* @return $this
*/
public function setExpired($expired)
{
$this->expired = $expired;
return $this;
}
/**
* Get credentialsExpired
*
......@@ -492,6 +528,19 @@ class User extends BaseUser
return $this->credentialsExpired;
}
/**
* Set CredentialsExpired
*
* @param boolean $salt
* @return $this
*/
public function setCredentialsExpired($credentialsExpired)
{
$this->credentialsExpired = $credentialsExpired;
return $this;
}
/**
* Set contributionsCount
*
......
......@@ -17,6 +17,8 @@ use Biopen\GeoDirectoryBundle\Document\CategoryStatus;
use Biopen\GeoDirectoryBundle\Document\ModerationState;
use Sonata\AdminBundle\Admin\AdminInterface;
use Knp\Menu\ItemInterface;
use Sonata\AdminBundle\Form\Type\ModelType;
use Sonata\AdminBundle\Form\Type\CollectionType;
class CategoryAdmin extends AbstractAdmin
{
......@@ -50,7 +52,7 @@ class CategoryAdmin extends AbstractAdmin
->with('Paramètres principaux', array('class' => 'col-xs-12 col-md-6'))
->add('name', null, array('required' => true, 'label' => 'Nom du groupe'))
->add('pickingOptionText', null, array('required' => true, 'label' => 'Texte à afficher dans le formulaire : Choisissez ....'))
->add('parent', 'sonata_type_model', array(
->add('parent', ModelType::class, array(
'class'=> 'Biopen\GeoDirectoryBundle\Document\Option',
'required' => false,
'query' => $parentQuery,
......@@ -72,16 +74,17 @@ class CategoryAdmin extends AbstractAdmin
->add('displayInInfoBar', null, array('required' => false, 'label' => "Dans la fiche détail", 'label_attr' => ['title'=>"Le nom du groupe ne sera pas affiché, mais les catégories le seront"]))
->add('displayInForm', null, array('required' => false, 'label' => "Dans le formulaire", 'label_attr' => ['title'=>"Ni le groupe ni les catégories ne seront affichés dans le formulaire"]))
->end()
->with('Catégories contenues dans ce groupe', array('class' => 'col-xs-12 sub-options-container'))
->add('isFixture', 'text', ['attr' => ['class' => 'gogo-sort-options'], 'label_attr' => ['style' => 'display:none']])
->add('options', 'sonata_type_collection', array('by_reference' => false, 'type_options' => array('delete' => false), 'label_attr'=> ['style'=> 'display:none']), array(
'edit' => 'inline',
'inline' => 'table',
'label' => '',
'admin_code' => 'admin.option.lite_hidden',
//'sortable' => 'index',
))
->end();
// ->with('Catégories contenues dans ce groupe', array('class' => 'col-xs-12 sub-options-container'))
// ->add('isFixture', 'text', ['attr' => ['class' => 'gogo-sort-options'], 'label_attr' => ['style' => 'display:none']])
// ->add('options', CollectionType::class, array('by_reference' => false, 'allow_add' => true, 'label_attr'=> ['style'=> 'display:none']), array(
// 'edit' => 'inline',
// 'inline' => 'table',
// 'label' => '',
// 'admin_code' => 'admin.option.lite_hidden',
// //'sortable' => 'index',
// ))
// ->end()
;
}
protected function configureListFields(ListMapper $listMapper)
......
......@@ -16,6 +16,7 @@ use Sonata\AdminBundle\Show\ShowMapper;
use Biopen\GeoDirectoryBundle\Document\ElementStatus;
use Biopen\GeoDirectoryBundle\Document\ModerationState;
use Vich\UploaderBundle\Form\Type\VichImageType;
use Sonata\AdminBundle\Form\Type\ModelType;
class ElementAdminShowEdit extends ElementAdminList
{
......@@ -27,7 +28,7 @@ class ElementAdminShowEdit extends ElementAdminList
->add('userOwnerEmail', 'text', array('required' => false, 'label' => "Email de l'utilisateur propriétaire de cette fiche"))
// ->add('images', 'sonata_type_collection', array('by_reference' => true, 'type_options' => array('delete' => true)),
// array('edit' => 'inline', 'inline' => 'table'))
// ->add('stamps', 'sonata_type_model', array(
// ->add('stamps', ModelType::class, array(
// 'label' => "Etiquettes",
// 'required' => false,
// 'choices_as_values' => true,
......
......@@ -8,6 +8,7 @@ use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Biopen\GeoDirectoryBundle\Document\ElementStatus;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Form\Type\ModelType;
class ImportAdmin extends AbstractAdmin
{
......@@ -52,7 +53,7 @@ class ImportAdmin extends AbstractAdmin
->with("Autres options", ['box_class' => 'box box-default', 'class' => 'col-md-6'])
->add('geocodeIfNecessary', null, array('required' => false, 'label' => 'Géocoder les élements sans latitude ni longitude à partir de leur adresse'))
->add('createMissingOptions', null, array('required' => false, 'label' => 'Créer les catégories manquantes', 'label_attr' => ['title' => "Si un élément importé a une catégorie qui n'existe pas encore sur votre carte, elle sera automatiquement crée"]))
->add('optionsToAddToEachElement', 'sonata_type_model', array(
->add('optionsToAddToEachElement', ModelType::class, array(
'class'=> 'Biopen\GeoDirectoryBundle\Document\Option',
'required' => false,
'choices_as_values' => true,
......
......@@ -17,6 +17,7 @@ use Biopen\GeoDirectoryBundle\Document\CategoryStatus;
use Biopen\GeoDirectoryBundle\Document\ModerationState;
use Sonata\AdminBundle\Admin\AdminInterface;
use Knp\Menu\ItemInterface;
use Sonata\AdminBundle\Form\Type\ModelType;
class OptionAdmin extends AbstractAdmin
{
......@@ -52,7 +53,7 @@ class OptionAdmin extends AbstractAdmin
->add('name', null, array('required' => true, 'label' => 'Nom'))
->add('color', 'text', array('required' => false, 'label' => 'Couleur', 'attr' => ['class' => 'gogo-color-picker']))
->add('icon', null, array('required' => false, 'label' => 'Icone', 'attr' => ['class' => 'gogo-icon-picker']))
->add('parent', 'sonata_type_model', array(
->add('parent', ModelType::class, array(
'class'=> 'Biopen\GeoDirectoryBundle\Document\Category',
'required' => true,
'query' => $parentQuery,
......@@ -69,14 +70,14 @@ class OptionAdmin extends AbstractAdmin
->add('displayInInfoBar', null, array('required' => false, 'label' => "Dans la fiche détail"))
->add('displayInForm', null, array('required' => false, 'label' => "Dans le formulaire"))
->end()
->with('Sous groupes', array('class' => 'col-xs-12 sub-categories-container'))
->add('subcategories', 'sonata_type_collection', array('by_reference' => false, 'type_options' => ['delete' => false], 'label_attr'=> ['style'=> 'display:none']),
array(
'edit' => 'inline',
'inline' => 'table',
'admin_code' => 'admin.categories.lite_hidden'
))
->end()
// ->with('Sous groupes', array('class' => 'col-xs-12 sub-categories-container'))
// ->add('subcategories', 'sonata_type_collection', array('by_reference' => false, 'label_attr'=> ['style'=> 'display:none']),
// array(
// 'edit' => 'inline',
// 'inline' => 'table',
// 'admin_code' => 'admin.categories.lite_hidden'
// ))
// ->end()
->end()
->tab("Configuration avancée")
->with('Paramètres secondaires', array('class' => 'col-xs-12 col-md-6', 'box_class' => 'box'))
......
......@@ -20,18 +20,18 @@ use Knp\Menu\ItemInterface;
class OptionLiteAdmin extends AbstractAdmin
{
protected $baseRouteName = 'admin_biopen_geodirectory_option_lite';
protected $baseRouteName = 'admin_biopen_geodirectory_option_lite';
protected $baseRoutePattern = 'admin_biopen_geodirectory_option_lite';
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('name', null, array('required' => true,'label' => 'Nom'))
->add('name', null, array('required' => true,'label' => 'Nom'))
->add('index', null, array('required' => false, 'label' => 'Position'))
->add('color', 'text', array('required' => false, 'label' => 'Couleur', 'attr' => ['class' => 'gogo-color-picker']))
->add('color', 'text', array('required' => false, 'label' => 'Couleur', 'attr' => ['class' => 'gogo-color-picker']))
->add('icon', null, array('required' => false, 'label' => 'Icone', 'attr' => ['class' => 'gogo-icon-picker']))
->add('useIconForMarker', null, array('required' => false, 'label' => "Icone pour le marqueur", 'label_attr' => ['title'=>"Le marqueur affichera toutes icones de chaque catégorie ayant cette option activée. Les icones seront classées par ordre de selection des catégories dans le formulaire"]))
->add('useIconForMarker', null, array('required' => false, 'label' => "Icone pour le marqueur", 'label_attr' => ['title'=>"Le marqueur affichera toutes icones de chaque catégorie ayant cette option activée. Les icones seront classées par ordre de selection des catégories dans le formulaire"]))
->add('useColorForMarker', null, array('required' => false, 'label' => "Couleur pour le marqueur", 'label_attr' => ['title'=>"Si un élément a plusieurs catégories qui donnent la couleur, on utilise la catégorie de plus bas niveau"]))
->add('_link', 'text', array('required' => false, 'mapped' => false, 'label' => 'admin_biopen_geodirectory_option_edit', ));
->add('_link', 'text', array('required' => false, 'mapped' => false, 'label' => 'admin_biopen_geodirectory_option_edit', ));
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment