Renders hidden form fields for referrer information about
the current request.

@return string Hidden fields with referrer information
328987
protected function renderHiddenReferrerFields()
    {
        $tagBuilder = new TagBuilder('input');
        $tagBuilder->addAttribute('type', 'hidden');
        $tagBuilder->addAttribute('name', $this->prefixFieldName('__state'));
        /** @var FormRuntime $formRuntime */
        $formRuntime = $this->arguments['object'];
        $tagBuilder->addAttribute('value', $formRuntime->getSerializedFormState());
        return $tagBuilder->render();
    }
929378
public function render()
	{
		switch ($this->getContext()) {
			case BaseField::CONTEXT_LIST:
				$values = [];
				foreach ($this->getValue() as $item) {
					$values[] = $item->{$this->getDisplayField()};
				}

				return implode(', ', $values);

				break;
			case BaseField::CONTEXT_FORM:

				$baseModel  = $this->getAdmin()->getModel();
				$baseModel  = new $baseModel;
				$primaryKey = $baseModel->getKeyName();

				$relatedModel = $baseModel->{$this->getName()}()->getRelated();
				$relatedModel = get_class($relatedModel);

				$items = [];
				foreach ($relatedModel::all() as $item) {
					$items[$item->{$primaryKey}] = $item->{$this->getDisplayField()};
				}

				$id = $this->getAdmin()->getFormBuilder()->getIdentifier();

				$values = [];
				foreach ($relatedModel::where(Str::singular($baseModel->getTable()) . '_id', $id)->get() as $item) {
					$values[] = (string) $item->{$primaryKey};
				}

				return View::make('krafthaus/bauhaus::models.fields._has_many')
					->with('field',  $this)
					->with('items',  $items)
					->with('values', $values);

				break;
		}
	}
276564
protected function renderTrustedPropertiesField()
    {
        $formFieldNames = $this->viewHelperVariableContainer->get(\Neos\FluidAdaptor\ViewHelpers\FormViewHelper::class, 'formFieldNames');
        $requestHash = $this->mvcPropertyMappingConfigurationService->generateTrustedPropertiesToken($formFieldNames, $this->getFieldNamePrefix());
        return '<input type="hidden" name="' . $this->prefixFieldName('__trustedProperties') . '" value="' . htmlspecialchars($requestHash) . '" />' . chr(10);
    }
23888
protected function fieldfillers() {

		$fieldrender = $this->fieldrender();

		if ($this->hintrenderer !== null) {
			$callable = &$this->hintrenderer;
			$hintsrender = $callable($this->hints());
		}
		else { # no hint renderer
			$hintsrender = null;
		}

		if ($this->showerrors && $this->errorrenderer) {
			$callable = &$this->errorrenderer;
			$errorrrender = $callable($this->errors());
		}
		else { # no error renderer
			$errorrrender = null;
		}

		return array
			(
				':id'     => $this->get('id', null),
				':field'  => $fieldrender,
				':label'  => $this->fieldlabel(),
				':hints'  => $hintsrender,
				':errors' => $errorrrender,
			);
	}
1213880
public function render(): string
    {
        $view = $this->viewFactory->make($this->getView(), $this->getFieldData());

        // Indicates that the form has been rendered at least once.
        // Then return its content.
        $this->rendered = true;

        return $view->render();
    }
1149837
protected function renderRequestInfo()
    {
        $output = '';
        if ($this->requestInformationRenderer !== null) {
            $output = $this->requestInformationRenderer->__invoke();
        }

        return $output;
    }
926108
public function hiddenFormFields()
    {
        $fields = $this->getParameter('fields');

        if (empty($fields))
            return '';

        $html_array = ArrayUtils::htmlArrayFlatten($fields);

        foreach ($html_array as $name => $value) {
            $name  = htmlentities($name, ENT_QUOTES);
            $value = htmlentities($value, ENT_QUOTES);

            $output[] = "<input type=\"hidden\" name=\"$name\" value=\"$value\" />";
        }

        return join("\n", $output);
    }
1234750
public function addReferrerToForm(FormInterface $form): void
    {
        $request = $this->get('request_stack')->getCurrentRequest();
        $form->add('http-referrer', HiddenType::class, [
            'mapped' => false,
            'data' => $request->headers->get('referer'),
        ]);
    }
1044165
public function getCMSFields() {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            "Root.Main",
            array(
                OptionsetField::create(
                    'Status',
                    'Status',
                    array(
                        "1" => "Active",
                        "0" => "Disabled"
                    ),
                    1
                ),
                TextField::create(
                    'AdminTitle'
                )
                ->setDescription('This field is for adminisration use only and will not display on the site.'),
                TextareaField::create(
                    'Title',
                    'Title'
                )
                ->setRows(2),
                TextareaField::create(
                    'Content',
                    'Content'
                ),
                UploadField::create(
                    'Image',
                    'Image'
                )->setFolderName('Banner')
            )
        );
        $linksGridConfig = GridFieldConfig_RelationEditor::create();
        if ($this->Links()->Count() > 0) {
            $linksGridConfig->addComponent(new GridFieldOrderableRows());
        }
        $fields->addFieldToTab(
            'Root.Links',
            GridField::create(
                'Links',
                'Link(s)',
                $this->Links(),
                $linksGridConfig
            )
        );
        $this->extend('updateCMSFields', $fields);
        return $fields;
    }
1268967
protected function renderHiddenActionUriQueryParameters()
    {
        $result = '';
        $actionUri = $this->getFormActionUri();
        $query = parse_url($actionUri, PHP_URL_QUERY);

        if (is_string($query)) {
            $queryParts = explode('&', $query);
            foreach ($queryParts as $queryPart) {
                if (strpos($queryPart, '=') !== false) {
                    list($parameterName, $parameterValue) = explode('=', $queryPart, 2);
                    $result .= chr(10) . '<input type="hidden" name="' . htmlspecialchars(urldecode($parameterName)) . '" value="' . htmlspecialchars(urldecode($parameterValue)) . '" />';
                }
            }
        }
        return $result;
    }
1274761
protected function getFormFields()
    {
        $request = $this->getRequest();
        if ($request->getVar('BackURL')) {
            $backURL = $request->getVar('BackURL');
        } else {
            $backURL = $request->getSession()->get('BackURL');
        }

        $label = Member::singleton()->fieldLabel(Member::config()->get('unique_identifier_field'));
        $fields = FieldList::create(
            HiddenField::create("AuthenticationMethod", null, $this->getAuthenticatorClass(), $this),
            // Regardless of what the unique identifer field is (usually 'Email'), it will be held in the
            // 'Email' value, below:
            // @todo Rename the field to a more generic covering name
            $emailField = TextField::create("Email", $label, null, null, $this),
            PasswordField::create("Password", _t('SilverStripe\\Security\\Member.PASSWORD', 'Password'))
        );
        $emailField->setAttribute('autofocus', 'true');

        if (Security::config()->get('remember_username')) {
            $emailField->setValue($this->getSession()->get('SessionForms.MemberLoginForm.Email'));
        } else {
            // Some browsers won't respect this attribute unless it's added to the form
            $this->setAttribute('autocomplete', 'off');
            $emailField->setAttribute('autocomplete', 'off');
        }
        if (Security::config()->get('autologin_enabled')) {
            $fields->push(
                CheckboxField::create(
                    "Remember",
                    _t('SilverStripe\\Security\\Member.KEEPMESIGNEDIN', "Keep me signed in")
                )->setAttribute(
                    'title',
                    _t(
                        'SilverStripe\\Security\\Member.REMEMBERME',
                        "Remember me next time? (for {count} days on this device)",
                        [ 'count' => RememberLoginHash::config()->uninherited('token_expiry_days') ]
                    )
                )
            );
        }

        if (isset($backURL)) {
            $fields->push(HiddenField::create('BackURL', 'BackURL', $backURL));
        }

        return $fields;
    }
869812
public function getRedirectReferer()
    {
        $redirect = $this->parameters->get('redirect');
        $referer = $this->request->headers->get('referer');

        if (!is_array($redirect) || empty($redirect['referer'])) {
            return $referer;
        }

        if ($redirect['referer'] === true) {
            return $referer;
        }

        return $redirect['referer'];
    }
672123
private function renderLinkForm()
    {
        $this->layout = '//layouts/main';

		$this->setPageTitle(Yii::t('HybridAuth.main', '{{app_name}} | {{label}}', array(
			'{{app_name}}' => Cii::getConfig('name', Yii::app()->name),
            '{{label}}'    => Yii::t('HybridAuth.main', 'Link Your Account')
		)));

        $form = new RemoteLinkAccountForm;

        if (Cii::get($_POST, 'RemoteLinkAccountForm', false))
        {
            // Populate the model
            $form->attributes = Cii::get($_POST, 'RemoteLinkAccountForm', false);
            $form->provider   = $this->getProvider();
            $form->adapter    = $this->getUserProfile();

            if ($form->save())
            {
                if ($this->authenticate())
                {
                    Yii::app()->user->setFlash('success', Yii::t('HybridAuth.main', 'You have successfully logged in via {{provider}}', array('{{provider}}' => $this->getProvider() )));
                    $this->redirect(Yii::app()->user->returnUrl);
                }
            }
        }

        // Reuse the register form
        $this->render('/linkaccount', array('model' => $form));
    }
789294
private function buildHiddenFields()
    {
        $this->debug->groupCollapsed(__METHOD__);
        $cfg = $this->form->cfg;
        $printOpts = &$cfg['output'];
        $hiddenFields = '';
        if ($printOpts['inputKey']) {   //  && $cfg['persist_method'] != 'none'
            $hiddenFields .= '<input type="hidden" name="_key_" value="'.\htmlspecialchars($this->keyValue).'" />';
        }
        if (\strtolower($cfg['attribs']['method']) == 'get') {
            $this->debug->warn('get method');
            $urlParts = \parse_url(\html_entity_decode($cfg['attribs']['action']));
            // $attribs['action'] = $urlParts['path'];
            if (!empty($urlParts['query'])) {
                \parse_str($urlParts['query'], $params);
                $fieldNames = array();
                foreach ($this->form->currentFields as $field) {
                    $fieldNames[] = $field->attribs['name'];
                }
                foreach ($params as $k => $v) {
                    if (\in_array($k, $fieldNames)) {
                        continue;
                    }
                    $hiddenFields .= '<input type="hidden" name="'.\htmlspecialchars($k).'" value="'.\htmlspecialchars($v).'" />'."\n";
                }
            }
        }
        $this->debug->log('hiddenFields', $hiddenFields);
        $this->debug->groupEnd();
        return $hiddenFields;
    }
45828
protected function renderCsrfTokenField()
    {
        if (strtolower($this->arguments['method']) === 'get') {
            return '';
        }
        if (!$this->securityContext->isInitialized() || !$this->authenticationManager->isAuthenticated()) {
            return '';
        }
        $csrfToken = $this->securityContext->getCsrfProtectionToken();
        return '<input type="hidden" name="__csrfToken" value="' . htmlspecialchars($csrfToken) . '" />' . chr(10);
    }
777717
public function renderSearchField()
    {
        $form = \Core::make('helper/form');

        return $form->text('keywords', isset($this->data['keywords']) ? $this->data['keywords'] : '');
    }
85207
public function render()
    {
        // Always add this class
        $this->addClass('time');

        // Create HTML string
        $html = parent::render();

        // Convert the value to a mysql friendly format or leave null.
        $mysql_date = $this->value ?
            date(Library\Utils\Constants::MYSQL_TIME, strtotime($this->value)) :
            null;

        // Add a hidden field that will contain the mysql value, for storing in db
        $html .= HtmlInput::hidden($this->name, $mysql_date)->id($this->name);

        // Return the string
        return $html;
    }