]> git.mjollnir.org Git - moodle.git/commitdiff
Fiexed order of time elements for RTL MDL-10768
authormoodler <moodler>
Thu, 9 Aug 2007 08:44:29 +0000 (08:44 +0000)
committermoodler <moodler>
Thu, 9 Aug 2007 08:44:29 +0000 (08:44 +0000)
lib/form/datetimeselector.php

index 0f07b4fa1363a698dc0905b303fb99203c620738..3e5aba75596c20978f08e7340021bf0b5cde1e88 100644 (file)
@@ -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);