| Conditions | 6 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function render() |
||
| 34 | { |
||
| 35 | $fieldname = $this->arguments['fieldname']; |
||
| 36 | $prefillSettings = $this->arguments['prefillSettings']; |
||
| 37 | |||
| 38 | $request = $this->renderingContext->getRequest(); |
||
|
|
|||
| 39 | $registrationData = $request->getParsedBody()[$this->getPluginNamespace($request)] ?? []; |
||
| 40 | if (isset($registrationData['registration'][$fieldname])) { |
||
| 41 | return $registrationData['registration'][$fieldname]; |
||
| 42 | } |
||
| 43 | |||
| 44 | if (!isset($GLOBALS['TSFE']) || !$GLOBALS['TSFE']->fe_user->user || empty($prefillSettings) || |
||
| 45 | !array_key_exists($fieldname, $prefillSettings) |
||
| 46 | ) { |
||
| 47 | return ''; |
||
| 48 | } |
||
| 49 | |||
| 50 | return (string)($GLOBALS['TSFE']->fe_user->user[$prefillSettings[$fieldname]]); |
||
| 51 | } |
||
| 53 |