Render ReCaptcha form elements

@param  ElementInterface $element
@throws Exception\DomainException
@return string
559154
public function render(ElementInterface $element)
    {
        $attributes = $element->getAttributes();
        $captcha = $element->getCaptcha();

        if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {
            throw new Exception\DomainException(sprintf(
                '%s requires that the element has a "captcha" is an instance of LosReCaptcha\Captcha\ReCaptcha',
                __METHOD__
            ));
        }

        $name          = $element->getName();
        $id            = isset($attributes['id']) ? $attributes['id'] : $name;
        $responseName  = empty($name) ? 'recaptcha_response_field' : $name . '[recaptcha_response_field]';
        $responseId    = $id . '-response';

        $markup = $captcha->getService()->getHtml($name);
        $hidden = $this->renderHiddenInput($responseName, $responseId);
        $js     = $this->renderJsEvents($responseId);

        return $hidden . $markup . $js;
    }
579878
public function afterElementDelete (ElementInterface $element)
	{
		SimpleMap::getInstance()->map->softDeleteField($this, $element);
		parent::afterElementDelete($element);
	}
891199
public function renderElement($element)
    {
        if (is_string($element)) {
            if (($e = $this[$element]) === null && ($e = $this->getButtons()->itemAt($element)) === null) {
                return $element;
            } else {
                $element = $e;
            }
        }
        if ($element->getVisible()) {
            if ($element instanceof CFormInputElement) {
                if ($element->type === 'hidden') {
                    return TbHtml::tag('div', array('class' => 'hidden'), $element->render());
                }
            }
            return $element->render();
        }
        return '';
    }
930415
protected function renderLabel(ElementInterface $element)
    {
        $label = $element->getLabel();
        if (null === $label) {
            $label = $element->getOption('label') ? : $element->getAttribute('label');
        }
        if ($label) {
            $element->setLabelAttributes(['class' => 'control-label']);
            return $this->getLabelHelper()->__invoke($element, $label);
        }
        return null;
    }
723228
public function getContentForElement(Element $element) : string
    {
        if ($element instanceof HasChildren && $element instanceof HasContent) {
            throw new InvalidArgumentException('An element can only implement one of HasChildren and HasContent');
        }

        if ($element instanceof HasChildren) {
            $renderedChildren = array_map(function(Element $element) {
                return $this->renderElement($element);
            }, $element->getChildren());

            return implode('', $renderedChildren);
        }

        if ($element instanceof HasContent) {
            return $element->getContent();
        }

        return '';
    }
85322
public function render( ElementInterface $element )
    {
        if ( ! $element instanceof Properties )
        {
            throw new Exception\InvalidArgumentException( sprintf(
                '%s requires that the element is of type Grid\Customize\Form\Element\Properties',
                __METHOD__
            ) );
        }

        $name = $element->getName();
        if ( empty( $name ) && $name !== 0 )
        {
            throw new Exception\DomainException( sprintf(
                '%s requires that the element has an assigned name; none discovered',
                __METHOD__
            ) );
        }

        $attributes = $element->getAttributes();
        $value      = (array) $element->getValue();
        $addAttr    = array(
            'name'      => $name,
            'required'  => empty( $attributes['required'] ) ? null : 'required',
        );

        unset( $attributes['name'] );
        unset( $attributes['required'] );
        $this->validTagAttributes = $this->validContainerAttributes;
        return sprintf(
            '<dl %s>%s</dl>',
            $this->createAttributesString( $attributes ),
            $this->renderProperties( $value, $addAttr )
        );
    }
1274145
public function render(ElementInterface $element)
    {
        /* @var $element DisableElementsCapableFormSettings
         * @var $renderer   \Zend\View\Renderer\PhpRenderer
         * @var $headscript \Zend\View\Helper\HeadScript
         * @var $basepath   \Zend\View\Helper\BasePath */
        $renderer   = $this->getView();
        $headscript = $renderer->plugin('headscript');
        $basepath   = $renderer->plugin('basepath');

        $headscript->appendFile($basepath('modules/Settings/js/forms.decfs.js'));

        return '<ul class="disable-elements-list" id="' . $element->getAttribute('id') . '-list"' . '>'
               . $this->renderCheckboxes($element->getCheckboxes())
               . '</ul>';
    }
790690
protected function renderElementIcon(ElementInterface $element)
    {
        $render = '';
        $icon   = $element->getOption('icon');
        if ($icon) {
            $iconHelper = $this->getIconHelper();
            $render     = $iconHelper($icon);
        }
        return $render;
    }
844272
protected function renderLabel(ElementInterface $element)
    {
        $labelPlugin = $this->getView()->plugin('sxb_form_control_label');
        $label       = $element->getLabel();

        if (null !== $label) {
            $label = $labelPlugin($label, $element->getName(), $element->getLabelAttributes());
        }

        return $label;
    }
301889
protected static function getName( ElementInterface $element )
    {
        $name = $element->getName();

        if ( $name === null || $name === '' )
        {
            throw new Exception\DomainException( sprintf(
                '%s requires that the element has an assigned name; none discovered',
                __METHOD__
            ) );
        }

        return $name . '[]';
    }
854651
protected function renderType(ElementInterface $element)
    {
        $value = $this->getElementValue($element);
        $type  = gettype($value);

        if (isset($this->typeMap[$type])) {
            return $this->renderHelper($this->typeMap[$type], $value, $element);
        }

        return;
    }
777305
protected function getJavascriptNodeName(ElementInterface $element)
    {
        $class = $this->getElementClass($element);
        $parts = explode('\\', $class);

        return 'GForm' . end($parts);
    }
55574
public function convert(ElementInterface $element)
    {
        $lines = explode("\n", $element->getValue());

        foreach ($lines as $key => $line)
        {
            $lines[$key] = trim($lines[$key]);
        }

        $lines = array_filter($lines);

        return "\n" . implode("\n", (array) $lines);
    }
1001823
public function getPreviewHtml(BBcodeElementNodeInterface $el)
    {
        if (!$this->hasValidInputs($el)) {
            return $el->getAsBBCode();
        }

        $html = $this->getReplacementText();

        if ($this->usesOption()) {
            $options = $el->getAttribute();
            if (count($options) == 1) {
                $vals = array_values($options);
                $html = str_ireplace('{option}', reset($vals), $html);
            } else {
                foreach ($options as $key => $val) {
                    $html = str_ireplace('{' . $key . '}', $val, $html);
                }
            }
        }

        $content = $this->getPreviewContent($el);
        $html = str_ireplace('{param}', $content, $html);

        return $html;
    }
254778
public function render(ElementInterface $element)
    {
        // Set class
        $class = $element->getAttribute('class');
        if ($class) {
            $class .= ' ';
        }
        $element->setAttribute('class', $class . 'form-control');

        // Set placeholder
        $placeholder = $element->getAttribute('placeholder');
        if (!$placeholder) {
            $element->setAttribute('placeholder', $element->getLabel());
        }

        return parent::render($element);
    }
103390
public function _getElementHtml(
        \Magento\Framework\Data\Form\Element\AbstractElement $element
    ) {
        $element->setData('readonly', 1);
        $element->setData('class', 'ddg-dynamic-content');
        return parent::_getElementHtml($element);
    }
1210372
public function validateMatchesRegex(ElementInterface $element, array $params = null)
    {
        $value = $element->getFieldValue($this->handle);
        $match = preg_match($this->inputMask, $value);
        if ($match !== 1)
        {
            $element->addError($this->handle, Craft::t('site', $this->errorMessage));
        }
    }