19declare(strict_types=1);
24use ILIAS\User\Profile\Fields\NoOverrides;
45 return AvailableSections::PersonalData;
88 $latitude = !empty($user?->getLatitude())
89 ? (float) $user->getLatitude()
91 $longitude = !empty($user?->getLongitude())
92 ? (float) $user->getLongitude()
94 $zoom = $user?->getLocationZoom();
96 if ($latitude ===
null && $longitude ===
null && $zoom === 0) {
98 $latitude = (float) $def[
'latitude'];
99 $longitude = (float) $def[
'longitude'];
100 $zoom = (
int) $def[
'zoom'];
103 $street = $user?->getStreet() ??
'';
104 if ($street ===
'') {
105 $street =
$lng->txt(
'street');
107 $city = $user?->getCity() ??
'';
109 $city =
$lng->txt(
'city');
111 $country = $user?->getCountry() ??
'';
112 if ($country ===
'') {
113 $country =
$lng->txt(
'country');
116 $loc_prop = new \ilLocationInputGUI(
117 $lng->txt(
'location'),
120 $loc_prop->setLatitude($latitude);
121 $loc_prop->setLongitude($longitude);
122 $loc_prop->setZoom($zoom);
123 $loc_prop->setAddress($street .
', ' . $city .
', ' . $country);
132 if (($input[
'latitude'] ?? 0.0) !== 0.0) {
135 if (($input[
'longitude'] ?? 0.0) !== 0.0) {
136 $user->setLongitude((
string) $input[
'longitude']);
139 $user->setLocationZoom($input[
'zoom'] ??
null);
visibleInCoursesForcedTo()
availableInCertificatesForcedTo()
visibleInGroupsForcedTo()
getLegacyInput(Language $lng, Context $context, ?\ilObjUser $user=null)
You don't need to add a post_var to the input as the User will handle this for you,...
retrieveValueFromUser(\ilObjUser $user)
addValueToUserObject(\ilObjUser $user, mixed $input, ?\ilPropertyFormGUI $form=null)
visibleInStudyProgrammesForcedTo()
static getDefaultSettings()
Get default longitude, latitude and zoom.
setLatitude(?string $latitude)
if(!file_exists('../ilias.ini.php'))