Merge branch 'MDL-42505-Feedback-Inappropriate-use-of-fieldset-tags-around-cancel-button' of git://github.com/michael-milette/moodle

This commit is contained in:
Marina Glancy 2014-02-11 14:13:39 +08:00
commit 7480dbc5f2
5 changed files with 39 additions and 26 deletions

View File

@ -418,7 +418,6 @@ if ($feedback_can_submit) {
if (is_array($feedbackitems)) {
echo $OUTPUT->box_start('feedback_form');
echo '<form action="complete.php" method="post" onsubmit=" ">';
echo '<fieldset>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo $OUTPUT->box_start('feedback_anonymousinfo');
switch ($feedback->anonymous) {
@ -547,7 +546,6 @@ if ($feedback_can_submit) {
echo '<input name="savevalues" type="submit" '.$inputvalue.' />';
}
echo '</fieldset>';
echo '</form>';
echo $OUTPUT->box_end();
@ -562,11 +560,9 @@ if ($feedback_can_submit) {
}
}
echo '<form '.$action.' method="post" onsubmit=" ">';
echo '<fieldset>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="courseid" value="'. $courseid . '" />';
echo '<button type="submit">'.get_string('cancel').'</button>';
echo '</fieldset>';
echo '</form>';
echo $OUTPUT->box_end();
$SESSION->feedback->is_started = true;

View File

@ -378,7 +378,6 @@ if ($feedback_can_submit) {
if (is_array($feedbackitems)) {
echo $OUTPUT->box_start('feedback_form');
echo '<form action="complete_guest.php" method="post" onsubmit=" ">';
echo '<fieldset>';
echo '<input type="hidden" name="anonymous" value="0" />';
$inputvalue = 'value="'.FEEDBACK_ANONYMOUS_YES.'"';
echo '<input type="hidden" name="anonymous_response" '.$inputvalue.' />';
@ -493,7 +492,6 @@ if ($feedback_can_submit) {
echo '<input name="savevalues" type="submit" '.$inputvalue.' />';
}
echo '</fieldset>';
echo '</form>';
echo $OUTPUT->box_end();
@ -508,11 +506,9 @@ if ($feedback_can_submit) {
}
}
echo '<form '.$action.' method="post" onsubmit=" ">';
echo '<fieldset>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="courseid" value="'. $courseid . '" />';
echo '<button type="submit">'.get_string('cancel').'</button>';
echo '</fieldset>';
echo '</form>';
echo $OUTPUT->box_end();
$SESSION->feedback->is_started = true;

View File

@ -337,7 +337,12 @@ class feedback_item_multichoice extends feedback_item_base {
echo '<div class="feedback_item_presentation_'.$align.'">';
$index = 1;
$checked = '';
echo '<ul>';
if ($info->subtype == 'r' || $info->subtype == 'c') {
// if (r)adio buttons or (c)heckboxes
echo '<fieldset>';
echo '<ul>';
}
if ($info->horizontal) {
$hv = 'h';
} else {
@ -376,7 +381,11 @@ class feedback_item_multichoice extends feedback_item_base {
$this->print_item_dropdown($presentation, $item, false, $info, $align);
break;
}
echo '</ul>';
if ($info->subtype == 'r' || $info->subtype == 'c') {
// if (r)adio buttons or (c)heckboxes
echo '</ul>';
echo '</fieldset>';
}
echo '</div>';
}
@ -438,7 +447,11 @@ class feedback_item_multichoice extends feedback_item_base {
//print the presentation
echo '<div class="feedback_item_presentation_'.$align.$highlight.'">';
echo '<ul>';
if ($info->subtype == 'r' || $info->subtype == 'c') {
// if (r)adio buttons or (c)heckboxes
echo '<fieldset>';
echo '<ul>';
}
if ($info->horizontal) {
$hv = 'h';
} else {
@ -483,7 +496,11 @@ class feedback_item_multichoice extends feedback_item_base {
$this->print_item_dropdown($presentation, $item, $value, $info, $align);
break;
}
echo '</ul>';
if ($info->subtype == 'r' || $info->subtype == 'c') {
// if (r)adio buttons or (c)heckboxes
echo '</ul>';
echo '</fieldset>';
}
echo '</div>';
}
@ -774,8 +791,7 @@ class feedback_item_multichoice extends feedback_item_base {
}
?>
<li class="feedback_item_select_<?php echo $hv.'_'.$align;?>">
<label class="accesshide" for="<?php echo $item->typ .'_' . $item->id;?>"><?php echo $item->name; ?></label>
<div class="feedback_item_select_<?php echo $hv.'_'.$align;?>">
<select id="<?php echo $item->typ .'_' . $item->id;?>" name="<?php echo $item->typ .'_' . $item->id;?>[]" size="1">
<option value="0">&nbsp;</option>
<?php
@ -799,7 +815,7 @@ class feedback_item_multichoice extends feedback_item_base {
}
?>
</select>
</li>
</div>
<?php
}

View File

@ -520,6 +520,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
} else {
$hv = 'v';
}
echo '<fieldset>';
echo '<ul>';
if (!$this->hidenoselect($item)) {
?>
@ -576,6 +577,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
$index++;
}
echo '</ul>';
echo '</fieldset>';
}
private function print_item_dropdown($item, $value, $info, $align, $showrating, $lines) {
@ -584,10 +586,8 @@ class feedback_item_multichoicerated extends feedback_item_base {
} else {
$hv = 'v';
}
echo '<ul>';
?>
<li class="feedback_item_select_<?php echo $hv.'_'.$align;?>">
<label class="accesshide" for="<?php echo $item->typ.'_'.$item->id;?>"><?php echo $item->name; ?></label>
<div class="feedback_item_select_<?php echo $hv.'_'.$align;?>">
<select id="<?php echo $item->typ.'_'.$item->id;?>" name="<?php echo $item->typ.'_'.$item->id;?>">
<option value="0">&nbsp;</option>
<?php
@ -613,9 +613,8 @@ class feedback_item_multichoicerated extends feedback_item_base {
}
?>
</select>
</li>
</div>
<?php
echo '</ul>';
}
public function prepare_presentation_values($linesep1,

View File

@ -47,24 +47,30 @@ div.feedback_item_commands_right {
li.feedback_item_check_h_left,
li.feedback_item_check_h_right,
li.feedback_item_select_h_left,
li.feedback_item_select_h_right,
li.feedback_item_radio_h_left,
li.feedback_item_radio_h_right{
li.feedback_item_radio_h_right {
list-style-type:none;
display:inline;
}
div.feedback_item_select_h_left,
div.feedback_item_select_h_right {
display:block;
}
li.feedback_item_check_v_left,
li.feedback_item_check_v_right,
li.feedback_item_select_v_left,
li.feedback_item_select_v_right,
li.feedback_item_radio_v_left,
li.feedback_item_radio_v_right{
li.feedback_item_radio_v_right {
list-style-type:none;
display:block;
}
div.feedback_item_select_v_left,
div.feedback_item_select_v_right {
display:block;
}
div.feedback_items label{
display: inline;
}