$options = array(0 => get_string('ascending', 'data'),
1 => get_string('descending', 'data'));
- choose_from_menu($options, 'defaultsortdir', $data->defaultsortdir, '');
+ echo $OUTPUT->select(html_select::make($options, 'defaultsortdir', $data->defaultsortdir, false));
echo '<input type="submit" value="'.get_string('save', 'data').'" />';
echo '</div>';
echo '</form>';
}
function display_search_field($value='') {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
$temp = $DB->get_records_sql_menu('SELECT id, content FROM {data_content} WHERE fieldid=? GROUP BY content ORDER BY content', array($this->field->id));
$options = array();
if(!empty($temp)) {
$options[$key] = $key; //Build following indicies from the sql.
}
}
- return choose_from_menu($options, 'f_'.$this->field->id, $value, 'choose', '', 0, true);
+ return $OUTPUT->select(html_select::make($options, 'f_'.$this->field->id, $value));
}
function parse_search_field() {
<?php
$course->maxbytes = $DB->get_field('course', 'maxbytes', array('id'=>$this->data->course));
$choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);
- choose_from_menu($choices, 'param3', $this->field->param3, '', '', 0, false, false, 0, 'param3');
+ $select = html_select::make($choices, 'param3', $this->field->param3, false);
+ $select->id = 'param3';
+
+ echo $OUTPUT->select($select);
?>
</td>
</tr>
}
function display_search_field($value = '') {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
$lats = $DB->get_records_sql_menu('SELECT id, content FROM {data_content} WHERE fieldid=? GROUP BY content ORDER BY content', array($this->field->id));
$longs = $DB->get_records_sql_menu('SELECT id, content1 FROM {data_content} WHERE fieldid=? GROUP BY content ORDER BY content', array($this->field->id));
$options = array();
$options[$temp.','.$longs[$key]] = $temp.','.$longs[$key];
}
}
- return choose_from_menu($options, 'f_'.$this->field->id, $value, 'choose', '', 0, true);
+ return $OUTPUT->select(html_select::make($options, 'f_'.$this->field->id, $value));
}
function parse_search_field() {
var $type = 'menu';
function display_add_field($recordid=0) {
- global $DB;
+ global $DB, $OUTPUT;
if ($recordid){
$content = $DB->get_field('data_content', 'content', array('fieldid'=>$this->field->id, 'recordid'=>$recordid));
$options[$option] = $option;
}
}
+
- $str .= choose_from_menu($options, 'field_'.$this->field->id, $content,
- get_string('menuchoose', 'data'), '', '', true, false, 0, 'field_'.$this->field->id);
+ $select = html_select::make($options, 'field_'.$this->field->id, $content, get_string('menuchoose', 'data'));
+ $select->nothingvalue = '';
+ $select->id = 'field_'.$this->field->id;
+
+ $str .= $OUTPUT->select($select);
$str .= '</div>';
}
function display_search_field($content = '') {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
$usedoptions = array();
$sql = "SELECT DISTINCT content
return '';
}
- return choose_from_menu($options, 'f_'.$this->field->id, $content, ' ', '', 0, true);
+ return $OUTPUT->select(html_select::make($options, 'f_'.$this->field->id, $content, ' '));
}
function parse_search_field() {
<?php
$course->maxbytes = $DB->get_field('course', 'maxbytes', array('id'=>$this->data->course));
$choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);
- choose_from_menu($choices, 'param3', $this->field->param3, '', '', 0, false, false, 0, 'param3');
+ $select = html_select::make($choices, 'param3', $this->field->param3, false);
+ $select->id = 'param3';
+
+ echo $OUTPUT->select($select);
?>
</td>
</tr>
}
function display_search_field($value = '') {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
$temp = $DB->get_records_sql_menu('SELECT id, content FROM {data_content} WHERE fieldid=? GROUP BY content ORDER BY content', array($this->field->id));
$options = array();
if(!empty($temp)) {
$options[$key] = $key; //Build following indicies from the sql.
}
}
- return choose_from_menu($options, 'f_'.$this->field->id, $value, 'choose', '', 0, true);
+ return $OUTPUT->select(html_select::make($options, 'f_'.$this->field->id, $value));
}
function parse_search_field() {
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
-// (at your option) any later version. //
-// //
+// (at your option) any later version. // // //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
var $type = 'textarea';
function display_add_field($recordid=0) {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
$text = '';
$format = 0;
// Get the available text formats for this field.
$formatsForField = format_text_menu();
$str .= '<br />';
-
- $str .= choose_from_menu($formatsForField, 'field_' . $this->field->id .
- '_content1', $format, 'choose', '', '', true);
+ $select = html_select( $formatsForField, 'field_' . $this->field->id . '_content1', $format);
+ $select->nothingvalue = '';
+ $str .= $OUTPUT->select($select);
$str .= helpbutton('textformat', get_string('helpformatting'), 'moodle', true, false, '', true);
}
* @return void
*/
function data_print_preference_form($data, $perpage, $search, $sort='', $order='ASC', $search_array = '', $advanced = 0, $mode= ''){
- global $CFG, $DB, $PAGE;
+ global $CFG, $DB, $PAGE, $OUTPUT;
$cm = get_coursemodule_from_instance('data', $data->id);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
echo '<label for="pref_perpage">'.get_string('pagesize','data').'</label> ';
$pagesizes = array(2=>2,3=>3,4=>4,5=>5,6=>6,7=>7,8=>8,9=>9,10=>10,15=>15,
20=>20,30=>30,40=>40,50=>50,100=>100,200=>200,300=>300,400=>400,500=>500,1000=>1000);
- choose_from_menu($pagesizes, 'perpage', $perpage, '', '', '0', false, false, 0, 'pref_perpage');
+ $select = html_select::make($pagesizes, 'perpage', $perpage, false);
+ $select->id = 'pref_perpage';
+ echo $OUTPUT->select($select);
echo '<div id="reg_search" style="display: ';
if ($advanced) {
echo 'none';
* @param array $scale
*/
function data_print_rating_menu($recordid, $userid, $scale) {
- global $DB;
+ global $DB, $OUTPUT;
static $strrate;
if (empty($strrate)) {
$strrate = get_string("rate", "data");
}
-
- choose_from_menu($scale, $recordid, $rating->rating, "$strrate...", '', -999);
+ $select = html_select::make($scale, $recordid, $rating->rating, "$strrate...");
+ $select->nothingvalue = -999;
+ echo $OUTPUT->select($select);
}
/**