예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $propertiesForm = $builder->create('properties', FormType::class)->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
     $builder->add($propertiesForm);
     $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
         $block = $event->getData();
         $form = $event->getForm();
         // @todo: Replace with a nice getDefaultOptions method
         $properties = $block->getProperties();
         if (!count($properties)) {
             $properties['styles'] = array();
             $cols = array_merge(array(array_fill(0, $block->getColumnCount(), 12 / $block->getColumnCount())), array_fill(0, 3, array_fill(0, $block->getColumnCount(), null)));
             $keys = array('xs', 'sm', 'md', 'lg');
             $properties['spans'] = array_combine($keys, $cols);
             $properties['offsets'] = array_combine($keys, array_fill(0, 4, array_fill(0, $block->getColumnCount(), null)));
             $properties['gutters'] = array_combine($keys, $cols);
             $block->setProperties($properties);
         }
         $form->get('properties')->add('styles', ChoiceType::class, ['label' => 'label.styling', 'choices' => $this->config['styles'], 'required' => false, 'expanded' => true, 'multiple' => true, 'attr' => ['help_text' => 'help.html_styles']]);
         $form->get('properties')->add('spans', SpanCollectionType::class, ['column_count' => $block->getColumnCount(), 'label' => 'label.spans', 'attr' => ['help_text' => 'help.column_spans']]);
         $form->get('properties')->add('offsets', SpanCollectionType::class, ['column_count' => $block->getColumnCount(), 'label' => 'label.offsets', 'attr' => ['help_text' => 'help.column_offsets']]);
         $form->get('properties')->add('gutters', GutterCollectionType::class, ['column_count' => $block->getColumnCount(), 'label' => 'label.gutters', 'attr' => ['help_text' => 'help.column_gutters']]);
     });
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     // Default panel
     $builder->add($builder->create('default', FormType::Class, ['inherit_data' => true])->add('loginContentItem', ContentPickerType::class, ['label' => 'label.login_content_item'])->add('registrationContentItem', ContentPickerType::class, ['label' => 'label.register_content_item']));
     $builder->add($builder->create('properties', FormType::class)->add('loginUrl', TextType::class, ['label' => 'label.login_url'])->add('registrationUrl', TextType::class, ['label' => 'label.registration_url']));
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $builder->add($builder->create('default', FormType::Class, ['inherit_data' => true])->add('header', CKEditorType::class, ['label' => 'label.header', 'attr' => ['label_col' => 12, 'widget_col' => 12]])->add('footer', CKEditorType::class, ['label' => 'label.footer', 'attr' => ['label_col' => 12, 'widget_col' => 12]]));
     $propertiesForm = $builder->create('properties', FormType::Class)->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
     $propertiesForm->add('styles', ChoiceType::class, ['label' => 'label.styling', 'choices' => $this->config['styles'], 'required' => false, 'expanded' => true, 'multiple' => true, 'attr' => ['help_text' => 'help.html_styles']]);
     $builder->add($propertiesForm);
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $propertiesForm = $builder->create('properties', FormType::class)->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
     if ($this->config['styles']) {
         $propertiesForm->add('styles', 'choice', ['label' => 'label.styling', 'choices' => array_combine($this->config['styles'], $this->config['styles']), 'required' => false, 'expanded' => true, 'multiple' => true, 'attr' => ['help_text' => 'help.html_styles']]);
     }
     $builder->add($builder->create('default', FormType::class, ['inherit_data' => true])->add('media', MediaPickerType::class, ['required' => false, 'multiple' => false])->add('value', CKEditorType::class, ['label' => 'label.rich_text', 'attr' => ['label_col' => 12, 'widget_col' => 12]]))->add($propertiesForm);
 }
예제 #5
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $propertiesForm = $builder->create('properties', FormType::class)->add('url', TextType::class, ['label' => 'label.url'])->add('target', ChoiceType::class, ['label' => 'label.target', 'choices' => ['_blank' => '_blank', '_self' => '_self'], 'required' => false])->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
     if ($this->config['styles']) {
         $propertiesForm->add('styles', ChoiceType::class, ['label' => 'label.styling', 'choices' => array_combine($this->config['styles'], $this->config['styles']), 'required' => false, 'expanded' => true, 'multiple' => true]);
     }
     $builder->add($builder->create('default', FormType::class, ['inherit_data' => true])->add('value', TextType::class, ['label' => 'label.label']))->add($propertiesForm);
 }
예제 #6
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $propertiesForm = $builder->create('properties', FormType::class)->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
     if (isset($this->config['templates'])) {
         $propertiesForm->add('template', ChoiceType::class, ['label' => 'label.template', 'placeholder' => 'placeholder.choice_optional', 'attr' => ['help_text' => 'help.block_template'], 'choices' => $this->config['templates'], 'required' => false]);
     }
     $builder->add($builder->create('default', FormType::class, ['virtual' => true])->add('value', MediaPickerType::class, ['to_json' => true, 'multiple' => true, 'label' => 'label.media']))->add($propertiesForm);
 }
예제 #7
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $propertiesForm = $builder->create('properties', FormType::class, ['label' => false, 'attr' => ['widget_col' => 12]]);
     if (isset($this->config['templates'])) {
         $propertiesForm->add('template', ChoiceType::class, ['label' => 'label.template', 'placeholder' => 'placeholder.choice_optional', 'attr' => ['help_text' => 'help.block_template'], 'choices' => $this->config['templates'], 'required' => false]);
     }
     $builder->add($builder->create('default', FormType::class, ['virtual' => true])->add('form', EntityType::class, ['class' => 'OpiferCmsBundle:Form', 'choice_label' => 'name', 'label' => 'Form', 'placeholder' => 'Choose Form'])->add($propertiesForm));
 }
예제 #8
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $propertiesForm = $builder->create('properties', FormType::class);
     $builder->add($propertiesForm->add('url', TextType::class, ['attr' => ['help_text' => 'help.iframe_url']])->add('width', TextType::class, ['attr' => []])->add('height', TextType::class, ['attr' => []]))->add($propertiesForm->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]));
     if ($this->config['styles']) {
         $propertiesForm->add('styles', ChoiceType::class, ['label' => 'label.styling', 'choices' => $this->config['styles'], 'required' => false, 'expanded' => true, 'multiple' => true, 'attr' => ['help_text' => 'help.html_styles']]);
     }
 }
예제 #9
0
 public function getViewParameters(BlockInterface $block)
 {
     $properties = $block->getProperties();
     $limit = isset($properties['limit']) ? $properties['limit'] : 5;
     $reviews = $this->reviewManager->getRepository()->createQueryBuilder('r')->orderBy('r.createdAt', 'DESC')->setMaxResults($limit)->getQuery()->getResult();
     $parameters = parent::getViewParameters($block);
     $parameters['reviews'] = $reviews;
     return $parameters;
 }
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $propertiesForm = $builder->create('properties', FormType::class);
     if (count($this->config['templates'])) {
         // Default panel
         $builder->add($propertiesForm->add('template', ChoiceType::class, ['label' => 'label.template', 'placeholder' => 'placeholder.choice_optional', 'attr' => ['help_text' => 'help.block_template'], 'choices' => $this->config['templates'], 'required' => false]));
     }
 }
예제 #11
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $showContentPicker = false;
     if ($options['data'] && $options['data']->getValue() == NavigationBlock::CHOICE_CUSTOM) {
         $showContentPicker = true;
     }
     // Default panel
     $builder->add($builder->create('default', FormType::class, ['virtual' => true])->add('value', ChoiceType::class, ['label' => 'label.navigation_block_value', 'choices' => ['Top level pages' => NavigationBlock::CHOICE_TOP_LEVEL, 'Custom selection' => NavigationBlock::CHOICE_CUSTOM], 'choices_as_values' => true, 'attr' => ['class' => 'toggle-content-picker']])->add($builder->create('properties', FormType::class, ['label' => false, 'attr' => ['widget_col' => 12]])->add('content', ContentListPickerType::class, ['label' => 'label.custom', 'attr' => ['widget_col' => 9, 'form_group' => ['styles' => $showContentPicker === false ? 'display:none;' : '']]])->add('levels', ChoiceType::class, ['label' => 'label.levels', 'choices' => [1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5], 'attr' => ['help_text' => 'help.levels', 'widget_col' => 9]])->add('template', ChoiceType::class, ['label' => 'label.template', 'attr' => ['help_text' => 'help.block_template', 'widget_col' => 9], 'choices' => $this->config['templates'], 'required' => true])));
 }
예제 #12
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $propertiesForm = $builder->create('properties', FormType::class)->add('template', ChoiceType::class, ['label' => 'label.template', 'attr' => ['help_text' => 'help.block_template'], 'choices' => $this->config['templates'], 'required' => true])->add('tabs', BootstrapCollectionType::class, ['label' => 'label.tabs', 'allow_add' => true, 'allow_delete' => true, 'entry_type' => TextType::class])->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
     if ($this->config['styles']) {
         $propertiesForm->add('styles', ChoiceType::class, ['label' => 'label.styling', 'choices' => $this->config['styles'], 'required' => false, 'expanded' => true, 'multiple' => true, 'attr' => ['help_text' => 'help.html_styles']]);
     }
     // Default panel
     $builder->add($propertiesForm);
 }
예제 #13
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $propertiesForm = $builder->create('properties', FormType::class)->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
     if (isset($this->config['templates'])) {
         $propertiesForm->add('template', ChoiceType::class, ['label' => 'label.template', 'placeholder' => 'placeholder.choice_optional', 'attr' => ['help_text' => 'help.block_template'], 'choices' => $this->config['templates'], 'required' => false]);
     }
     // Default panel
     $builder->add($builder->create('default', FormType::class, ['inherit_data' => true])->add('value', CKEditorType::class, ['label' => 'label.rich_text', 'attr' => ['label_col' => 12, 'widget_col' => 12]]))->add($propertiesForm);
 }
예제 #14
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $propertiesForm = $builder->create('properties', FormType::class)->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
     // Default panel
     $builder->add($builder->create('default', FormType::class, ['virtual' => true])->add('title', 'text', ['label' => 'label.title'])->add('value', ContentListPickerType::class, ['label' => 'label.content']))->add($propertiesForm->add('template', ChoiceType::class, ['label' => 'label.template', 'placeholder' => 'placeholder.choice_optional', 'attr' => ['help_text' => 'help.block_template'], 'choices' => $this->config['templates'], 'required' => false]));
     if ($this->config['styles']) {
         $propertiesForm->add('styles', ChoiceType::class, ['label' => 'label.styling', 'choices' => $this->config['styles'], 'required' => false, 'expanded' => true, 'multiple' => true, 'attr' => ['help_text' => 'help.html_styles']]);
     }
 }
예제 #15
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $propertiesForm = $builder->create('properties', FormType::class)->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]);
     $builder->add($propertiesForm);
     $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
         $block = $event->getData();
         $form = $event->getForm();
         $form->get('properties')->add('styles', ChoiceType::class, ['label' => 'label.styling', 'choices' => $this->config['styles'], 'required' => false, 'expanded' => true, 'multiple' => true, 'attr' => ['help_text' => 'help.html_styles']]);
         $form->get('properties')->add('container_size', ChoiceType::class, ['label' => 'label.container_sizing', 'choices' => ['fluid' => 'label.container_fluid', '' => 'label.container_fixed', 'smooth' => 'label.container_smooth'], 'required' => true, 'attr' => ['help_text' => 'help.container_sizing']]);
     });
 }
예제 #16
0
 /**
  * {@inheritdoc}
  */
 public function getViewParameters(BlockInterface $block)
 {
     $parameters = parent::getViewParameters($block);
     $reference = null;
     if ($block->getReference()) {
         $service = $this->getReferenceService($block);
         $reference = $block->getReference();
         $service->load($reference);
         $parameters = $service->getViewParameters($reference);
         $parameters['pointer'] = $block;
     }
     return $parameters;
 }
예제 #17
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     // Default panel
     $builder->add($builder->create('properties', FormType::class)->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']])->add('show_indicators', ChoiceType::class, ['choices' => ['Yes' => true, 'No' => false], 'choices_as_values' => true])->add('show_controls', ChoiceType::class, ['choices' => ['Yes' => true, 'No' => false], 'choices_as_values' => true]));
 }
예제 #18
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     // Default panel
     $builder->add($builder->create('properties', FormType::class)->add('conditions', ExpressionEngineType::class, ['prototypes' => $this->getPrototypes()])->add('order_by', ChoiceType::class, ['label' => 'Order by', 'choices' => ['Creation Date' => 'createdAt', 'Title' => 'title'], 'choices_as_values' => true])->add('order_direction', ChoiceType::class, ['label' => 'Order direction', 'choices' => ['Ascending' => 'ASC', 'Descending' => 'DESC'], 'choices_as_values' => true])->add('limit', IntegerType::class)->add('template', ChoiceType::class, ['label' => 'label.template', 'placeholder' => 'placeholder.choice_optional', 'attr' => ['help_text' => 'help.block_template'], 'choices' => $this->config['templates'], 'required' => false]));
 }
예제 #19
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $builder->add($builder->create('default', FormType::class, ['virtual' => true])->add('value', MediaPickerType::class, ['to_json' => true, 'multiple' => true, 'label' => 'label.content']));
 }
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     // Default panel
     $builder->add($builder->create('default', FormType::class, ['virtual' => true])->add('value', ContentTreePickerType::class));
 }
예제 #21
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     // Default panel
     $builder->add($builder->create('properties', FormType::class)->add('order_by', ChoiceType::class, ['label' => 'Order by', 'choices' => ['Creation Date' => 'createdAt', 'Title' => 'title'], 'choices_as_values' => true])->add('order_direction', ChoiceType::class, ['label' => 'Order direction', 'choices' => ['Ascending' => 'ASC', 'Descending' => 'DESC'], 'choices_as_values' => true])->add('limit', IntegerType::class));
 }
예제 #22
0
 public function load(BlockInterface $block)
 {
     parent::load($block);
     $this->normalizeTabs($block);
 }
예제 #23
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $builder->add($builder->create('default', FormType::class, ['virtual' => true])->add('form', EntityType::class, ['class' => 'OpiferCmsBundle:Form', 'choice_label' => 'name', 'label' => 'Form', 'placeholder' => 'Choose Form']));
 }
 public function getViewParameters(BlockInterface $block)
 {
     $parameters = parent::getViewParameters($block);
     return array_merge($parameters, ['form' => $this->form->createView(), 'subscribed' => $this->subscribed]);
 }
예제 #25
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     // Default panel
     $builder->add($builder->create('default', FormType::class, ['virtual' => true])->add('media', MediaPickerType::class, ['required' => false, 'multiple' => false, 'attr' => array('label_col' => 12, 'widget_col' => 12)]))->add($builder->create('properties', FormType::class)->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']])->add('filter', ChoiceType::class, ['choices' => $this->getAvailableFilters(), 'choices_as_values' => true, 'attr' => ['help_text' => 'help.image_filter']])->add('enlarge', ChoiceType::class, ['choices' => ['No' => false, 'Yes' => true], 'choices_as_values' => true, 'attr' => ['help_text' => 'help.image_enlarge']])->add('enlarge_filter', ChoiceType::class, ['choices' => $this->getAvailableFilters(), 'choices_as_values' => true, 'required' => false, 'attr' => ['help_text' => 'help.image_enlarge_filter']])->add('styles', ChoiceType::class, ['label' => 'label.styling', 'choices' => $this->config['styles'], 'required' => false, 'expanded' => true, 'multiple' => true, 'attr' => ['help_text' => 'help.html_styles']]));
 }
예제 #26
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     $builder->add($builder->create('default', FormType::class, ['virtual' => true])->add('value', CKEditorType::class, ['label' => 'label.message']));
 }
예제 #27
0
 /**
  * @param EngineInterface $templating
  * @param BlockManager    $em\
  * @param array           $config
  */
 public function __construct(EngineInterface $templating, BlockManager $blockManager, array $config)
 {
     parent::__construct($templating, $config);
     $this->blockManager = $blockManager;
 }
예제 #28
0
 /**
  * @param BlockRenderer $blockRenderer
  * @param ContentManagerInterface $contentManager
  * @param array $config
  */
 public function __construct(BlockRenderer $blockRenderer, ContentManagerInterface $contentManager, array $config)
 {
     parent::__construct($blockRenderer, $config);
     $this->contentManager = $contentManager;
 }
예제 #29
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     // Default panel
     $builder->add($builder->create('default', FormType::class, ['inherit_data' => true])->add('value', TextareaType::class, ['label' => 'label.code', 'attr' => ['label_col' => 12, 'widget_col' => 12, 'help_text' => 'help.javascript_code']]));
 }
예제 #30
0
 /**
  * {@inheritdoc}
  */
 public function buildManageForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildManageForm($builder, $options);
     // Default panel
     $builder->add($builder->create('default', FormType::class, ['inherit_data' => true])->add('value', CKEditorType::class, ['label' => 'label.rich_text', 'attr' => ['label_col' => 12, 'widget_col' => 12]]))->add($builder->create('properties', FormType::class)->add('id', TextType::class, ['attr' => ['help_text' => 'help.html_id']])->add('extra_classes', TextType::class, ['attr' => ['help_text' => 'help.extra_classes']]));
 }