Sets the form currently being processed

@param HTML_QuickForm2
969675
public function startForm(HTML_QuickForm2 $form)
    {
        $this->formId = $form->getId();
        $this->rules[$this->formId] = array();
    }
216185
public function form($form = null)
    {
        if (func_num_args() === 1) {
            $form = $form ?: [];
            $this->_form = $form;
            $this->set($form);
            return $this;
        }
        return $this->_form;
    }
751779
public function HTML_QuickForm_radio($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null) {
        debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
        self::__construct($elementName, $elementLabel, $text, $value, $attributes);
    }
1019977
public function setForm(Form $form)
	{
		$this->form = $form;
		$this->formControl = $form->getFormControl();

		return $this;
	}
481310
public function finishForm(HTML_QuickForm2_Node $form)
    {
        $formTpl = str_replace(
            array('{attributes}', '{hidden}', '{errors}'),
            array($form->getAttributes(true), $this->hiddenHtml,
                  $this->outputGroupedErrors()),
            $this->findTemplate($form, '{content}')
        );
        $this->hiddenHtml = '';

        // required note
        if (!$this->hasRequired || $form->toggleFrozen() ||
            empty($this->options['required_note']))
        {
            $formTpl = preg_replace('!<qf:reqnote>.*</qf:reqnote>!isU', '', $formTpl);
        } else {
            $formTpl = str_replace(
                array('<qf:reqnote>', '</qf:reqnote>', '{reqnote}'),
                array('', '', $this->options['required_note']),
                $formTpl
            );
        }

        $break         = HTML_Common2::getOption('linebreak');
        $script        = $this->getJavascriptBuilder()->__toString();
        $this->html[0] = array((empty($script)? '': $script . $break) . str_replace(
            '{content}', $break . implode($break, $this->html[0]), $formTpl
        ));
    }
432714
public static void loadActionForm(JspContext jspContext, Object form) {
        jspContext.setAttribute(ACTION_FORM_IMPLICIT_OBJECT_KEY, unwrapForm(form));
    }
91915
protected void initializeForm() {

        String target = CmsSitemapView.getInstance().getController().getData().getAliasImportUrl();
        m_formPanel.setAction(target);
        m_formPanel.setMethod(FormPanel.METHOD_POST);
        m_formPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
        Hidden siteRootField = new Hidden(I_CmsAliasConstants.PARAM_SITEROOT);
        siteRootField.setValue(CmsCoreProvider.get().getSiteRoot());
        m_formPanelContents.add(siteRootField);
        m_formPanelContents.add(m_separatorField);
        m_formPanel.addSubmitCompleteHandler(new SubmitCompleteHandler() {

            public void onSubmitComplete(SubmitCompleteEvent event) {

                final String formPostResults = event.getResults();
                final I_CmsSitemapServiceAsync service = CmsSitemapView.getInstance().getController().getService();
                CmsRpcAction<List<CmsAliasImportResult>> action = new CmsRpcAction<List<CmsAliasImportResult>>() {

                    @Override
                    public void execute() {

                        start(200, false);
                        service.getAliasImportResult(formPostResults.trim(), this);
                    }

                    @Override
                    public void onResponse(List<CmsAliasImportResult> result) {

                        stop(false);
                        handleImportResults(result);
                        Timer resizeTimer = new Timer() {

                            @Override
                            public void run() {

                                m_scrollPanel.onResizeDescendant();
                            }
                        };
                        resizeTimer.schedule(100);
                    }
                };
                action.execute();
            }
        });
    }
69839
public function renderElement(\HTML_QuickForm2_Node $element) {
        $ary = $this->buildCommonFields($element) + [
                'html'              => $element->__toString(),
                'value'             => $element->getValue(),
                'type'              => $element->getType(),
                'label'             => $element->getLabel(),
                'desc'              => $element->getDesc(),
                'example'           => $element->getExample(),
                'placeholder'       => $element->getPlaceholder(),
                'example_is_append' => $element->getExampleIsAppend(),
                'prepend'           => $element->getPrepend(),
                'append'            => $element->getAppend(),
                'tpl'               => $element->getTpl(),
                'required'          => $element->isRequired(),
                'is_inline'         => $element->getIsInline(),
                'wrap_class'        => $element->getWrapClass(),
                'checked'           => $element->getAttribute('checked'),
            ];
        $this->pushScalar($ary);
    }
53223
protected function beforeRenderFormType()
    {
        $controller = $this->_controller();

        $controller->set('formEnableDirtyCheck', $this->_getFormEnableDirtyCheck());
        $controller->set('formSubmitButtonText', $this->_getFormSubmitButtonText());
        $controller->set('formSubmitExtraButtons', $this->_getFormSubmitExtraButtons());
        $controller->set('formSubmitExtraLeftButtons', $this->_getFormSubmitExtraLeftButtons());
        $controller->set('formUrl', $this->_getFormUrl());
    }
555549
protected function InitForm()
    {
        $this->block = $this->LoadElement();
        $this->AddTagNameField();
        $this->AddCssClassField();
        $this->AddCssIDField();
        $this->AddSubmit();
    }
1003817
public function editFormSucceeded(Form $form, ArrayHash $values): void
	{
		if ($this->page) {
			$page = $this->page;
			$isNew = false;
		} else {
			$page = new Page;
			$this->orm->pages->attach($page);
			$isNew = true;
		}

		if (($this->editHomePage ?
			$values->homePage
			: ($isNew ? false : $page->isHomePage))
		) {
			$page->parent = null;
			$page->isLink = false;
			$values->url = null;
			$values->views = [];
			$values->name = $this->translate('webManager.web.pages.homePage');
		} else {
			$page->parent = $values->parent;
			$page->isLink = $values->isLink;
			$values->url = $values->url ?: Strings::webalize($values->name);
		}

		$page->locale = $values->locale;

		try {
			$page->setUrl($values->url);
		} catch (UniqueConstraintViolationException $ex) {
			$form->addError('webManager.web.pages.urlExists');
			return;
		} catch (InvalidArgumentException $ex) {
			$form->addError('webManager.web.pages.urlContainsInvalidCharacters');
			return;
		}

		$page->name = $values->name;
		$page->title = $values->title;
		$page->keywords = $values->keywords;
		$page->image = $values->image;
		$page->background = $values->background;
		$page->description = $values->description;
		$page->content = $values->content;
		$page->views->set($values->views);

		if ($isNew) {
			$gallery = $this['gallery'];
			$gallery->changeNamespace('page/' . $page->url);
			$page->addImages($gallery->getImages());
			$gallery->clearTemp();
		}

		$this->orm->persistAndFlush($page);
		$this->restoreBacklink();
	}
765775
function process_form($form, &$preferences){
        global $CFG;

        if (isset($form->email_email)) {
            $preferences['message_processor_email_email'] = clean_param($form->email_email, PARAM_EMAIL);
        }
        if (isset($form->preference_mailcharset)) {
            $preferences['mailcharset'] = $form->preference_mailcharset;
            if (!array_key_exists($preferences['mailcharset'], get_list_of_charsets())) {
                $preferences['mailcharset'] = '0';
            }
        }
        if (isset($form->mailformat) && isset($form->userid)) {
            require_once($CFG->dirroot.'/user/lib.php');

            $user = core_user::get_user($form->userid, '*', MUST_EXIST);
            $user->mailformat = clean_param($form->mailformat, PARAM_INT);
            user_update_user($user, false, false);
        }
    }
579667
protected function execUpdateForm()
    {
        // form translations
        $this->loadTranslations('form', sprintf('private/global/locales/%s/form.ini', LANGUAGE));
        // get record
        $this->templateParameters['record'] = $this->getByPrimaryKey($this->primaryKeyValue);
        // render template
        $this->renderTemplate(sprintf('%s/%s/save-form', AREA, $this->name));
    }
1075247
public function editAction()
    {
        if ($form = $this->processForm()) {
            if ($this->useTabbedForms && method_exists($this, 'getSubject')) {
                $data = $this->getModel()->loadFirst();
                $subject = $this->getSubject($data);
                $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));
            } else {
                $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));
            }
            $this->html[] = $form;
        }
    }
1277855
protected function InitForm()
    {
        $this->submit = $this->LoadElement();
        
        $this->AddNameField();
        $this->AddValueField();
        
        $this->AddCssIDField();
        $this->AddCssClassField();
        $this->AddTemplateField();
        $this->AddSubmit();
    }
997334
public function set_element_type($element, $type) {
        if ($element instanceof HTML_QuickForm_element) {
            $element = $element->getName();
        }
        $this->_form->setType($element, $type);
    }
158975
function() {
        var form = this.element.find('form:first');

        if (!form) {
            return;
        }

        this.fireEvent('submit', [form]);

        var options = {
            url: form.attr('action'),
            type: (form.attr('method') || 'post').toUpperCase()
        };

        if (window.FormData) {
            options.processData = false;
            options.contentType = false;
            options.data = new FormData(form[0]);
        } else {
            options.data = form.serialize();
        }

        this.requestData(options);
    }