Check if form is named form.

@return void
168567
protected function checkIfNamedForm()
    {
        if ($this->getFormOption('name')) {
            $this->name = Arr::pull($this->formOptions, 'name', $this->name);
        }
    }
915884
public function checkField($name)
    {
        return (!in_array($name, $this->fields())) ?  $this->addFields([$name=>'string']) : true;
    }
820163
private function getValue($form, $name)
    {
        if (is_array($form)) {
            return isset($form[$name]) ? $form[$name] : null;
        } elseif (is_object($form)) {
            $method = 'get' . $name;
            if (method_exists($form, $method)) {
                return $form->$method();
            } else {
                return isset($form->$name) ? $form->$name : null;
            }
        }
    }
1153104
function validateDuplicateName(cb) {
    var formId = formData._id;
    var formName = formData.name;

    if (!formName) {
      return cb(new Error("No form name passed"));
    }

    var query = {};

    //If there is a form id, then the query to the form model must exclude the current form id that is being updated.
    if (formId) {
      query.name = formName;
      //Excluding the formId that is being updated.
      query["_id"] = {"$nin": [formId]};
    } else { //Just checking that the form name exists as a form is being created
      query.name = formName;
    }

    formModel.count(query, function(err, count) {
      if (err) {
        return cb(err);
      }

      //If the number of found forms is > 0, then there is another form with the same name. Do not save the form.
      if (count > 0) {
        return cb(new Error("Form with name " + formName + " already exists found."));
      } else {//No duplicates, can proceed with saving the form.
        return cb();
      }
    });
  }
800438
protected function validateNameLanguage()
    {
        $field = 'name';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return true; // If not set, code will be used instead
        }

        if (mb_strlen($value) > 50) {
            $this->setErrorLengthRange($field, $this->translation->text('Name'), 0, 50);
            return false;
        }

        return true;
    }
1101643
public function isRequestOnValidateAjaxForm()
    {
        if (\Yii::$app->request->isAjax && !\Yii::$app->request->isPjax && UrlHelper::getCurrent()->issetSystemParam(static::VALIDATION_AJAX_FORM_SYSTEM_NAME)) {
            return true;
        }

        return false;
    }
743646
public function __isset($name) {
    if (Tilmeld::$config['email_usernames'] && $name == 'username') {
      return (parent::__isset('email') || parent::__isset('username'));
    }
    return parent::__isset($name);
  }
590325
static function registerForm (Form $form)
    {
        if (!in_array($form, self::$forms))
            array_push(self::$forms, $form);
    }
274365
public function definition() {
        $this->_form->addElement('header', 'selfheader', $this->_customdata->header);
        $this->_form->addElement('static', 'info', '', $this->_customdata->info);
    }
892296
public function isFormSubmit()
    {
        $form_submit = in_array($this->getContentType(), ['application/x-www-form-urlencoded', 'multipart/form-data']);

        return ($form_submit && !$this->isSafe() && !$this->isAjax());
    }
672640
public function isFormData()
    {
        return ($this->getContentType() == '' && $this->getOriginalMethod() === static::METHOD_POST) || in_array($this->getMediaType(), self::$formDataMediaTypes);
    }
668327
private function checkFormIdInSession()
    {
        if (!isset($_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID])) {
            return false;
        }

        if (!$_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID] === $this->formId) {
            return false;
        }

        return true;
    }
1178050
public function define(Form $form)
    {
        $this->namespaces = new PriorityQueue();
        $this->namespaces->insert('Windwalker\Form\Field', PriorityQueue::NORMAL);

        $this->bootTraits($this);

        $this->form = $form;

        $this->doDefine($form);
    }
168142
private function fetchForm() : bool
    {
        // Get the field keys
        $form_key = preg_grep('/^form_' . preg_quote($this->name, '/') . '_[a-f0-9]+$/', array_keys($_SESSION));
        if (empty($form_key)) {
            return false;
        }
        $this->key = array_values($form_key)[0];

        // Save properties
        foreach ($_SESSION[$this->key] as $key => $value) {
            if (substr($key, -2) === '[]') {
                $this->keys[substr($key, 0, -2)] = $value;
            } else {
                $this->keys[$key] = $value;
            }
        }
        return true;
    }
122088
public function forms()
    {
        if (null === $this->forms) {
            $header = $this->header();

            // Call event to allow filling the page header form dynamically (e.g. use case: Comments plugin)
            $grav = Grav::instance();
            $grav->fireEvent('onFormPageHeaderProcessed', new Event(['page' => $this, 'header' => $header]));

            $rules = $header->rules ?? null;
            if (!\is_array($rules)) {
                $rules = [];
            }

            $forms = [];

            // First grab page.header.form
            $form = $this->normalizeForm($header->form ?? null, null, $rules);
            if ($form) {
                $forms[$form['name']] = $form;
            }

            // Append page.header.forms (override singular form if it clashes)
            $headerForms = $header->forms ?? null;
            if (\is_array($headerForms)) {
                foreach ($headerForms as $name => $form) {
                    $form = $this->normalizeForm($form, $name, $rules);
                    if ($form) {
                        $forms[$form['name']] = $form;
                    }
                }
            }

            $this->forms = $forms;
        }

        return $this->forms;
    }
1276117
protected function initForm()
    {
    	parent::initForm();
    	
    	$this->form->setName($this->formName);
    	
		$actions = tao_helpers_form_FormFactory::getCommonActions('top');
		$this->form->setActions($actions, 'top');
		$this->form->setActions($actions, 'bottom');
    }
1103450
public function nameExists()
    {
        $name = (string) $this->getRequiredParameter('name');
        if (empty($name))
            return false;

        return array_key_exists($name, $this->_imageNames);
    }