MDL-20204 converted selects
authorPetr Skoda <skodak@moodle.org>
Thu, 11 Feb 2010 09:18:13 +0000 (09:18 +0000)
committerPetr Skoda <skodak@moodle.org>
Thu, 11 Feb 2010 09:18:13 +0000 (09:18 +0000)
backup/restore_form.html
question/type/calculated/questiontype.php
question/type/match/questiontype.php

index 04ed06d..b084331 100644 (file)
@@ -638,7 +638,7 @@ if ($restoreuserinfo) {
         $roles = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM));
 
         $editteacher = reset($roles);
-        echo $OUTPUT->select(html_select::make ($siterolesarray, "defaultteacheredit", $editteacher->id, 'new role'));
+        echo html_writer::select($siterolesarray, "defaultteacheredit", $editteacher->id, array(''=>'new role'));
         echo ('</td></tr>');
 
         /// Non-editting teacher
@@ -651,7 +651,7 @@ if ($restoreuserinfo) {
         $roles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM));
         $teacher = reset($roles);
 
-        echo $OUTPUT->select(html_select::make ($siterolesarray, "defaultteacher", $teacher->id, 'new role'));
+        echo html_writer::select($siterolesarray, "defaultteacher", $teacher->id, array(''=>'new role'));
         echo ('</td></tr>');
 
 
@@ -664,7 +664,7 @@ if ($restoreuserinfo) {
         $roles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM));
         $studentrole = array_shift($roles);
 
-        echo $OUTPUT->select(html_select::make ($siterolesarray, "defaultstudent", $studentrole->id, 'new role'));
+        echo html_writer::select($siterolesarray, "defaultstudent", $studentrole->id, array(''=>'new role'));
         echo ('</td></tr>');
 
     } else {
@@ -703,7 +703,7 @@ if ($restoreuserinfo) {
                         }
                     }
                 }
-                echo $OUTPUT->select(html_select::make ($mappableroles, "roles_".$roleid, $matchrole, 'new role'));
+                echo html_writer::select($mappableroles, "roles_".$roleid, $matchrole, array(''=>'new role'));
                 echo ('</td></tr>');
             }
         }
index ab9777b..8e2051a 100644 (file)
@@ -942,14 +942,10 @@ class question_calculated_qtype extends default_questiontype {
                                                 ? 'decimals'
                                                 : 'significantfigures'), 'quiz', $i);
             }
-            $select1 = html_select::make($lengthoptions, 'calclength[]', $regs[4], false);
-            $select1->nothingvalue = '';
-            $menu1 = $OUTPUT->select($select1);
-
-            $select2 = html_select::make(array('uniform' => get_string('uniform', 'quiz'),
-                                             'loguniform' => get_string('loguniform', 'quiz')), 'calcdistribution[]', $regs[1], false);
-            $select2->nothingvalue = '';
-            $menu2 = $OUTPUT->select($select2);
+            $menu1 = html_writer::select($lengthoptions, 'calclength[]', $regs[4], null);
+
+            $options = array('uniform' => get_string('uniform', 'quiz'), 'loguniform' => get_string('loguniform', 'quiz'));
+            $menu2 = html_writer::select($options, 'calcdistribution[]', $regs[1], null);
             return '<input type="submit" onclick="'
                     . "getElementById('addform').regenerateddefid.value='$defid'; return true;"
                     .'" value="'. get_string('generatevalue', 'quiz') . '"/><br/>'
@@ -1387,14 +1383,14 @@ class question_calculated_qtype extends default_questiontype {
                 list($options, $selected) =
                         $this->dataset_options($form, $datasetname);
                 unset($options['0']); // Mandatory...
-                $datasetmenus[$datasetname] = $OUTPUT->select(html_select::make($options, 'dataset[]', $selected, false));
+                $datasetmenus[$datasetname] = html_writer::select($options, 'dataset[]', $selected, null);
             }
         }
         foreach ($optionaldatasets as $datasetname) {
             if (!isset($datasetmenus[$datasetname])) {
                 list($options, $selected) =
                         $this->dataset_options($form, $datasetname);
-                $datasetmenus[$datasetname] = $OUTPUT->select(html_select::make($options, 'dataset[]', $selected, false));
+                $datasetmenus[$datasetname] = html_writer::select($options, 'dataset[]', $selected, null);
             }
         }
         return $datasetmenus;
index 6220ed4..d4e5b76 100644 (file)
@@ -295,9 +295,9 @@ class question_match_qtype extends default_questiontype {
                     }
                 }
 
-                $select = html_select::make($answers, $menuname, $response);
-                $select->disabled = $options->readonly;
-                $a->control = $OUTPUT->select($select);
+                $attributes = array();
+                $attributes['disabled'] = $options->readonly ? 'disabled' : null;
+                $a->control = html_writer::select($answers, $menuname, $response, array(''=>'choosedots'), $attributes);
 
                 // Neither the editing interface or the database allow to provide
                 // fedback for this question type.