Finishes rendering a form, called after processing contained elements

@param    HTML_QuickForm2_Node    Form being rendered
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
        ));
    }
710194
public void handleFormElements(List<FormInput> formInputs) {
		try {
			Document dom = DomUtils.asDocument(browser.getStrippedDomWithoutIframeContent());
			for (FormInput input : formInputs) {
				LOGGER.debug("Filling in: " + input);
				setInputElementValue(formInputValueHelper.getBelongingNode(input, dom), input);
			}
		} catch (IOException | XPathExpressionException e) {
			LOGGER.error(e.getMessage(), e);
		}

	}
235919
public function RenderEnd () {
		$this->PreDispatch();
		$this->SetFormTagRenderingStatus(FALSE);
		$result = '</form>'
			. $this->RenderSupportingJs()
			. $this->RenderSupportingCss();
		$this->cleanSessionErrorsAfterRender();
		return $result;
	}
856986
public function on_elements_end() {

        foreach ($this->mappings as $mapping) {
            $this->write_xml('workshopform_numerrors_map', $mapping, array('/workshopform_numerrors_map/id'));
        }

        foreach ($this->dimensions as $dimension) {
            $this->write_xml('workshopform_numerrors_dimension', $dimension, array('/workshopform_numerrors_dimension/id'));
        }
    }
958717
public function display() {
        global $OUTPUT, $PAGE;
        // Finalize the form definition if not yet done.
        if (!$this->_definition_finalized) {
            $this->_definition_finalized = true;
            $this->definition_after_data();
        }

        $mform = $this->_form;

        // Add "This form has required fields" text in the bottom of the form.
        if (($mform->_required || $this->hasrequired) &&
               ($this->mode == self::MODE_COMPLETE || $this->mode == self::MODE_PRINT || $this->mode == self::MODE_VIEW_TEMPLATE)) {
            $element = $mform->addElement('static', 'requiredfields', '',
                    get_string('somefieldsrequired', 'form',
                            $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'))));
            $element->setAttributes($element->getAttributes() + ['class' => 'requirednote']);
        }

        // Reset _required array so the default red * are not displayed.
        $mform->_required = array();

        // Move buttons to the end of the form.
        if ($this->mode == self::MODE_COMPLETE) {
            $mform->addElement('hidden', '__dummyelement');
            $buttons = $mform->removeElement('buttonar', false);
            $mform->insertElementBefore($buttons, '__dummyelement');
            $mform->removeElement('__dummyelement');
        }

        $this->_form->display();

        if ($this->mode == self::MODE_EDIT) {
            $PAGE->requires->js_call_amd('mod_feedback/edit', 'setup');
        }
    }
775717
public function removeChild(HTML_QuickForm2_Node $element)
    {

        if ($element->getContainer() !== $this) {
            throw new HTML_QuickForm2_NotFoundException(
                "Element with name '".$element->getName()."' was not found"
            );
        }
        foreach ($this as $key => $child){
            if ($child === $element) {
                unset($this->elements[$key]);
                $element->setContainer(null);
                break;
            }
        }
        return $element;
    }
632807
final public function populateFormOnce()
    {
        if (!$this->_formPopulated) {
            if (!empty($this->controller) && $this->controller->propagateId()) {
                $this->form->addElement(
                    'hidden', HTML_QuickForm2_Controller::KEY_ID,
                    array('id' => HTML_QuickForm2_Controller::KEY_ID)
                )->setValue($this->controller->getId());
            }
            $this->populateForm();
            $this->_formPopulated = true;
        }
    }
158986
function () {
        var self = this, settings = self.settings, id = self.id, suffix = self.suffix;

        function readyHandler() {
          DOM.unbind(window, 'ready', readyHandler);
          self.render();
        }

        // Page is not loaded yet, wait for it
        if (!Event.domLoaded) {
          DOM.bind(window, 'ready', readyHandler);
          return;
        }

        // Element not found, then skip initialization
        if (!self.getElement()) {
          return;
        }

        // No editable support old iOS versions etc
        if (!Env.contentEditable) {
          return;
        }

        // Hide target element early to prevent content flashing
        if (!settings.inline) {
          self.orgVisibility = self.getElement().style.visibility;
          self.getElement().style.visibility = 'hidden';
        } else {
          self.inline = true;
        }

        var form = self.getElement().form || DOM.getParent(id, 'form');
        if (form) {
          self.formElement = form;

          // Add hidden input for non input elements inside form elements
          if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(self.getElement().nodeName)) {
            DOM.insertAfter(DOM.create('input', { type: 'hidden', name: id }), id);
            self.hasHiddenInput = true;
          }

          // Pass submit/reset from form to editor instance
          self.formEventDelegate = function (e) {
            self.fire(e.type, e);
          };

          DOM.bind(form, 'submit reset', self.formEventDelegate);

          // Reset contents in editor when the form is reset
          self.on('reset', function () {
            self.setContent(self.startContent, { format: 'raw' });
          });

          // Check page uses id="submit" or name="submit" for it's submit button
          if (settings.submit_patch && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) {
            form._mceOldSubmit = form.submit;
            form.submit = function () {
              self.editorManager.triggerSave();
              self.setDirty(false);

              return form._mceOldSubmit(form);
            };
          }
        }

        /**
         * Window manager reference, use this to open new windows and dialogs.
         *
         * @property windowManager
         * @type tinymce.WindowManager
         * @example
         * // Shows an alert message
         * tinymce.activeEditor.windowManager.alert('Hello world!');
         *
         * // Opens a new dialog with the file.htm file and the size 320x240
         * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog.
         * tinymce.activeEditor.windowManager.open({
         *    url: 'file.htm',
         *    width: 320,
         *    height: 240
         * }, {
         *    custom_param: 1
         * });
         */
        self.windowManager = new WindowManager(self);

        /**
         * Notification manager reference, use this to open new windows and dialogs.
         *
         * @property notificationManager
         * @type tinymce.NotificationManager
         * @example
         * // Shows a notification info message.
         * tinymce.activeEditor.notificationManager.open({text: 'Hello world!', type: 'info'});
         */
        self.notificationManager = new NotificationManager(self);

        if (settings.encoding == 'xml') {
          self.on('GetContent', function (e) {
            if (e.save) {
              e.content = DOM.encode(e.content);
            }
          });
        }

        if (settings.add_form_submit_trigger) {
          self.on('submit', function () {
            if (self.initialized) {
              self.save();
            }
          });
        }

        if (settings.add_unload_trigger) {
          self._beforeUnload = function () {
            if (self.initialized && !self.destroyed && !self.isHidden()) {
              self.save({ format: 'raw', no_events: true, set_dirty: false });
            }
          };

          self.editorManager.on('BeforeUnload', self._beforeUnload);
        }

        // Load scripts
        function loadScripts() {
          var scriptLoader = ScriptLoader.ScriptLoader;

          if (settings.language && settings.language != 'en' && !settings.language_url) {
            settings.language_url = self.editorManager.baseURL + '/langs/' + settings.language + '.js';
          }

          if (settings.language_url) {
            scriptLoader.add(settings.language_url);
          }

          if (settings.theme && typeof settings.theme != "function" &&
            settings.theme.charAt(0) != '-' && !ThemeManager.urls[settings.theme]) {
            var themeUrl = settings.theme_url;

            if (themeUrl) {
              themeUrl = self.documentBaseURI.toAbsolute(themeUrl);
            } else {
              themeUrl = 'themes/' + settings.theme + '/theme' + suffix + '.js';
            }

            ThemeManager.load(settings.theme, themeUrl);
          }

          if (Tools.isArray(settings.plugins)) {
            settings.plugins = settings.plugins.join(' ');
          }

          each(settings.external_plugins, function (url, name) {
            PluginManager.load(name, url);
            settings.plugins += ' ' + name;
          });

          each(settings.plugins.split(/[ ,]/), function (plugin) {
            plugin = trim(plugin);

            if (plugin && !PluginManager.urls[plugin]) {
              if (plugin.charAt(0) == '-') {
                plugin = plugin.substr(1, plugin.length);

                var dependencies = PluginManager.dependencies(plugin);

                each(dependencies, function (dep) {
                  var defaultSettings = {
                    prefix: 'plugins/',
                    resource: dep,
                    suffix: '/plugin' + suffix + '.js'
                  };

                  dep = PluginManager.createUrl(defaultSettings, dep);
                  PluginManager.load(dep.resource, dep);
                });
              } else {
                PluginManager.load(plugin, {
                  prefix: 'plugins/',
                  resource: plugin,
                  suffix: '/plugin' + suffix + '.js'
                });
              }
            }
          });

          scriptLoader.loadQueue(function () {
            if (!self.removed) {
              self.init();
            }
          }, self, function (urls) {
            ErrorReporter.pluginLoadError(self, urls[0]);

            if (!self.removed) {
              self.init();
            }
          });
        }

        self.editorManager.add(self);
        loadScripts();
      }
192939
function finishForm(&$form)
    {
        // add a required note, if one is needed
        if (!empty($form->_required) && !$form->_freezeAll) {
            $this->_html .= str_replace('{requiredNote}', $form->getRequiredNote(), $this->_requiredNoteTemplate);
        }
        // add form attributes and content
        $html = str_replace('{attributes}', $form->getAttributes(true), $this->_formTemplate);
        if (strpos($this->_formTemplate, '{hidden}')) {
            $html = str_replace('{hidden}', $this->_hiddenHtml, $html);
        } else {
            $this->_html .= $this->_hiddenHtml;
        }
        $this->_hiddenHtml = '';
        $this->_html = str_replace('{content}', $this->_html, $html);
        // add a validation script
        if ('' != ($script = $form->getValidationScript())) {
            $this->_html = $script . "\n" . $this->_html;
        }
    }
39372
public function process()
    {
        parent::process();

        if ($this->show_check_all) {
            $this->check_all->process();
        }

        // this is part of the old selection API
        $item_name = $this->getCheckboxRendererId();
        if (isset($_POST[$item_name]) && is_array($_POST[$item_name])) {
            $this->items = $_POST[$item_name];
        }
    }
804709
public function renderElement(HTML_QuickForm2_Node $element)
    {
        $elTpl = $this->prepareTemplate($this->findTemplate($element), $element);
        $this->html[count($this->html) - 1][] = str_replace(array('{element}', '{id}'),
                                                            array($element, $element->getId()), $elTpl);
    }
1363441
public function renderRows()
    {
        // precache template chunks
        $this->precacheTemplate();

        // extend CompleteLister renderRows method
        parent::renderRows();

        // if we have at least one data row rendered, then remove not_found message
        if ($this->total_rows) {
            $this->template->del('not_found');
        } elseif ($this->no_records_message) {
            $this->template->del('header');
            $this->template->set('not_found_message', $this->no_records_message);
        }
    }
1335338
public function RenderBegin () {
		$this->form->PreDispatch();
		$result = "<form";
		$attrs = [];
		$form = & $this->form;
		// standard attributes
		$formProperties = ['id', 'action', 'method', 'enctype', 'target'];
		foreach ($formProperties as $property) {
			$getter = 'Get'.ucfirst($property);
			$formPropertyValue = $form->$getter();
			if ($formPropertyValue !== NULL)
				$attrs[$property] = $formPropertyValue;
		}
		// css classes
		$formCssClasses = $form->GetCssClasses();
		if ($formCssClasses)
			$attrs['class'] = gettype($formCssClasses) == 'array'
				? implode(' ', (array) $formCssClasses)
				: $formCssClasses;
		// additional custom attributes completing
		foreach ($form->GetAttributes() as $key => $value) {
			if (!in_array($key, $formProperties))
				$attrs[$key] = $value;
		}
		// pseudo-boolean attributes completing
		$formAutoComplete = $form->GetAutoComplete();
		if ($formAutoComplete !== NULL) 
			$attrs['autocomplete'] = $formAutoComplete ? 'on' : 'off';
		$formNoValidate = $form->GetNoValidate();
		if ($formNoValidate === TRUE)
			$attrs['novalidate'] = 'novalidate';
		$formAcceptCharsets = $form->GetAcceptCharsets();
		if (count($formAcceptCharsets) > 0) 
			$attrs['accept-charset'] = implode(' ', $formAcceptCharsets);
		// boolean and additional attributes
		$attrsStr = self::RenderAttrs($attrs);
		if ($attrsStr) $result .= ' ' . $attrsStr;
		$result .= '>';
		$this->form->SetFormTagRenderingStatus(TRUE);
		$result .= $this->RenderCsrf();
		return $result;
	}
30907
function render(form, template) {
  const compiledRowTemplate = handlebars.compile(
    '<tr class="form-element">' +
      '<td class="key">{{key}}</td>' +
      '<td class="value">{{value}}</td>' +
    '</tr>');
  const compiledTable = handlebars.compile(
    '<table><tbody>{{{rows}}}</tbody></table>');
  const compiledTemplate = handlebars.compile(template);

  const formElements = form.map(({key, value}) => {
    if (key !== 'File') {
      return compiledRowTemplate({key, value: unescape(value)});
    }

    return null;
  });

  const formData = compiledTable({rows: formElements.join(' ')});

  return compiledTemplate({formData});
}
554710
public function addForm(QuickForm2 $form)
    {

        // assign array with form data
        $this->assign('form_data', $form->getFormData());
        $this->assign('element_list', $form->getElementList());
    }
1002330
def render_has_many_form(form_builder, parent, &block)
      index = parent && form_builder.send(:parent_child_index, parent)
      template.concat template.capture { yield(form_builder, index) }
      template.concat has_many_actions(form_builder, "".html_safe)
    end
18979
public function renderView()
    {
        if ($this->form) {
            $this->template->trySet('name', $this->short_name);
        }

        parent::renderView();
    }