Skip to content

Commit

Permalink
MDL-21235 more conversion to new select
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jan 16, 2010
1 parent 3750c3b commit 4b9210f
Show file tree
Hide file tree
Showing 61 changed files with 181 additions and 273 deletions.
8 changes: 4 additions & 4 deletions admin/auth_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,23 @@ function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts,
echo "<input id=\"lockconfig_{$varname}\" name=\"lockconfig_{$varname}\" type=\"text\" size=\"30\" value=\"{$pluginconfig->$varname}\" />";
echo '<div style="text-align: right">';
echo '<label for="menulockconfig_field_updatelocal_'.$field.'">'.get_string('auth_updatelocal', 'auth') . '</label>&nbsp;';
echo $OUTPUT->select(html_select::make($updatelocaloptions, "lockconfig_field_updatelocal_{$field}", $pluginconfig->{"field_updatelocal_$field"}, false));
echo html_writer::input_select($updatelocaloptions, "lockconfig_field_updatelocal_{$field}", $pluginconfig->{"field_updatelocal_$field"}, false);
echo '<br />';
if ($updateopts) {
echo '<label for="menulockconfig_field_updateremote_'.$field.'">'.get_string('auth_updateremote', 'auth') . '</label>&nbsp;';
echo $OUTPUT->select(html_select::make($updateextoptions, "lockconfig_field_updateremote_{$field}", $pluginconfig->{"field_updateremote_$field"}, false));
echo html_writer::input_select($updateextoptions, "lockconfig_field_updateremote_{$field}", $pluginconfig->{"field_updateremote_$field"}, false);
echo '<br />';


}
echo '<label for="menulockconfig_field_lock_'.$field.'">'.get_string('auth_fieldlock', 'auth') . '</label>&nbsp;';
echo $OUTPUT->select(html_select::make($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, false));
echo html_writer::input_select($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, false);
echo '</div>';
} else {
echo '<tr valign="top"><td align="right">';
echo '<label for="menulockconfig_field_lock_'.$field.'">'.$fieldname.'</label>';
echo '</td><td>';
echo $OUTPUT->select(html_select::make($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, false));
echo html_writer::input_select($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, false);
}
echo '</td>';
if (!empty($helptext)) {
Expand Down
2 changes: 1 addition & 1 deletion admin/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
echo '<span class="form-shortname">sendcoursewelcomemessage</span>';
echo '</label></div>';
echo '<div class="form-setting"><div class="form-checkbox defaultsnext">';
echo $OUTPUT->select(html_select::make($yesnooptions, 'sendcoursewelcomemessage', $CFG->sendcoursewelcomemessage, false));
echo html_writer::input_select($yesnooptions, 'sendcoursewelcomemessage', $CFG->sendcoursewelcomemessage, false);
echo '</div><div class="form-defaultinfo">'.get_string('defaultsettinginfo', 'admin', get_string('yes')).'</div></div>';
echo '<div class="form-description">' . get_string('configsendcoursewelcomemessage', 'admin') . '</div>';
echo '</div>';
Expand Down
4 changes: 2 additions & 2 deletions admin/mnet/access_control.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
if (!empty($formerror['mnet_host_id'])) {
echo '<span class="error"> * </span>';
}
echo $OUTPUT->select(html_select::make($mnethosts, 'mnet_host_id'));
echo html_writer::input_select($mnethosts, 'mnet_host_id');

// choose an access level
echo " " . get_string('accesslevel', 'mnet') . ":\n";
Expand All @@ -223,7 +223,7 @@
}
$accessmenu['allow'] = get_string('allow', 'mnet');
$accessmenu['deny'] = get_string('deny', 'mnet');
echo $OUTPUT->select(html_select::make($accessmenu, 'accessctrl'));
echo html_writer::input_select($accessmenu, 'accessctrl');

// submit button
echo '<input type="submit" value="' . get_string('addtoacl', 'mnet') . '" />';
Expand Down
22 changes: 7 additions & 15 deletions admin/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,34 +71,28 @@
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="menucountry">'.get_string("country").'</label></div>';
echo '<div class="felement ftext">';
$select = html_select::make(get_list_of_countries(), "country", $admin->country, get_string("selectacountry")."...");
$select->nothingvalue = '';
echo $OUTPUT->select($select);
echo html_writer::input_select(get_list_of_countries(), "country", $admin->country, array(''=>get_string("selectacountry")."..."));
echo '</div>';
echo '</div>';

echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="menupublic">'."<a href=\"http://moodle.org/sites/?country=$admin->country\" title=\"".get_string("publicdirectorytitle")."\">".get_string("publicdirectory")."</a>".'</label></div>';
echo '<div class="felement ftext">';
$options = array();
$options[0] = get_string("publicdirectory0");
$options[1] = get_string("publicdirectory1");
$options[2] = get_string("publicdirectory2");
$select = html_select::make($options, "public", "2", false);
$select->nothingvalue = '';
echo $OUTPUT->select($select);
unset($options);
echo html_writer::input_select($options, "public", "2", false);
echo '</div>';
echo '</div>';

echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="menucontact">'.get_string("registrationcontact").'</label></div>';
echo '<div class="felement ftext">';
$options = array();
$options[0] = get_string("registrationcontactno");
$options[1] = get_string("registrationcontactyes");
$select = html_select::make($options, "contact", "1", false);
$select->nothingvalue = '';
echo $OUTPUT->select($select);
unset($options);
echo html_writer::input_select($options, "contact", "1", false);
echo '</div>';
echo '</div>';

Expand Down Expand Up @@ -170,12 +164,10 @@
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="menumailme">'.get_string("registrationemail").'</label></div>';
echo '<div class="felement ftext">';
$options = array();
$options[0] = get_string("registrationno");
$options[1] = get_string("registrationyes");
$select = html_select::make($options, "mailme", "1", false);
$select->nothingvalue = '';
echo $OUTPUT->select($select);
unset($options);
echo html_writer::input_select($options, "mailme", "1", false);
echo '</div>';
echo '</div>';

Expand Down
9 changes: 2 additions & 7 deletions admin/report/courseoverview/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,8 @@
$table->width = '*';
$table->align = array('left','left','left','left','left','left');

$select = html_select::make($reportoptions,'report',$report, false);
$select->nothingvalue = '';
$reporttypemenu = $OUTPUT->select($select);

$select = html_select::make($timeoptions,'time',$time, false);
$select->nothingvalue = '';
$timeoptionsmenu = $OUTPUT->select($select);
$reporttypemenu = html_writer::input_select($reportoptions,'report',$report, false);
$timeoptionsmenu = html_writer::input_select($timeoptions,'time',$time, false);

$table->data[] = array(get_string('statsreporttype'),$reporttypemenu,
get_string('statstimeperiod'),$timeoptionsmenu,
Expand Down
4 changes: 1 addition & 3 deletions admin/report/questioninstances/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
echo $OUTPUT->heading(get_string('reportsettings', 'report_questioninstances'));
echo '<p id="intro">', get_string('intro', 'report_questioninstances') , '</p>';
echo '<p><label for="menuqtype"> ' . get_string('questiontype', 'admin') . '</label> ';
$select = html_select::make($qtypechoices, 'qtype', $requestedqtype, get_string('all'));
$select->nothingvalue = '_all_';
echo $OUTPUT->select($select);
echo html_writer::input_select($qtypechoices, 'qtype', $requestedqtype, array('_all_'=>get_string('all')));
echo '</p>';
echo '<p><input type="submit" id="settingssubmit" value="' .
get_string('getreport', 'report_questioninstances') . '" /></p>';
Expand Down
4 changes: 2 additions & 2 deletions admin/roles/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@
</label></p>

<p><label for="extendperiod"><?php print_string('enrolperiod') ?></label><br />
<?php echo $OUTPUT->select(html_select::make($periodmenu, 'extendperiod', $defaultperiod, $unlimitedperiod)); ?></p>
<?php echo html_writer::input_select($periodmenu, 'extendperiod', $defaultperiod, $unlimitedperiod); ?></p>

<p><label for="extendbase"><?php print_string('startingfrom') ?></label><br />
<?php echo $OUTPUT->select(html_select::make($basemenu, 'extendbase', $extendbase, false)); ?></p>
<?php echo html_writer::input_select($basemenu, 'extendbase', $extendbase, false); ?></p>
<?php print_collapsible_region_end(); ?>
</div>

Expand Down
2 changes: 1 addition & 1 deletion admin/roles/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ protected function get_legacy_type_field($id) {
foreach($this->legacyroles as $type => $cap) {
$options[$type] = get_string('legacy:'.$type, 'role');
}
return $OUTPUT->select(html_select::make($options, 'legacytype', $this->role->legacytype, false));
return html_writer::input_select($options, 'legacytype', $this->role->legacytype, false);
}

protected function get_assignable_levels_control() {
Expand Down
4 changes: 1 addition & 3 deletions admin/timezone.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@

echo '<center><form action="timezone.php" method="post">';
echo "$strusers ($strall): ";
$select = html_select::make($timezones, "zone", $current, get_string("serverlocaltime"));
$select->nothingvalue ="99";
echo $OUTPUT->select($select);
echo html_writer::input_select($timezones, "zone", $current, array('99'=>get_string("serverlocaltime")));
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />";
echo '<input type="submit" value="'.s($strsavechanges).'" />';
echo "</form></center>";
Expand Down
20 changes: 8 additions & 12 deletions admin/xmldb/actions/edit_field/edit_field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,9 @@ function invoke() {
if ($field->getType() != XMLDB_TYPE_DATETIME) {
unset ($typeoptions[XMLDB_TYPE_DATETIME]);
}
$select = html_select::make($typeoptions, 'type', $field->getType(), false);
$select->nothingvalue = '';
$select = html_writer::input_select($typeoptions, 'type', $field->getType(), false);
$o.= ' <tr valign="top"><td><label for="menutype" accesskey="t">Type:</label></td>';
$o.= ' <td colspan="2">' . $OUTPUT->select($select) . '</td></tr>';
$o.= ' <td colspan="2">' . $select . '</td></tr>';
/// xmldb_field Length
$o.= ' <tr valign="top"><td><label for="length" accesskey="l">Length:</label></td>';
$o.= ' <td colspan="2"><input name="length" type="text" size="6" maxlength="6" id="length" value="' . s($field->getLength()) . '" /><span id="lengthtip"></span></td></tr>';
Expand All @@ -159,22 +158,19 @@ function invoke() {
$o.= ' <td colspan="2"><input name="decimals" type="text" size="6" maxlength="6" id="decimals" value="' . s($field->getDecimals()) . '" /><span id="decimalstip"></span></td></tr>';
/// xmldb_field Unsigned
$unsignedoptions = array (0 => 'signed', 1 => 'unsigned');
$select = html_select::make($unsignedoptions, 'unsigned', $field->getUnsigned(), false);
$select->nothingvalue = '';
$select = html_writer::input_select($unsignedoptions, 'unsigned', $field->getUnsigned(), false);
$o.= ' <tr valign="top"><td><label for="menuunsigned" accesskey="u">Unsigned:</label></td>';
$o.= ' <td colspan="2">' . $OUTPUT->select($select) . '</td></tr>';
$o.= ' <td colspan="2">' . $select . '</td></tr>';
/// xmldb_field NotNull
$notnulloptions = array (0 => 'null', 'not null');
$select = html_select::make($notnulloptions, 'notnull', $field->getNotNull(), false);
$select->nothingvalue = '';
$select = html_writer::input_select($notnulloptions, 'notnull', $field->getNotNull(), false);
$o.= ' <tr valign="top"><td><label for="menunotnull" accesskey="n">Not Null:</label></td>';
$o.= ' <td colspan="2">' . $OUTPUT->select($select) . '</td></tr>';
$o.= ' <td colspan="2">' . $select . '</td></tr>';
/// xmldb_field Sequence
$sequenceoptions = array (0 => $this->str['no'], 1 => 'auto-numbered');
$select = html_select::make($sequenceoptions, 'sequence', $field->getSequence(), false);
$select->nothingvalue = '';
$select = html_writer::input_select($sequenceoptions, 'sequence', $field->getSequence(), false);
$o.= ' <tr valign="top"><td><label for="menusequence" accesskey="s">Sequence:</label></td>';
$o.= ' <td colspan="2">' . $OUTPUT->select($select) . '</td></tr>';
$o.= ' <td colspan="2">' . $select . '</td></tr>';
/// xmldb_field Default
$o.= ' <tr valign="top"><td><label for="default" accesskey="d">Default:</label></td>';
$o.= ' <td colspan="2"><input type="text" name="default" size="30" maxlength="80" id="default" value="' . s($field->getDefault()) . '" /></td></tr>';
Expand Down
5 changes: 2 additions & 3 deletions admin/xmldb/actions/edit_index/edit_index.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ function invoke() {
$typeoptions = array (0 => 'not unique',
1 => 'unique');
$o.= ' <tr valign="top"><td><label for="menuunique" accesskey="t">Type:</label></td>';
$select = html_select::make($typeoptions, 'unique', $index->getUnique(), false);
$select->nothingvalue = '';
$o.= ' <td colspan="2">' . $OUTPUT->select($select) . '</td></tr>';
$select = html_writer::input_select($typeoptions, 'unique', $index->getUnique(), false);
$o.= ' <td colspan="2">' . $select . '</td></tr>';
/// xmldb_index Fields
$o.= ' <tr valign="top"><td><label for="fields" accesskey="f">Fields:</label></td>';
$o.= ' <td colspan="2"><input name="fields" type="text" size="40" maxlength="80" id="fields" value="' . s(implode(', ', $index->getFields())) . '" /></td></tr>';
Expand Down
5 changes: 2 additions & 3 deletions admin/xmldb/actions/edit_key/edit_key.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,10 @@ function invoke() {
/// if ($key->getType() != XMLDB_KEY_FOREIGN_UNIQUE) {
/// unset ($typeoptions[XMLDB_KEY_FOREIGN_UNIQUE);
/// }
$select = html_select::make($typeoptions, 'type', $key->getType(), false);
$select->nothingvalue = '';
$select = html_writer::input_select($typeoptions, 'type', $key->getType(), false);

$o.= ' <tr valign="top"><td><label for="menutype" accesskey="t">Type:</label></td>';
$o.= ' <td colspan="2">' . $OUTPUT->select($select) . '</td></tr>';
$o.= ' <td colspan="2">' . $select . '</td></tr>';
/// xmldb_key Fields
$o.= ' <tr valign="top"><td><label for="fields" accesskey="f">Fields:</label></td>';
$o.= ' <td colspan="2"><input name="fields" type="text" size="40" maxlength="80" id="fields" value="' . s(implode(', ', $key->getFields())) . '" /></td></tr>';
Expand Down
2 changes: 1 addition & 1 deletion admin/xmldb/actions/new_statement/new_statement.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function invoke() {
$o.= ' <input type="hidden" name ="postaction" value="edit_statement" />';
$o.= ' <input type="hidden" name ="sesskey" value="' . sesskey() . '" />';
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
$o.= ' <tr><td><label for="type" accesskey="t">' . $this->str['statementtype'] .' </label>' . $OUTPUT->select(html_select::make($typeoptions, 'type')) . '<label for="table" accesskey="a">' . $this->str['statementtable'] . ' </label>' .$OUTPUT->select(html_select::make($selecttables, 'table')) . '</td></tr>';
$o.= ' <tr><td><label for="type" accesskey="t">' . $this->str['statementtype'] .' </label>' . html_writer::input_select($typeoptions, 'type') . '<label for="table" accesskey="a">' . $this->str['statementtable'] . ' </label>' .html_writer::input_select($selecttables, 'table') . '</td></tr>';
$o.= ' <tr><td colspan="2" align="center"><input type="submit" value="' .$this->str['create'] . '" /></td></tr>';
$o.= ' <tr><td colspan="2" align="center"><a href="index.php?action=edit_xml_file&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['back'] . ']</a></td></tr>';
$o.= ' </table>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function invoke() {
$o.= ' <input type="hidden" name ="postaction" value="edit_table" />';
$o.= ' <input type="hidden" name ="sesskey" value="' . sesskey() . '" />';
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
$o.= ' <tr><td><label for="table" accesskey="t">' . $this->str['createtable'] .' </label>' . $OUTPUT->select(html_select::make($selecttables, 'table')) . '<label for="after" accesskey="a">' . $this->str['aftertable'] . ' </label>' .$OUTPUT->select(html_select::make($aftertables, 'after')) . '</td></tr>';
$o.= ' <tr><td><label for="table" accesskey="t">' . $this->str['createtable'] .' </label>' . html_writer::input_select($selecttables, 'table') . '<label for="after" accesskey="a">' . $this->str['aftertable'] . ' </label>' .html_writer::input_select($aftertables, 'after') . '</td></tr>';
$o.= ' <tr><td colspan="2" align="center"><input type="submit" value="' .$this->str['create'] . '" /></td></tr>';
$o.= ' <tr><td colspan="2" align="center"><a href="index.php?action=edit_xml_file&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['back'] . ']</a></td></tr>';
$o.= ' </table>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function invoke() {
$o.= ' <input type="hidden" name ="dir" value="' . str_replace($CFG->dirroot, '', $dirpath) . '" />';
$o.= ' <input type="hidden" name ="action" value="view_structure_php" />';
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
$o.= ' <tr><td><label for="action" accesskey="c">' . $this->str['selectaction'] .' </label>' . $OUTPUT->select(html_select::make($popcommands, 'command', $commandparam, false)) . '&nbsp;<label for="table" accesskey="t">' . $this->str['selecttable'] . ' </label>' .$OUTPUT->select(html_select::make($poptables, 'table', $tableparam, false)) . '</td></tr>';
$o.= ' <tr><td><label for="action" accesskey="c">' . $this->str['selectaction'] .' </label>' . html_writer::input_select($popcommands, 'command', $commandparam, false) . '&nbsp;<label for="table" accesskey="t">' . $this->str['selecttable'] . ' </label>' .html_writer::input_select($poptables, 'table', $tableparam, false) . '</td></tr>';
$o.= ' <tr><td colspan="2" align="center"><input type="submit" value="' .$this->str['view'] . '" /></td></tr>';
$o.= ' </table>';
$o.= '</div></form>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function invoke() {
$o.= ' <input type="hidden" name ="table" value="' . s($tableparam) . '" />';
$o.= ' <input type="hidden" name ="action" value="view_table_php" />';
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
$o.= ' <tr><td><label for="action" accesskey="c">' . $this->str['selectaction'] .' </label>' . $OUTPUT->select(html_select::make($popcommands, 'command', $commandparam, false)) . '&nbsp;<label for="fieldkeyindex" accesskey="f">' . $this->str['selectfieldkeyindex'] . ' </label>' .$OUTPUT->select(html_select::make($popfields, 'fieldkeyindex', $origfieldkeyindexparam, false)) . '</td></tr>';
$o.= ' <tr><td><label for="action" accesskey="c">' . $this->str['selectaction'] .' </label>' . html_writer::input_select($popcommands, 'command', $commandparam, false) . '&nbsp;<label for="fieldkeyindex" accesskey="f">' . $this->str['selectfieldkeyindex'] . ' </label>' .html_writer::input_select($popfields, 'fieldkeyindex', $origfieldkeyindexparam, false) . '</td></tr>';
$o.= ' <tr><td colspan="2" align="center"><input type="submit" value="' .$this->str['view'] . '" /></td></tr>';
$o.= ' </table>';
$o.= '</div></form>';
Expand Down
Loading

0 comments on commit 4b9210f

Please sign in to comment.