Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     parent::configureFormFields($formMapper);
     $formMapper->remove('firstname');
     $formMapper->remove('lastname');
     $formMapper->with('General')->add('ordering', null, array('required' => false, 'label' => 'Сортировка'))->add('usernameCanonical', null, ['label' => 'Username'])->end()->with('Profile')->add('translations', 'a2lix_translations_gedmo', array('translatable_class' => 'Application\\Bundle\\UserBundle\\Entity\\User', 'fields' => array('firstname' => array('label' => 'Имя', 'locale_options' => array('ru' => array('required' => true), 'en' => array('required' => false))), 'lastname' => array('label' => 'Фамилия', 'locale_options' => array('ru' => array('required' => true), 'en' => array('required' => false))), 'position' => array('label' => 'Должность', 'locale_options' => array('ru' => array('required' => true), 'en' => array('required' => false)))), 'label' => 'Перевод'))->add('avatar', 'file', array('required' => false, 'label' => 'Аватарка'))->add('caricature', 'file', array('required' => false, 'label' => 'Карикатура'))->end()->with('Interests', array('label' => 'Интересы'))->add('interests', 'choice', array('choices' => User::getInterestsList(), 'multiple' => true, 'required' => false, 'label' => 'Интересы'))->add('drink', 'choice', array('choices' => User::getDrinksList(), 'required' => false, 'label' => 'Любимый напиток'))->end();
 }
 /**
  * {@inheritdoc}
  */
 public function getExportFields()
 {
     // avoid security field to be exported
     return array_filter(parent::getExportFields(), function ($v) {
         return !in_array($v, array('password', 'salt'));
     });
 }
 protected function configureFormFields(FormMapper $formMapper)
 {
     parent::configureFormFields($formMapper);
     // TODO: Change the autogenerated stub
     $now = new \DateTime();
     $formMapper->tab('User')->with('Profile')->add('dateOfBirth', 'sonata_type_date_picker', array('dp_language' => 'ru', 'format' => 'dd.MM.yyyy', 'years' => range(1900, $now->format('Y')), 'dp_min_date' => '1-1-1900', 'required' => false));
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     parent::configureFormFields($formMapper);
     $formMapper->tab('User')->with('Profile')->end()->with('Social')->end()->end()->tab('School')->with('Profile', array('class' => 'col-md-6'))->end()->end();
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     parent::configureFormFields($formMapper);
     $formMapper->add('articles', 'entity', array('class' => 'LCV\\PlatformBundle\\Entity\\Article'))->add('comments', 'entity', array('class' => 'LCV\\CommentBundle\\Entity\\Comment'))->add('avatar', 'sonata_type_model_list', array(), array('link_parameters' => array('context' => 'news')));
 }
Example #6
0
 public function getTemplate($name)
 {
     switch ($name) {
         case 'edit':
             return 'IndicadoresBundle:CRUD:user-edit.html.twig';
             break;
         default:
             return parent::getTemplate($name);
             break;
     }
 }
Example #7
0
 /**
  * {@inheritdoc}
  */
 protected function configureShowFields(ShowMapper $showMapper)
 {
     parent::configureShowFields($showMapper);
 }
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     parent::configureFormFields($formMapper);
     $formMapper->tab('User')->with('Profile')->end()->with('Social')->end()->end()->tab('School')->with('Profile', array('class' => 'col-md-6'))->add('schoolClass', 'entity', array('required' => false, 'class' => 'TNCY\\SchoolBundle\\Entity\\SchoolClass'))->end()->end();
 }
Example #9
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     parent::configureFormFields($formMapper);
     $formMapper->with('Sopinet')->add('profilepicture')->end();
 }
Example #10
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     parent::configureFormFields($formMapper);
     $formMapper->with('MyData')->add('city', 'text', array('label' => 'City'))->add('street', 'text', array('label' => 'Street'))->add('home_number', 'integer', array('label' => 'Home number'))->add('other_description', 'text', array('label' => 'Person desription', 'required' => false))->end();
 }