Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
9416b26a
Commit
9416b26a
authored
Sep 19, 2007
by
Richard Mansfield
Browse files
Display country names not numbers in user view (The 2nd part of bug 1333)
parent
6985b48e
Changes
4
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/internal/lib.php
View file @
9416b26a
...
...
@@ -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
{}
...
...
htdocs/lib/searchlib.php
View file @
9416b26a
...
...
@@ -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'
]);
}
}
}
...
...
htdocs/lib/web.php
View file @
9416b26a
...
...
@@ -794,7 +794,7 @@ function getoptions_country() {
if
(
!
empty
(
$countries
))
{
return
$countries
;
}
$co
untri
es
=
array
(
$co
d
es
=
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
;
}
...
...
htdocs/user/view.php
View file @
9416b26a
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment