/** * Get value from session if defined in TypoScript * * @return string */ protected function getFromSession() { $value = ''; $sessionValues = SessionUtility::getSessionValuesForPrefill($this->settings); if (!empty($sessionValues) && count($sessionValues)) { foreach ($sessionValues as $marker => $valueInSession) { if ($this->getMarker() === $marker) { return $valueInSession; } } } return $value; }
/** * Get value from session if defined in TypoScript * * @return string */ protected function getFromSession() { $selected = false; $sessionValues = SessionUtility::getSessionValuesForPrefill($this->settings); if (!empty($sessionValues) && count($sessionValues)) { foreach ($sessionValues as $marker => $valueInSession) { if ($this->getMarker() === $marker) { if ($valueInSession === $this->options[$this->index]['value'] || $valueInSession === $this->options[$this->index]['label']) { $selected = true; } } } } return $selected; }