mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-59296 data: Fix latlong field search
This commit is contained in:
parent
f4a2d69631
commit
43cf2cb0a4
@ -104,14 +104,17 @@ class data_field_latlong extends data_field_base {
|
||||
foreach ($latlongsrs as $latlong) {
|
||||
$latitude = format_float($latlong->la, 4);
|
||||
$longitude = format_float($latlong->lo, 4);
|
||||
$options[$latlong->la . ',' . $latlong->lo] = $latitude . ' ' . $longitude;
|
||||
if ($latitude && $longitude) {
|
||||
$options[$latlong->la . ',' . $latlong->lo] = $latitude . ' ' . $longitude;
|
||||
}
|
||||
}
|
||||
$latlongsrs->close();
|
||||
|
||||
$classes = array('class' => 'accesshide');
|
||||
$return = html_writer::label(get_string('latlong', 'data'), 'menuf_'.$this->field->id, false, $classes);
|
||||
$classes = array('class' => 'custom-select');
|
||||
$return .= html_writer::select($options, 'f_'.$this->field->id, $value, null, $classes);
|
||||
$return .= html_writer::select($options, 'f_'.$this->field->id, $value, array('' => get_string('menuchoose', 'data')),
|
||||
$classes);
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user