Commit 9416b26a authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Display country names not numbers in user view (The 2nd part of bug 1333)

parent 6985b48e
......@@ -481,12 +481,10 @@ class ArtefactTypeTown extends ArtefactTypeProfileField {}
class ArtefactTypeCity extends ArtefactTypeProfileField {}
class ArtefactTypeCountry extends ArtefactTypeProfileField {
public function listself($options) {
$countries = getoptions_country();
return array('html' => $countries[$this->title], 'javascript' => null);
return array('html' => get_string("country.{$this->title}"), 'javascript' => null);
}
public function render_full($options) {
$countries = getoptions_country();
return array('html' => $countries[$this->title], 'javascript' => null);
return array('html' => get_string("country.{$this->title}"), 'javascript' => null);
}
}
class ArtefactTypeHomenumber extends ArtefactTypeProfileField {}
......
......@@ -106,6 +106,9 @@ function search_user($query_string, $limit, $offset = 0) {
$result[$field] = $value;
}
}
if (isset($result['country'])) {
$result['country'] = get_string('country.' . $result['country']);
}
}
}
......
......@@ -794,7 +794,7 @@ function getoptions_country() {
if (!empty($countries)) {
return $countries;
}
$countries = array(
$codes = array(
'af',
'ax',
'al',
......@@ -1040,11 +1040,10 @@ function getoptions_country() {
'zw',
);
$countries = array_map(
create_function('$a', 'return get_string("country.{$a}");'),
$countries
);
usort($countries, 'strcoll');
foreach ($codes as $c) {
$countries[$c] = get_string("country.{$c}");
};
uasort($countries, 'strcoll');
return $countries;
}
......
......@@ -110,6 +110,9 @@ foreach (array_keys($publicfields) as $field) {
}
}
}
if (isset($userfields['country'])) {
$userfields['country'] = get_string('country.' . $userfields['country']);
}
// Get viewable views
$views = array();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment