Registers an array of new CMS form fields.

@param $formFields
13156
public function registerMany($formFields)
    {
        foreach ($formFields as $fieldName => $fieldClass) {
            $this->register($fieldName, $fieldClass);
        }
    }
1002272
public function setFields(array $fields)
    {
        $this->clearFields();

        foreach ($fields as $field) {
            $this->addField($field);
        }

        return $this;
    }
582011
public function addField(FormField $field)
    {
        if ($this->fields->contains($field) === false) {
            $field->setForm($this);
            $this->fields->add($field);
        }

        return $this;
    }
1318081
public function addFields(array $fields)
    {
        $oldFields = $this->_queryBuilder->getFields() ? $this->_queryBuilder->getFields() : array();
        $newFields = array_merge($oldFields, $fields);
        $this->setFields($newFields);
        return $this;
    }
627456
protected function registerFormBuilder()
    {
        $this->app->singleton('form', function ($app) {
            $this->loadConfigurationOptions();

            $form = new FormBuilder(
                $app['html'],
                $app['url'],
                $app['session.store']->token(),
                $this->getTheme()
            );

            $form->novalidate(
                $app['config']->get('html.novalidate', false)
            );

            return $form->setSessionStore($app['session.store']);
        });
    }
395903
public function updateCMSFields(FieldList $fields)
    {
        $fieldEditor = $this->getFieldEditorGrid();

        $fields->insertAfter(new Tab('FormFields', _t(__CLASS__.'.FORMFIELDS', 'Form Fields')), 'Main');
        $fields->addFieldToTab('Root.FormFields', $fieldEditor);

        return $fields;
    }
1371320
public function mapFormFields($fields)
    {
        $_fields = [];

        foreach ($fields as $key => $options) {
            $_options = $this->config('formFieldOptions');

            if (is_array($options)) {
                $_fields[$key] = array_merge($_options, $options);
            } else {
                $_fields[$options] = $_options;
            }
        }

        return $_fields;
    }
542419
public function addDataFields($fields)
    {
        if ($this->customDataFields) {
            $this->customDataFields = array_merge($this->customDataFields, $fields);
        } else {
            $this->customDataFields = $fields;
        }
    }
1275660
public function setScriptFields($scriptFields)
    {
        if (\is_array($scriptFields)) {
            $scriptFields = new ScriptFields($scriptFields);
        }

        return $this->setParam('script_fields', $scriptFields);
    }
594410
public function configurationFormSucseeded(Form $form, ArrayHash $values): void
	{
		$this->localeService->default = $values->defaultLocale;
		$this->localeService->allowed = $values->allowedLocales;
		unset($values->defaultLocale, $values->allowedLocales);

		foreach ($values as $name => $value) {
			$this->configurator->$name = $value;
		}
		$this->flashNotifier->success('cms.settings.settingsSaved');

		if ($this->isAjax()) {
			$this->redrawControl('configuration');
		} else {
			$this->redirect('default');
		}
	}
530938
public function setFields(array $fields)
    {
        parent::setFields($fields);
        if (empty($this->batchId)) {
            $this->batchId = null;
        }

        if (isset($fields['_embedded']['messages'])) {
            $this->messages = $fields['_embedded']['messages'];
        }
    }
932440
public function addFields(array $fields)
    {
        collect($fields)->each(function ($field, $key) {
            if (! $field instanceof AttachmentField) {
                $field = [$key => $field];
            }

            $this->addField($field);
        });

        return $this;
    }
26615
public function addCustomFields($customFields)
    {
        if (!$this->getCustomFields()) {
            return $this->setCustomFields(array($customFields));
        } else {
            return $this->setCustomFields(
                array_merge($this->getCustomFields(), array($customFields))
            );
        }
    }
844846
public function resetFields(array $fields) {
		$defaults = $this->defaults();
		foreach ($fields as $field) {
			unset($this->fieldsCache[$field]);
			unset($this->saveCsd[$field]);
			if (isset($defaults[$field]))
				$this->set($field,$defaults[$field]);
			else {
				$this->set($field,NULL);
			}
		}
	}
94340
protected function addField(SharpFormField $field)
    {
        $this->fields[] = $field;
        $this->formBuilt = false;

        return $this;
    }
878638
public function addField(FormResponseField $field)
    {
        if ($this->fields->contains($field) === false) {
            $field->setResponse($this);
            $this->fields->add($field);
        }

        return $this;
    }
655800
protected function registerFormBuilder()
    {
        $this->app->singleton('mform', function ($app) {
            $form = new FormBuilder($app['mhtml'], $app['url'], $app['view'], $app['session.store']->getToken());
            return $form;
            return $form->setSessionStore($app['session.store']);
        });
    }