Ejemplo n.º 1
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $actionChoices = $this->eventManager->getSortedEventsForFilter();
     /** @var \Claroline\CoreBundle\Entity\User $user */
     $user = $this->tokenStorage->getToken()->getUser();
     $locale = null === $user->getLocale() ? $this->platformConfigHandler->getParameter('locale_language') : $user->getLocale();
     $builder->add('action', 'twolevelselect', array('translation_domain' => 'log', 'attr' => array('class' => 'input-sm'), 'choices' => $actionChoices, 'choices_as_values' => true))->add('isUserReceiver', 'checkbox')->add('occurrence', 'integer', array('attr' => array('class' => 'input-sm')))->add('result', 'text')->add('resource', 'resourcePicker', array('required' => false))->add('resultComparison', 'choice', array('choices' => BadgeRule::getResultComparisonTypes()));
     $builder->addEventListener(FormEvents::PRE_SET_DATA, array($this, 'onPreSetData'));
 }
Ejemplo n.º 2
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $actionChoices = $this->eventManager->getSortedEventsForFilter(LogGenericEvent::DISPLAYED_ADMIN);
     $builder->add('action', 'twolevelselect', array('label' => 'Show actions for', 'translation_domain' => 'log', 'attr' => array('class' => 'input-sm'), 'choices' => $actionChoices, 'choices_as_values' => true, 'theme_options' => array('label_width' => 'col-md-3')))->add('range', 'daterange', array('label' => 'for_period', 'required' => false, 'attr' => array('class' => 'input-sm'), 'theme_options' => array('label_width' => 'col-md-3', 'control_width' => 'col-md-3')))->add('user', 'simpleautocomplete', array('label' => 'for user', 'entity_reference' => 'user', 'required' => false, 'attr' => array('class' => 'input-sm'), 'theme_options' => array('label_width' => 'col-md-3', 'control_width' => 'col-md-3')));
 }
Ejemplo n.º 3
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $actionChoices = $this->eventManager->getResourceEventsForFilter(LogGenericEvent::DISPLAYED_WORKSPACE, $options['data']['resourceClass']);
     $builder->add('action', 'choice', array('label' => 'Show actions for', 'attr' => array('class' => 'input-sm'), 'theme_options' => array('label_width' => 'col-md-3', 'control_width' => 'col-md-3'), 'choices' => $actionChoices))->add('range', 'daterange', array('label' => 'for_period', 'required' => false, 'attr' => array('class' => 'input-sm'), 'theme_options' => array('label_width' => 'col-md-3', 'control_width' => 'col-md-3')))->add('user', 'simpleautocomplete', array('label' => 'for user', 'entity_reference' => 'user', 'required' => false, 'attr' => array('class' => 'input-sm'), 'theme_options' => array('label_width' => 'col-md-3', 'control_width' => 'col-md-3')));
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $actionChoices = $this->eventManager->getSortedEventsForConfigForm(LogGenericEvent::DISPLAYED_WORKSPACE);
     $builder->add('restrictions', 'select2', array('choices' => $actionChoices, 'required' => false, 'multiple' => true, 'expanded' => false, 'translation_domain' => 'log', 'attr' => array('placeholder' => 'click_to_choose')))->add('amount', 'choice', array('choices' => array('1' => '1', '5' => '5', '10' => '10', '15' => '15', '20' => '20'), 'required' => true));
 }