19declare(strict_types=1);
24use ILIAS\User\Profile\Fields\NoOverrides;
45 return AvailableSections::PersonalData;
93 $latitude = !empty($user?->getLatitude())
94 ? (float) $user->getLatitude()
96 $longitude = !empty($user?->getLongitude())
97 ? (float) $user->getLongitude()
99 $zoom = $user?->getLocationZoom();
101 if ($latitude ===
null && $longitude ===
null && $zoom === 0) {
103 $latitude = (float) $def[
'latitude'];
104 $longitude = (float) $def[
'longitude'];
105 $zoom = (
int) $def[
'zoom'];
108 $street = $user?->getStreet() ??
'';
109 if ($street ===
'') {
110 $street =
$lng->txt(
'street');
112 $city = $user?->getCity() ??
'';
114 $city =
$lng->txt(
'city');
116 $country = $user?->getCountry() ??
'';
117 if ($country ===
'') {
118 $country =
$lng->txt(
'country');
121 $loc_prop = new \ilLocationInputGUI(
122 $lng->txt(
'location'),
125 $loc_prop->setLatitude($latitude);
126 $loc_prop->setLongitude($longitude);
127 $loc_prop->setZoom($zoom);
128 $loc_prop->setAddress($street .
', ' . $city .
', ' . $country);
137 if (($input[
'latitude'] ?? 0.0) !== 0.0) {
140 if (($input[
'longitude'] ?? 0.0) !== 0.0) {
141 $user->setLongitude((
string) $input[
'longitude']);
144 $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'))