From 7982426d1ba3b53a30b4560fd9179ef7b4c0953a Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 9 Aug 2007 08:44:29 +0000 Subject: [PATCH] Fiexed order of time elements for RTL MDL-10768 --- lib/form/datetimeselector.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/form/datetimeselector.php b/lib/form/datetimeselector.php index 0f07b4fa13..3e5aba7559 100644 --- a/lib/form/datetimeselector.php +++ b/lib/form/datetimeselector.php @@ -84,8 +84,13 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group{ $this->_elements[] =& MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true); $this->_elements[] =& MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true); $this->_elements[] =& MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true); - $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true); - $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true); + if (right_to_left()) { // Switch order of elements for Right-to-Left + $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true); + $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true); + } else { + $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true); + $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true); + } // If optional we add a checkbox which the user can use to turn if on if($this->_options['optional']) { $this->_elements[] =& MoodleQuickForm::createElement('checkbox', 'off', null, get_string('disable'), $this->getAttributes(), true); -- 2.39.5