/**
  * {@inheritdoc}
  */
 protected function getFieldset(FormBuilderInterface $builder, FormInterface $form)
 {
     $boxTypeSelect = $this->getBoxTypeSelect($form);
     $boxTypeSelect->addOptionToSelect($this->type, $this->type);
     $fieldset = $form->addChild($builder->getElement('nested_fieldset', ['name' => $this->getType(), 'label' => $this->trans('layout_box.label.settings'), 'dependencies' => [$builder->getDependency('show', ['field' => $boxTypeSelect, 'condition' => new Equals($this->type), 'form' => $form])]]));
     return $fieldset;
 }
Пример #2
0
 /**
  * Adds background selector
  *
  * @param \DOMElement $field
  *
  * @return mixed
  */
 protected function addFieldBackground(\DOMElement $field)
 {
     $attributes = $this->getFieldAttributes($field);
     $xml = simplexml_import_dom($field);
     return $this->builder->getElement('colour_scheme_picker', $attributes + ['gradient_height' => (string) $xml->height, 'file_source' => $this->themeDir . '/assets/images', 'type_colour' => (bool) $xml->type['colour'], 'type_gradient' => (bool) $xml->type['gradient'], 'type_image' => (bool) $xml->type['image']]);
 }