names container

@param FieldFormFactory $form
181387
protected function setNamesContainer(&$form)
    {
        $shouldContainValueField = false;
        foreach ($form->fieldsets as $fieldset) {
            $shouldContainValueField = $this->shouldContainValueField(collect($fieldset->controls)->where('name', 'type')->first()->value);
        }
        $form->fieldset(trans('antares/customfields::label.options'), function (Fieldset $fieldset) use($shouldContainValueField) {

            $attributes = ['class' => 'w470'];
            if ($this->model->imported) {
                $attributes['disabled'] = 'disabled';
            }
            $nameField = $fieldset->control('input:text', 'name')
                    ->label(trans('antares/customfields::label.name'))
                    ->attributes($attributes);

            if ($this->model->imported) {
                $nameField->help = trans('antares/customfields::messages.customfield_name_edit_disabled_for_native');
            }


            $fieldset->control('input:text', 'label')->label(trans('antares/customfields::label.default_label'))->attributes(['class' => 'w470']);

            $fieldset->control('input:text', 'placeholder')
                    ->label(trans('antares/customfields::label.default_placeholder'))
                    ->attributes(['class' => 'w470']);

            $fieldset->control('textarea', 'description')
                    ->label(trans('antares/customfields::label.description'))
                    ->attributes(['class' => 'w570', 'cols' => '5', 'rows' => '5']);

            if ($shouldContainValueField) {
                $fieldset->control('input:text', 'value')
                        ->label(trans('antares/customfields::label.value'))
                        ->attributes(['class' => 'w470']);
            }
            $control = $fieldset->control('input:checkbox', 'force_display')
                    ->label(trans('antares/customfields::label.force_display_on_form'))
                    ->value(1);
            if ($this->model->force_display) {
                $control->checked();
            }

            $fieldset->control('input:text', 'additional_attributes')
                    ->label(trans('antares/customfields::label.field_attributes'))
                    ->attributes(['class' => 'w500'])
                    ->help(trans('antares/customfields::label.field_attributes_help'));
        });
    }
1238863
public function getForm(string $name = '', array $form = null)
    {
        if (!isset($this->_forms[$name])) {
            $this->_forms[$name] = $this->createFormObject($name, $form);
        }

        return $this->_forms[$name];
    }
1352632
public function onLayoutBoxFormInit(FormEvent $event)
    {
        $builder       = $event->getFormBuilder();
        $form          = $event->getForm();
        $configurators = $this->container->get('layout_box.configurator.collection')->all();
        $resource      = $event->getResource();
        $boxSettings   = $resource->getSettings();
        
        foreach ($configurators as $configurator) {
            if ($configurator instanceof LayoutBoxConfiguratorInterface) {
                $defaults = [];
                if ($resource->getBoxType() == $configurator->getType()) {
                    $defaults = $boxSettings;
                }
                
                $configurator->addFormFields($builder, $form, $defaults);
            }
        }
    }
590325
static function registerForm (Form $form)
    {
        if (!in_array($form, self::$forms))
            array_push(self::$forms, $form);
    }
143229
public static function set_form_fields($form, $instance = null)
	{
		Observer_Validation::set_fields($instance instanceof static ? $instance : get_called_class(), $form);
		$instance and $form->populate($instance, true);
	}
378744
protected function registerFieldNameForFormTokenGeneration($fieldName)
    {
        if ($this->viewHelperVariableContainer->exists(\Neos\FluidAdaptor\ViewHelpers\FormViewHelper::class, 'formFieldNames')) {
            $formFieldNames = $this->viewHelperVariableContainer->get(\Neos\FluidAdaptor\ViewHelpers\FormViewHelper::class, 'formFieldNames');
        } else {
            $formFieldNames = [];
        }
        $formFieldNames[] = $fieldName;
        $this->viewHelperVariableContainer->addOrUpdate(\Neos\FluidAdaptor\ViewHelpers\FormViewHelper::class, 'formFieldNames', $formFieldNames);
    }
620471
public function editFormSucceeded(Form $form, ArrayHash $values): void
	{
		if ($this->content) {
			$content = $this->content;
		} else {
			$content = new Content;
			$this->orm->content->attach($content);
		}

		try {
			if ($this->editConst) {
				$content->locale = $values->locale;
				$content->setConst($values->const);
			}
			$content->name = $values->name;
			$content->title = $values->title;
			$content->keywords = $values->keywords;
			$content->image = $values->image;
			$content->background = $values->background;
			$content->description = $values->description;
			$content->content = $values->content;

			$this->orm->persistAndFlush($content);
			$this->restoreBacklink();
		} catch (UniqueConstraintViolationException $ex) {
			$form->addError('webManager.web.content.constantExists');
		}
	}
1210532
public function createFormView(FormInterface $form)
    {
        $post = $this->eavManager->initializeEntity($form->getSchema());

        $form = $this->formFactory->create(PostType::class, $post, ['form_id' => $form->getId()]);

        return $form->createView();
    }
321984
public function settingsFormSucceeded(Form $form, ArrayHash $values): void
	{
		$this->configurator->logo = $values->logo;
		$this->configurator->title = $values->title;
		$this->configurator->keywords = $values->keywords;
		$this->configurator->description = $values->description;
		$this->flashNotifier->success('webManager.web.settings.saved');

		if ($this->isAjax()) {
			$this->redrawControl('settings');
		} else {
			$this->redirect('default');
		}
	}
391316
public function removeNameStringReplaceLocationMapCallback(array &$form, FormStateInterface $form_state) {
    $num_name_string_replace_location_map = $form_state->get('num_name_string_replace_location_map');
    if ($num_name_string_replace_location_map > 1) {
      $remove_button = $num_name_string_replace_location_map - 1;
      $form_state->set('num_name_string_replace_location_map', $remove_button);
    }
    $form_state->setRebuild();
  }
1087058
protected function extendForm(FormBuilder $form)
    {
        $form->extend(function(FormGrid $form) {
            $fieldsetName = trans('antares/ban_management::title.config.title');

            $form->findFieldsetOrCreateNew($fieldsetName, function(Fieldset $fieldset) use($fieldsetName) {
                $fieldset->legend($fieldsetName);
                $rules = $this->rulesProcessor->getWhitelist()->map(function(RuleContract $rule) {
                            return $rule->getValue();
                        })->toArray();

                $fieldset->control('input:text', 'ban-management[options][max_failed_attempts]')
                        ->value($this->config->getMaxFailedAttempts())
                        ->label(trans('antares/ban_management::label.config.max-attempts'));

                $fieldset->control('input:textarea', 'ban-management[rules][ip-whitelist]')
                        ->value(implode("\r\n", $rules))
                        ->label(trans('antares/ban_management::label.config.ip-whitelist'))
                        ->attributes(['rows' => 5, 'cols' => 50])
                        ->help(trans('antares/ban_management::label.config.ip_whitelist_help'));

                $fieldset->control('input:text', 'cancel')
                        ->label('')
                        ->field(function() {
                            return app('html')->link(handles("antares::ban_management/rules/datatable"), trans('antares/ban_management::title.go_to_ban_management'));
                        });
            });
        });
    }
53119
private function addContentFieldset(FormInterface $form)
    {
        $contentData = $form->addChild($this->getElement('nested_fieldset', [
            'name'  => 'content_data',
            'label' => $this->trans('common.fieldset.description')
        ]));

        $languageData = $contentData->addChild($this->getElement('language_fieldset', [
            'name'        => 'translations',
            'label'       => $this->trans('common.fieldset.translations'),
            'transformer' => $this->getRepositoryTransformer('translation', $this->get('page.repository'))
        ]));

        $languageData->addChild($this->getElement('rich_text_editor', [
            'name'  => 'content',
            'label' => $this->trans('common.label.description'),
        ]));

        $this->addMetadataFieldset($form, $this->get('page.repository'));
    }
1103893
private function addFormElements(array &$form, array $values) {
    $form['filter_controls'] = [
      '#markup' => '
          <div class="container controls-wrapper hidden-sm hidden-md hidden-lg">
          <a href="#" class="btn btn-link transparent-blue add-filters">' . $this->t('Add filters') . '</a>
          <a href="#" class="btn btn-link transparent-blue close-filters hidden">' . $this->t('Close filters') . '</a>
          </div>',
    ];

    $form['selects'] = [
      '#type' => 'container',
      '#attributes' => [
        'class' => [
          'container',
          'selects-container',
          'hidden-xs',
        ],
      ],
    ];

    $form['selects']['location'] = [
      '#type' => 'select',
      '#title' => $this->t('Location'),
      '#options' => $this->getLocationOptions(),
      '#prefix' => '<hr/>',
      '#default_value' => isset($values['location']) ? $values['location'] : 'All',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    $form['selects']['program'] = [
      '#type' => 'select',
      '#title' => $this->t('Program'),
      '#options' => $this->getProgramOptions(),
      '#default_value' => isset($values['program']) ? $values['program'] : 'all',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    $form['selects']['category'] = [
      '#type' => 'select',
      '#title' => $this->t('Sub-Program'),
      '#options' => $this->getCategoryOptions(),
      '#default_value' => isset($values['category']) ? $values['category'] : 'all',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    $form['selects']['class'] = [
      '#type' => 'select',
      '#title' => $this->t('Class'),
      '#options' => $this->getClassOptions(),
      '#default_value' => isset($values['class']) ? $values['class'] : 'all',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    $form['selects']['date'] = [
      '#type' => 'textfield',
      '#title' => $this->t('Date'),
      '#default_value' => isset($values['date']) ? $values['date'] : '',
      '#attributes' => [
        'class' => ['openy-schedule-datepicker'],
      ],
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
        // Do not focus current input element after ajax finish.
        'disable-refocus' => TRUE,
      ],
    ];

    $form['selects']['time'] = [
      '#type' => 'select',
      '#title' => $this->t('Start Time:'),
      '#options' => $this->getTimeOptions(),
      '#default_value' => isset($values['time']) ? $values['time'] : 'all',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    $form['selects']['display'] = [
      '#type' => 'checkbox',
      '#title' => $this->t('Weekly View'),
      '#default_value' => isset($values['display']) ? $values['display'] : 0,
      '#title_display' => 'before',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    // If on Weekly View, default and disable time field.
    if (isset($values['display']) && $values['display']) {
      $form['selects']['time']['#disabled'] = TRUE;
      $form['selects']['time']['#default_value'] = 'all';
    }

    $form['selects']['button'] = [
      '#type' => 'button',
      '#prefix' => '<div class="actions-wrapper hidden-xs hidden-sm hidden-md hidden-lg">',
      '#suffix' => '</div>',
      '#attributes' => [
        'class' => [
          'btn',
          'blue',
        ]
      ],
      '#value' => $this->t('Apply filters'),
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'method' => 'replace',
        'event' => 'click',
      ],
    ];

    $form['filters'] = [
      '#type' => 'container',
      '#prefix' => '<div class="filters-main-wrapper hidden-sm"><div class="container filters-container">',
      '#suffix' => '</div></div>',
      '#attributes' => [
        'class' => [
          'container',
          'filters-container',
        ],
      ],
      '#markup' => '',
      '#weight' => 99,
      'filters' => self::buildFilters($values),
    ];

    $form['alerts'] = [
      views_embed_view('header_alerts', 'specific_alerts_block', $values['location']),
    ];
    $form['alerts']['#prefix'] = '<div class="alerts-wrapper cleafix"><div class="container"><div class="row"><div class="col-xs-12">';
    $form['alerts']['#suffix'] = '</div></div></div></div>';
    $form['alerts']['#weight'] = 100;
  }
111531
public function form(Form $form)
    {
        if ($this->mode == self::MODE_INLINE || $this->mode == self::MODE_INLINE_NO_LABELS) {
            $form->addClass('form-inline');
        } elseif ($this->mode == self::MODE_HORIZONTAL) {
            $form->addClass('form-horizontal');
        }

        return parent::form($form);
    }
2569
protected function addLabel(FormInterface $form, array $schema)
    {
        $translationDomain = $form->getConfig()->getOption('translation_domain');
        if ($label = $form->getConfig()->getOption('label')) {
            $schema['title'] = $this->translator->trans($label, [], $translationDomain);
        } else {
            $schema['title'] = $this->translator->trans($form->getName(), [], $translationDomain);
        }

        return $schema;
    }
259029
public function includeGroups(FieldTypeInterface $form)
    {
        /** @var FieldTypeInterface|FormInterface $form */
        return $this->collection(
            $form->repository()->getGroups(),
            $form->getResourceTransformerFactory()->make('GroupTransformer')
        );
    }
882934
public static function label(FormInterface $form)
    {
        $label = $form->getConfig()->getOption('label');

        if (!$label) {
            $label = self::humanize($form->getName());
        }

        return $label;
    }