]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19793 Upgraded calls to print_time_selector and print_date_selector
authornicolasconnault <nicolasconnault>
Thu, 6 Aug 2009 01:08:13 +0000 (01:08 +0000)
committernicolasconnault <nicolasconnault>
Thu, 6 Aug 2009 01:08:13 +0000 (01:08 +0000)
calendar/event_edit.html
calendar/event_new.html

index 617686044446e39d734154cc744b8771265f02f7..0208cb19cbd3f5f3bfa2259ce182a070f94b28da 100644 (file)
@@ -1,3 +1,18 @@
+<?php
+$startselectors = moodle_select::make_time_selectors(array(
+        'days' => 'startday',
+        'months' => 'startmon', 
+        'years' => 'startyr', 
+        'hours' => 'starthr',
+        'minutes' => 'startmin'), $form->timestart);
+
+$endselectors = moodle_select::make_time_selectors(array(
+        'days' => 'endday',
+        'months' => 'endmon', 
+        'years' => 'endyr', 
+        'hours' => 'endhr',
+        'minutes' => 'endmin'), $form->timestart + $form->timeduration);
+?>
 <form method="post" action="event.php" id="eventform">
 <table cellpadding="5" cellspacing="0">
   <tr>
@@ -23,9 +38,9 @@
   <tr>
     <td style="vertical-align: top; text-align: right;"><?php print_string('eventdate', 'calendar'); ?>:</td>
     <td>
-      <?php print_date_selector('startday', 'startmon', 'startyr', $form->timestart);?>
+      <?php echo $OUTPUT->select($startselectors[0]) . $OUTPUT->select($startselectors[1]) . $OUTPUT->select($startselectors[2]);?>
       <?php print_string('eventtime', 'calendar');?>
-      <?php print_time_selector('starthr', 'startmin', $form->timestart) ?>
+      <?php echo $OUTPUT->select($startselectors[3]) . $OUTPUT->select($startselectors[4]);?>
       <?php if (isset($err['timestart'])) formerr($err['timestart']); ?>
     </td>
   </tr>
@@ -45,9 +60,9 @@
         <label for="duration_yes">
           <?php print_string('durationuntil', 'calendar'); ?>
         </label>
-        <?php print_date_selector('endday', 'endmon', 'endyr', $form->timestart + $form->timeduration);?>
+        <?php echo $OUTPUT->select($endselectors[0]) . $OUTPUT->select($endselectors[1]) . $OUTPUT->select($endselectors[2]);?>
         <?php print_string('eventtime', 'calendar');?>
-        <?php print_time_selector('endhr', 'endmin', $form->timestart + $form->timeduration) ?>
+        <?php echo $OUTPUT->select($endselectors[3]) . $OUTPUT->select($endselectors[4]);?>
         <?php if (isset($err['timeduration'])) formerr($err['timeduration']); ?>
       </div>
       <div>
index e9cb1c834ae4223395d241b65717da4f942fe5d5..ff2ce47897f81b940ab8e9570a7f8839f222f2ce 100644 (file)
@@ -1,6 +1,19 @@
 <?php
     // The following is a hack to fix bug 1488
     $course = $DB->get_record('course', array('id'=>($form->courseid ? $form->courseid : $site->id)));
+    $startselectors = moodle_select::make_time_selectors(array(
+            'days' => 'startday',
+            'months' => 'startmon', 
+            'years' => 'startyr', 
+            'hours' => 'starthr',
+            'minutes' => 'startmin'), (int) $form->timestart);
+
+    $endselectors = moodle_select::make_time_selectors(array(
+            'days' => 'endday',
+            'months' => 'endmon', 
+            'years' => 'endyr', 
+            'hours' => 'endhr',
+            'minutes' => 'endmin'), $form->timestart + $form->timeduration);
 ?>
 <form method="post" action="event.php" id="eventform">
 <table cellpadding="5">
@@ -29,9 +42,9 @@
       <?php print_string('eventdate', 'calendar'); ?>:
     </td>
     <td>
-      <?php print_date_selector('startday', 'startmon', 'startyr', (int)$form->timestart);?>
+      <?php echo $OUTPUT->select($startselectors[0]) . $OUTPUT->select($startselectors[1]) . $OUTPUT->select($startselectors[2]);?>
       <?php print_string('eventtime', 'calendar');?>
-      <?php print_time_selector('starthr', 'startmin', (int)$form->timestart) ?>
+      <?php echo $OUTPUT->select($startselectors[3]) . $OUTPUT->select($startselectors[4]);?>
       <?php if (isset($err['timestart'])) formerr($err['timestart']); ?>
     </td>
   </tr>
@@ -47,9 +60,9 @@
       <div>
         <input type="radio" name="duration" value="1" id="duration_yes" <?php if($form->duration == 1) echo 'checked="checked"'; ?>/>
         <label for="duration_yes"><?php print_string('durationuntil', 'calendar'); ?></label>
-        <?php print_date_selector('endday', 'endmon', 'endyr', $form->timestart + $form->timeduration);?>
+        <?php echo $OUTPUT->select($endselectors[0]) . $OUTPUT->select($endselectors[1]) . $OUTPUT->select($endselectors[2]);?>
         <?php print_string('eventtime', 'calendar');?>
-        <?php print_time_selector('endhr', 'endmin', $form->timestart + $form->timeduration) ?>
+        <?php echo $OUTPUT->select($endselectors[3]) . $OUTPUT->select($endselectors[4]);?>
         <?php if (isset($err['timeduration'])) formerr($err['timeduration']); ?>
       </div>
       <div>