Merge branch 'MDL-30843_b' of git://github.com/rwijaya/moodle

This commit is contained in:
Sam Hemelryk 2012-04-10 12:34:37 +12:00
commit 5bfeb5ffd3
108 changed files with 390 additions and 216 deletions

View file

@ -1787,7 +1787,7 @@ class admin_setting_configtext extends admin_setting {
return format_admin_setting($this, $this->visiblename,
'<div class="form-text defaultsnext"><input type="text" size="'.$this->size.'" id="'.$this->get_id().'" name="'.$this->get_full_name().'" value="'.s($data).'" /></div>',
$this->description, true, '', $default, $query);
$this->description, true, '', $default, $query);
}
}
@ -1992,7 +1992,7 @@ class admin_setting_configfile extends admin_setting_configtext {
return format_admin_setting($this, $this->visiblename,
'<div class="form-file defaultsnext"><input type="text" size="'.$this->size.'" id="'.$this->get_id().'" name="'.$this->get_full_name().'" value="'.s($data).'" />'.$executable.'</div>',
$this->description, true, '', $default, $query);
$this->description, true, '', $default, $query);
}
}
@ -2026,7 +2026,7 @@ class admin_setting_configexecutable extends admin_setting_configfile {
return format_admin_setting($this, $this->visiblename,
'<div class="form-file defaultsnext"><input type="text" size="'.$this->size.'" id="'.$this->get_id().'" name="'.$this->get_full_name().'" value="'.s($data).'" />'.$executable.'</div>',
$this->description, true, '', $default, $query);
$this->description, true, '', $default, $query);
}
}
@ -2060,7 +2060,7 @@ class admin_setting_configdirectory extends admin_setting_configfile {
return format_admin_setting($this, $this->visiblename,
'<div class="form-file defaultsnext"><input type="text" size="'.$this->size.'" id="'.$this->get_id().'" name="'.$this->get_full_name().'" value="'.s($data).'" />'.$executable.'</div>',
$this->description, true, '', $default, $query);
$this->description, true, '', $default, $query);
}
}
@ -2748,11 +2748,14 @@ class admin_setting_configtime extends admin_setting {
}
$return = '<div class="form-time defaultsnext">'.
'<label class="accesshide" for="' . $this->get_id() . '">' . get_string('hour') . '</label>' .
'<select id="'.$this->get_id().'h" name="'.$this->get_full_name().'[h]">';
for ($i = 0; $i < 24; $i++) {
$return .= '<option value="'.$i.'"'.($i == $data['h'] ? ' selected="selected"' : '').'>'.$i.'</option>';
}
$return .= '</select>:<select id="'.$this->get_id().'m" name="'.$this->get_full_name().'[m]">';
$return .= '</select>:';
$return .= '<label class="accesshide" for="' . $this->get_id() . '">' . get_string('minutes') . '</label>';
$return .= '<select id="'.$this->get_id().'m" name="'.$this->get_full_name().'[m]">';
for ($i = 0; $i < 60; $i += 5) {
$return .= '<option value="'.$i.'"'.($i == $data['m'] ? ' selected="selected"' : '').'>'.$i.'</option>';
}
@ -3165,6 +3168,7 @@ class admin_setting_courselist_frontpage extends admin_setting {
if (!array_key_exists($i, $currentsetting)) {
$currentsetting[$i] = 'none'; //none
}
$return .= '<label class="accesshide" for="' . $this->get_id().$i . '">' . get_string($this->name, 'admin') . '</label>';
$return .='<select class="form-select" id="'.$this->get_id().$i.'" name="'.$this->get_full_name().'[]">';
foreach ($this->choices as $key => $value) {
$return .= '<option value="'.$key.'"'.("$key" == $currentsetting[$i] ? ' selected="selected"' : '').'>'.$value.'</option>';
@ -3436,8 +3440,10 @@ class admin_setting_emoticons extends admin_setting {
}
$out .= html_writer::tag('td',
html_writer::label($value, $this->get_full_name() . $field, false, array('class' => 'accesshide')) .
html_writer::empty_tag('input',
array(
'id' => $this->get_full_name() . $field,
'type' => 'text',
'class' => 'form-text',
'name' => $this->get_full_name().'['.$field.']',
@ -6518,7 +6524,7 @@ class admin_setting_managerepository extends admin_setting {
}
$select = new single_select($this->repository_action_url($typename, 'repos'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . basename($typename));
$select->set_label(get_accesshide(get_string('select') . ' '. get_string('action')));
// Display up/down link
$updown = '';
$spacer = $OUTPUT->spacer(array('height'=>15, 'width'=>15)); // should be done with CSS instead
@ -6555,6 +6561,7 @@ class admin_setting_managerepository extends admin_setting {
// Check that it has not already been listed
if (!in_array($plugin, $alreadyplugins)) {
$select = new single_select($this->repository_action_url($plugin, 'repos'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . basename($plugin));
$select->set_label(get_accesshide(get_string('select') . ' '. get_string('action')));
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '');
}
}
@ -7666,6 +7673,7 @@ class admin_setting_configcolourpicker extends admin_setting {
$PAGE->requires->js_init_call('M.util.init_colour_picker', array($this->get_id(), $this->previewconfig));
$content = html_writer::start_tag('div', array('class'=>'form-colourpicker defaultsnext'));
$content .= html_writer::tag('div', $OUTPUT->pix_icon('i/loading', get_string('loading', 'admin'), 'moodle', array('class'=>'loadingicon')), array('class'=>'admin_colourpicker clearfix'));
$content .= html_writer::label($this->get_full_name(), $this->get_id(), false, array('class' => 'accesshide'));
$content .= html_writer::empty_tag('input', array('type'=>'text','id'=>$this->get_id(), 'name'=>$this->get_full_name(), 'value'=>$this->get_setting(), 'size'=>'12'));
if (!empty($this->previewconfig)) {
$content .= html_writer::empty_tag('input', array('type'=>'button','id'=>$this->get_id().'_preview', 'value'=>get_string('preview'), 'class'=>'admin_colourpicker_preview'));
@ -7765,8 +7773,10 @@ class admin_setting_devicedetectregex extends admin_setting {
}
$out .= html_writer::tag('td',
html_writer::label($this->get_full_name(), $this->get_full_name() . 'expression' . $i, false, array('class' => 'accesshide')) .
html_writer::empty_tag('input',
array(
'id' => $this->get_full_name() . 'expression' . $i,
'type' => 'text',
'class' => 'form-text',
'name' => $this->get_full_name().'[expression'.$i.']',
@ -7784,8 +7794,10 @@ class admin_setting_devicedetectregex extends admin_setting {
}
$out .= html_writer::tag('td',
html_writer::label($this->get_full_name(), $this->get_full_name() . 'value' . $i, false, array('class' => 'accesshide')) .
html_writer::empty_tag('input',
array(
'id' => $this->get_full_name() . 'value' . $i,
'type' => 'text',
'class' => 'form-text',
'name' => $this->get_full_name().'[value'.$i.']',

View file

@ -2525,12 +2525,12 @@ function print_textfield($name, $value, $alt = '', $size=50, $maxlength=0, $retu
}
$style = "width: {$size}px;";
$attributes = array('type'=>'text', 'name'=>$name, 'alt'=>$alt, 'style'=>$style, 'value'=>$value);
$attributes = array('type' => 'text', 'id' => $name, 'name' => $name, 'alt' => $alt, 'style' => $style, 'value' => $value);
if ($maxlength) {
$attributes['maxlength'] = $maxlength;
}
$output = html_writer::empty_tag('input', $attributes);
$output = html_writer::label($name, $name, false, array('class' => 'accesshide'));
$output .= html_writer::empty_tag('input', $attributes);
if (empty($return)) {
echo $output;

View file

@ -354,15 +354,16 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
$editorrules = ' onblur="'.htmlspecialchars($this->getAttribute('onblur')).'" onchange="'.htmlspecialchars($this->getAttribute('onchange')).'"';
}
$str .= '<div><textarea id="'.$id.'" name="'.$elname.'[text]" rows="'.$rows.'" cols="'.$cols.'"'.$editorrules.'>';
$str .= s($text);
$str .= s($text);if (count($formats)>1) {
$str .= '</textarea></div>';
$str .= '<div>';
if (count($formats)>1) {
$str.= html_writer::select($formats, $elname.'[format]', $format, false);
$str .= html_writer::label(get_string('format'), 'menu'. $elname. '[format]', false, array('class' => 'accesshide'));
$str .= html_writer::select($formats, $elname.'[format]', $format, false);
} else {
$keys = array_keys($formats);
$str.= html_writer::empty_tag('input',
$str .= html_writer::empty_tag('input',
array('name'=>$elname.'[format]', 'type'=> 'hidden', 'value' => array_pop($keys)));
}
$str .= '</div>';

View file

@ -1334,6 +1334,12 @@ class core_renderer extends renderer_base {
if ($select->label) {
$output .= html_writer::label($select->label, $select->attributes['id']);
} else {
if (isset($select->nothing)) {
$label = $select->nothing;
$label = array_pop($label);
$output .= html_writer::label($label, $select->attributes['id'], false, array('class' => 'accesshide'));
}
}
if ($select->helpicon instanceof help_icon) {
@ -1341,7 +1347,6 @@ class core_renderer extends renderer_base {
} else if ($select->helpicon instanceof old_help_icon) {
$output .= $this->render($select->helpicon);
}
$output .= html_writer::select($select->options, $select->name, $select->selected, $select->nothing, $select->attributes);
$go = html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('go')));
@ -1412,6 +1417,12 @@ class core_renderer extends renderer_base {
if ($select->label) {
$output .= html_writer::label($select->label, $select->attributes['id']);
} else {
if (isset($select->nothing)) {
$label = $select->nothing;
$label = array_pop($label);
$output .= html_writer::label($label, $select->attributes['id'], false, array('class' => 'accesshide'));
}
}
if ($select->helpicon instanceof help_icon) {
@ -1628,6 +1639,7 @@ class core_renderer extends renderer_base {
$scalearray = array(RATING_UNSET_RATING => $strrate.'...') + $rating->settings->scale->scaleitems;
$scaleattrs = array('class'=>'postratingmenu ratinginput','id'=>'menurating'.$rating->itemid);
$ratinghtml .= html_writer::label($rating->rating, 'menurating'.$rating->itemid, false, array('class' => 'accesshide'));
$ratinghtml .= html_writer::select($scalearray, 'rating', $rating->rating, false, $scaleattrs);
//output submit button

View file

@ -462,7 +462,8 @@ function portfolio_instance_select($instances, $callerformats, $callbackclass, $
$pinsane = portfolio_plugin_sanity_check();
$count = 0;
$selectoutput = "\n" . '<select name="' . $selectname . '">' . "\n";
$selectoutput = "\n" . '<label class="accesshide" for="' . $selectname . '">' . get_string('plugin', 'portfolio') . '</label>';
$selectoutput .= "\n" . '<select id="' . $selectname . '" name="' . $selectname . '">' . "\n";
$existingexports = portfolio_existing_exports_by_plugin($USER->id);
foreach ($instances as $instance) {
$formats = portfolio_supported_formats_intersect($callerformats, $instance->supported_formats());

View file

@ -992,7 +992,7 @@ function question_category_select_menu($contexts, $top = false, $currentcat = 0,
foreach ($categoriesarray as $group => $opts) {
$options[] = array($group => $opts);
}
echo html_writer::label($selected, 'menucategory', false, array('class' => 'accesshide'));
echo html_writer::select($options, 'category', $selected, $choose);
}

View file

@ -929,6 +929,7 @@ class flexible_table {
$html = '<form action="'. $this->baseurl .'" method="post">';
$html .= '<div class="mdl-align">';
$html .= '<input type="submit" value="'.get_string('downloadas', 'table').'"/>';
$html .= html_writer::label($this->defaultdownloadformat, 'menudownload', false, array('class' => 'accesshide'));
$html .= html_writer::select($downloadoptions, 'download', $this->defaultdownloadformat, false);
$html .= '</div></form>';

View file

@ -2241,6 +2241,7 @@ function print_grade_menu($courseid, $name, $current, $includenograde=true, $ret
for ($i=100; $i>=1; $i--) {
$grades[$i] = $i;
}
$output .= html_writer::label(get_string('gradeitems', 'grades'), 'menu' . $name, false, array('class' => 'accesshide'));
$output .= html_writer::select($grades, $name, $current, false);
$linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$OUTPUT->pix_url('help') . '" /></span>';