diff --git a/user/view.php b/user/view.php index 04b3f523dd4..9181b4becdf 100644 --- a/user/view.php +++ b/user/view.php @@ -202,19 +202,13 @@ echo ''; - if (($user->city or $user->country) and (!isset($hiddenfields['city']) or !isset($hiddenfields['country']))) { - $location = ''; - if ($user->city && !isset($hiddenfields['city'])) { - $location .= $user->city; - } + if (! isset($hiddenfields['country']) && $user->country) { $countries = get_list_of_countries(); - if (!empty($countries[$user->country]) && !isset($hiddenfields['country'])) { - if ($user->city && !isset($hiddenfields['city']) && !isset($hiddenfields['country'])) { - $location .= ', '; - } - $location .= $countries[$user->country]; - } - print_row(get_string("city").":", $location); + print_row(get_string('country') . ':', $countries[$user->country]); + } + + if (! isset($hiddenfields['city']) && $user->city) { + print_row(get_string('city') . ':', $user->city); } if (has_capability('moodle/user:viewhiddendetails', $coursecontext)) { @@ -478,3 +472,4 @@ function print_row($left, $right) { } ?> +