// other options
// Note: lockconfig_ fields have special handling.
function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts, $updateopts) {
-
+ global $OUTPUT;
echo '<tr><td colspan="3">';
if ($retrieveopts) {
echo $OUTPUT->heading(get_string('auth_data_mapping', 'auth'));
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> ';
- choose_from_menu($updatelocaloptions, "lockconfig_field_updatelocal_{$field}", $pluginconfig->{"field_updatelocal_$field"}, "");
+ echo $OUTPUT->select(html_select::make($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> ';
- choose_from_menu($updateextoptions, "lockconfig_field_updateremote_{$field}", $pluginconfig->{"field_updateremote_$field"}, "");
+ echo $OUTPUT->select(html_select::make($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> ';
- choose_from_menu($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, "");
+ echo $OUTPUT->select(html_select::make($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>';
- choose_from_menu($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, "");
+ echo $OUTPUT->select(html_select::make($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, false));
}
echo '</td>';
if (!empty($helptext)) {
echo '<span class="form-shortname">sendcoursewelcomemessage</span>';
echo '</label></div>';
echo '<div class="form-setting"><div class="form-checkbox defaultsnext">';
- choose_from_menu($yesnooptions, 'sendcoursewelcomemessage', $CFG->sendcoursewelcomemessage, '');
+ echo $OUTPUT->select(html_select::make($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>';
if (!empty($formerror['mnet_host_id'])) {
echo '<span class="error"> * </span>';
}
-choose_from_menu($mnethosts, 'mnet_host_id');
+echo $OUTPUT->select(html_select::make($mnethosts, 'mnet_host_id'));
// choose an access level
echo " " . get_string('accesslevel', 'mnet') . ":\n";
}
$accessmenu['allow'] = get_string('allow', 'mnet');
$accessmenu['deny'] = get_string('deny', 'mnet');
-choose_from_menu($accessmenu, 'accessctrl');
+echo $OUTPUT->select(html_select::make($accessmenu, 'accessctrl'));
// submit button
echo '<input type="submit" value="' . get_string('addtoacl', 'mnet') . '" />';
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="menucountry">'.get_string("country").'</label></div>';
echo '<div class="felement ftext">';
- choose_from_menu (get_list_of_countries(), "country", $admin->country, get_string("selectacountry")."...", "", "");
+ $select = html_select::make(get_list_of_countries(), "country", $admin->country, get_string("selectacountry")."...");
+ $select->nothingvalue = '';
+ echo $OUTPUT->select($select);
echo '</div>';
echo '</div>';
$options[0] = get_string("publicdirectory0");
$options[1] = get_string("publicdirectory1");
$options[2] = get_string("publicdirectory2");
- choose_from_menu ($options, "public", "2", "", "", "");
+ $select = html_select::make($options, "public", "2", false);
+ $select->nothingvalue = '';
+ echo $OUTPUT->select($select);
unset($options);
echo '</div>';
echo '</div>';
echo '<div class="felement ftext">';
$options[0] = get_string("registrationcontactno");
$options[1] = get_string("registrationcontactyes");
- choose_from_menu ($options, "contact", "1", "", "", "");
+ $select = html_select::make($options, "contact", "1", false);
+ $select->nothingvalue = '';
+ echo $OUTPUT->select($select);
unset($options);
echo '</div>';
echo '</div>';
echo '<div class="felement ftext">';
$options[0] = get_string("registrationno");
$options[1] = get_string("registrationyes");
- choose_from_menu ($options, "mailme", "1", "", "", "");
+ $select = html_select::make($options, "mailme", "1", false);
+ $select->nothingvalue = '';
+ echo $OUTPUT->select($select);
unset($options);
echo '</div>';
echo '</div>';
echo $OUTPUT->heading(get_string('reportsettings', 'report_capability'));
echo '<p id="intro">', get_string('intro', 'report_capability') , '</p>';
echo '<p><label for="menucapability"> ' . get_string('capabilitylabel', 'report_capability') . '</label></p>';
-choose_from_menu($capabilitychoices, 'capability', $capability, 'choose', '', '', false, false, 0, '', true);
+$select = html_select::make($capabilitychoices, 'capability', $capability);
+$select->nothingvalue = '';
+$select->listbox = true;
+$select->tabindex = 0;
+echo $OUTPUT->select($select);
echo '<p><label for="menuroles"> ' . get_string('roleslabel', 'report_capability') . '</label></p>';
-choose_from_menu($rolechoices, 'roles[]', $selectedroleids, '', '', '', false, false, 0, '', true, true);
+$select = html_select::make($rolechoices, 'roles[]', $selectedroleids, false);
+$select->nothingvalue = '';
+$select->listbox = true;
+$select->multiple = true;
+$select->tabindex = 0;
+echo $OUTPUT->select($select);
echo '<p><input type="submit" id="settingssubmit" value="' . get_string('getreport', 'report_capability') . '" /></p>';
echo '</form>';
echo $OUTPUT->box_end();
$table->width = '*';
$table->align = array('left','left','left','left','left','left');
- $table->data[] = array(get_string('statsreporttype'),choose_from_menu($reportoptions,'report',$report,'','','',true),
- get_string('statstimeperiod'),choose_from_menu($timeoptions,'time',$time,'','','',true),
+
+ $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);
+
+ $table->data[] = array(get_string('statsreporttype'),$reporttypemenu,
+ get_string('statstimeperiod'),$timeoptionsmenu,
'<input type="text" name="numcourses" size="3" maxlength="2" value="'.$numcourses.'" />',
'<input type="submit" value="'.get_string('view').'" />') ;
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> ';
-choose_from_menu($qtypechoices, 'qtype', $requestedqtype, get_string('all'), '', '_all_');
+$select = html_select::make($qtypechoices, 'qtype', $requestedqtype, get_string('all'));
+$select->nothingvalue = '_all_';
+echo $OUTPUT->select($select);
echo '</p>';
echo '<p><input type="submit" id="settingssubmit" value="' .
get_string('getreport', 'report_questioninstances') . '" /></p>';
</label></p>
<p><label for="extendperiod"><?php print_string('enrolperiod') ?></label><br />
- <?php choose_from_menu($periodmenu, 'extendperiod', $defaultperiod, $unlimitedperiod); ?></p>
+ <?php echo $OUTPUT->select(html_select::make($periodmenu, 'extendperiod', $defaultperiod, $unlimitedperiod)); ?></p>
<p><label for="extendbase"><?php print_string('startingfrom') ?></label><br />
- <?php choose_from_menu($basemenu, 'extendbase', $extendbase, ''); ?></p>
+ <?php echo $OUTPUT->select(html_select::make($basemenu, 'extendbase', $extendbase, false)); ?></p>
<?php print_collapsible_region_end(); ?>
</div>
}
protected function get_legacy_type_field($id) {
+ global $OUTPUT;
$options = array();
$options[''] = get_string('none');
foreach($this->legacyroles as $type => $cap) {
$options[$type] = get_string('legacy:'.$type, 'role');
}
- return choose_from_menu($options, 'legacytype', $this->role->legacytype, '', '', 0, true);
+ return $OUTPUT->select(html_select::make($options, 'legacytype', $this->role->legacytype, false));
}
protected function get_assignable_levels_control() {
return $potentialuserselector;
}
-?>
\ No newline at end of file
+?>
echo '<center><form action="timezone.php" method="post">';
echo "$strusers ($strall): ";
- choose_from_menu ($timezones, "zone", $current, get_string("serverlocaltime"), "", "99");
+ $select = html_select::make($timezones, "zone", $current, get_string("serverlocaltime"));
+ $select->nothingvalue ="99";
+ echo $OUTPUT->select($select);
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />";
echo '<input type="submit" value="'.s($strsavechanges).'" />';
echo "</form></center>";
$this->does_generate = ACTION_GENERATE_HTML;
/// These are always here
- global $CFG, $XMLDB;
+ global $CFG, $XMLDB, $OUTPUT;
/// Do the job, setting result as needed
/// Get the dir containing the file
if ($field->getType() != XMLDB_TYPE_DATETIME) {
unset ($typeoptions[XMLDB_TYPE_DATETIME]);
}
+ $select = html_select::make($typeoptions, 'type', $field->getType(), false);
+ $select->nothingvalue = '';
$o.= ' <tr valign="top"><td><label for="menutype" accesskey="t">Type:</label></td>';
- $o.= ' <td colspan="2">' . choose_from_menu($typeoptions, 'type', $field->getType(), '', '', '', true) . '</td></tr>';
+ $o.= ' <td colspan="2">' . $OUTPUT->select($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>';
$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 = '';
$o.= ' <tr valign="top"><td><label for="menuunsigned" accesskey="u">Unsigned:</label></td>';
- $o.= ' <td colspan="2">' . choose_from_menu($unsignedoptions, 'unsigned', $field->getUnsigned(), '', '', '', true) . '</td></tr>';
+ $o.= ' <td colspan="2">' . $OUTPUT->select($select) . '</td></tr>';
/// xmldb_field NotNull
$notnulloptions = array (0 => 'null', 'not null');
+ $select = html_select::make($notnulloptions, 'notnull', $field->getNotNull(), false);
+ $select->nothingvalue = '';
$o.= ' <tr valign="top"><td><label for="menunotnull" accesskey="n">Not Null:</label></td>';
- $o.= ' <td colspan="2">' . choose_from_menu($notnulloptions, 'notnull', $field->getNotNull(), '', '', '', true) . '</td></tr>';
+ $o.= ' <td colspan="2">' . $OUTPUT->select($select) . '</td></tr>';
/// xmldb_field Sequence
+ $select = html_select::make($sequenceoptions, 'sequence', $field->getSequence(), false);
+ $select->nothingvalue = '';
$sequenceoptions = array (0 => $this->str['no'], 1 => 'auto-numbered');
$o.= ' <tr valign="top"><td><label for="menusequence" accesskey="s">Sequence:</label></td>';
- $o.= ' <td colspan="2">' . choose_from_menu($sequenceoptions, 'sequence', $field->getSequence(), '', '', '', true) . '</td></tr>';
+ $o.= ' <td colspan="2">' . $OUTPUT->select($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>';
$this->does_generate = ACTION_GENERATE_HTML;
/// These are always here
- global $CFG, $XMLDB;
+ global $CFG, $XMLDB, $OUTPUT;
/// Do the job, setting result as needed
/// Get the dir containing the file
$typeoptions = array (0 => 'not unique',
1 => 'unique');
$o.= ' <tr valign="top"><td><label for="menuunique" accesskey="t">Type:</label></td>';
- $o.= ' <td colspan="2">' . choose_from_menu($typeoptions, 'unique', $index->getUnique(), '', '', '', true) . '</td></tr>';
+ $select = html_select::make($typeoptions, 'unique', $index->getUnique(), false);
+ $select->nothingvalue = '';
+ $o.= ' <td colspan="2">' . $OUTPUT->select($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>';
$this->does_generate = ACTION_GENERATE_HTML;
/// These are always here
- global $CFG, $XMLDB;
+ global $CFG, $XMLDB, $OUTPUT;
/// Do the job, setting result as needed
/// Get the dir containing the file
/// if ($key->getType() != XMLDB_KEY_FOREIGN_UNIQUE) {
/// unset ($typeoptions[XMLDB_KEY_FOREIGN_UNIQUE);
/// }
+ $select = html_select::make($typeoptions, 'type', $key->getType(), false);
+ $select->nothingvalue = '';
+
$o.= ' <tr valign="top"><td><label for="menutype" accesskey="t">Type:</label></td>';
- $o.= ' <td colspan="2">' . choose_from_menu($typeoptions, 'type', $key->getType(), '', '', '', true) . '</td></tr>';
+ $o.= ' <td colspan="2">' . $OUTPUT->select($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>';
$this->does_generate = ACTION_GENERATE_HTML;
/// These are always here
- global $CFG, $XMLDB, $DB;
+ global $CFG, $XMLDB, $DB, $OUTPUT;
/// Do the job, setting result as needed
/// Get the dir containing the file
$o.= ' <input type="hidden" name ="action" value="new_statement" />';
$o.= ' <input type="hidden" name ="postaction" value="edit_statement" />';
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
- $o.= ' <tr><td><label for="type" accesskey="t">' . $this->str['statementtype'] .' </label>' . choose_from_menu($typeoptions, 'type', '', 'choose', '', 0, true) . '<label for="table" accesskey="a">' . $this->str['statementtable'] . ' </label>' .choose_from_menu($selecttables, 'table', '', 'choose', '', 0, true) . '</td></tr>';
+ $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 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&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['back'] . ']</a></td></tr>';
$o.= ' </table>';
$this->does_generate = ACTION_GENERATE_HTML;
/// These are always here
- global $CFG, $XMLDB, $DB;
+ global $CFG, $XMLDB, $DB, $OUTPUT;
/// Do the job, setting result as needed
/// Get the dir containing the file
$o.= ' <input type="hidden" name ="action" value="new_table_from_mysql" />';
$o.= ' <input type="hidden" name ="postaction" value="edit_table" />';
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
- $o.= ' <tr><td><label for="table" accesskey="t">' . $this->str['createtable'] .' </label>' . choose_from_menu($selecttables, 'table', '', 'choose', '', 0, true) . '<label for="after" accesskey="a">' . $this->str['aftertable'] . ' </label>' .choose_from_menu($aftertables, 'after', '', 'choose', '', 0, true) . '</td></tr>';
+ $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 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&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['back'] . ']</a></td></tr>';
$o.= ' </table>';
$this->does_generate = ACTION_GENERATE_HTML;
/// These are always here
- global $CFG, $XMLDB;
+ global $CFG, $XMLDB, $OUTPUT;
/// Do the job, setting result as needed
/// Get the dir containing the file
$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>' . choose_from_menu($popcommands, 'command', $commandparam, '', '', 0, true) . ' <label for="table" accesskey="t">' . $this->str['selecttable'] . ' </label>' .choose_from_menu($poptables, 'table', $tableparam, '', '', 0, true) . '</td></tr>';
+ $o.= ' <tr><td><label for="action" accesskey="c">' . $this->str['selectaction'] .' </label>' . $OUTPUT->select(html_select::make($popcommands, 'command', $commandparam, false)) . ' <label for="table" accesskey="t">' . $this->str['selecttable'] . ' </label>' .$OUTPUT->select(html_select::make($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>';
$this->does_generate = ACTION_GENERATE_HTML;
/// These are always here
- global $CFG, $XMLDB;
+ global $CFG, $XMLDB, $OUTPUT;
/// Do the job, setting result as needed
/// Get the dir containing the file
$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>' . choose_from_menu($popcommands, 'command', $commandparam, '', '', 0, true) . ' <label for="fieldkeyindex" accesskey="f">' . $this->str['selectfieldkeyindex'] . ' </label>' .choose_from_menu($popfields, 'fieldkeyindex', $origfieldkeyindexparam, '', '', 0, true) . '</td></tr>';
+ $o.= ' <tr><td><label for="action" accesskey="c">' . $this->str['selectaction'] .' </label>' . $OUTPUT->select(html_select::make($popcommands, 'command', $commandparam, false)) . ' <label for="fieldkeyindex" accesskey="f">' . $this->str['selectfieldkeyindex'] . ' </label>' .$OUTPUT->select(html_select::make($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>';