*/ public function getLayout(): array { $systemDefault = $this->appConfig->getAppValueString('layout', 'recommendations,spreed,mail,calendar'); return $this->sanitizeLayout( explode(',', $this->userConfig->getValueString($this->userId, 'dashboard', 'layout', $systemDefault)), ); } /** * @param list $layout * @return list */ public function sanitizeLayout(array $layout): array { $seen = []; $result = []; foreach ($layout as $value) { if ($value === '' || isset($seen[$value])) { continue; } $seen[$value] = true; $result[] = $value; } return $result; } /** * @return list */ public function getStatuses(): array { $configStatuses = $this->userConfig->getValueString($this->userId, 'dashboard', 'statuses'); try { // Parse the old format /** @var array $statuses */ $statuses = json_decode($configStatuses, true, 512, JSON_THROW_ON_ERROR); // We avoid getting an empty array as it will not produce an object in UI's JS return array_keys(array_filter($statuses, static fn (bool $value) => $value)); } catch (JsonException) { return array_values(array_filter(explode(',', $configStatuses), fn (string $value) => $value !== '')); } } public function getBirthdate(): string { if ($this->userId === null) { return ''; } $user = $this->userManager->get($this->userId); if ($user === null) { return ''; } $account = $this->accountManager->getAccount($user); try { $birthdate = $account->getProperty(IAccountManager::PROPERTY_BIRTHDATE); } catch (PropertyDoesNotExistException) { return ''; } return $birthdate->getValue(); } }