mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 08:09:47 +02:00
MDL-17974: Calendar 'new entry' accessibility improvement
This commit is contained in:
parent
40e1ba894d
commit
c5cf6bb2e2
2 changed files with 41 additions and 13 deletions
|
@ -5,18 +5,18 @@
|
||||||
<form method="post" action="event.php" id="eventform">
|
<form method="post" action="event.php" id="eventform">
|
||||||
<table cellpadding="5">
|
<table cellpadding="5">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="vertical-align: top; text-align: right;">
|
<td style="vertical-align: top; text-align: right;"><label for="eventname">
|
||||||
<?php print_string('eventname', 'calendar'); ?>:
|
<?php print_string('eventname', 'calendar'); ?>:
|
||||||
</td>
|
</label></td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="name" size="67" value="<?php p($form->name); ?>" />
|
<input type="text" name="name" size="67" id="eventname" value="<?php p($form->name); ?>" />
|
||||||
<?php if (isset($err['name'])) formerr($err['name']); ?>
|
<?php if (isset($err['name'])) formerr($err['name']); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="vertical-align: top; text-align: right;">
|
<td style="vertical-align: top; text-align: right;"><label for="edit-description">
|
||||||
<?php print_string('eventdescription', 'calendar'); ?>:
|
<?php print_string('eventdescription', 'calendar'); ?>:
|
||||||
</td>
|
</label></td>
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
print_textarea($usehtmleditor, 20, 65, 630, 300, "description", $form->description);
|
print_textarea($usehtmleditor, 20, 65, 630, 300, "description", $form->description);
|
||||||
|
@ -55,8 +55,9 @@
|
||||||
<div>
|
<div>
|
||||||
<input type="radio" name="duration" value="2" id="duration_minutes" <?php if($form->duration == 2) echo 'checked="checked"'; ?>/>
|
<input type="radio" name="duration" value="2" id="duration_minutes" <?php if($form->duration == 2) echo 'checked="checked"'; ?>/>
|
||||||
<label for="duration_minutes"><?php print_string('durationminutes', 'calendar'); ?></label>
|
<label for="duration_minutes"><?php print_string('durationminutes', 'calendar'); ?></label>
|
||||||
<input type="text" name="minutes" size="3" value="<?php p($form->minutes); ?>" />
|
<input type="text" name="minutes" size="3" value="<?php p($form->minutes); ?>" id="minutes"/>
|
||||||
<?php if (isset($err['minutes'])) formerr($err['minutes']); ?>
|
<?php if (isset($err['minutes'])) formerr($err['minutes']); ?>
|
||||||
|
<label class="accesshide" for="minutes"><?php print_string('minutes') ?></label>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -77,8 +78,8 @@
|
||||||
<label for="repeat_yes">
|
<label for="repeat_yes">
|
||||||
<?php print_string('repeatweeksl', 'calendar'); ?>
|
<?php print_string('repeatweeksl', 'calendar'); ?>
|
||||||
</label>
|
</label>
|
||||||
<input type="text" name="repeats" size="2" value="<?php p($form->repeats); ?>" />
|
<input id="repeats" type="text" name="repeats" size="2" value="<?php p($form->repeats); ?>" />
|
||||||
<?php print_string('repeatweeksr', 'calendar'); ?>
|
<label for="repeats"><?php print_string('repeatweeksr', 'calendar'); ?></label>
|
||||||
<?php if (isset($err['repeats'])) formerr($err['repeats']); ?>
|
<?php if (isset($err['repeats'])) formerr($err['repeats']); ?>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -5464,10 +5464,24 @@ function print_date_selector($day, $month, $year, $currenttime=0, $return=false)
|
||||||
for ($i=1970; $i<=2020; $i++) {
|
for ($i=1970; $i<=2020; $i++) {
|
||||||
$years[$i] = $i;
|
$years[$i] = $i;
|
||||||
}
|
}
|
||||||
return choose_from_menu($days, $day, $currentdate['mday'], '', '', '0', $return)
|
|
||||||
.choose_from_menu($months, $month, $currentdate['mon'], '', '', '0', $return)
|
|
||||||
.choose_from_menu($years, $year, $currentdate['year'], '', '', '0', $return);
|
|
||||||
|
|
||||||
|
// Build or print result
|
||||||
|
$result='';
|
||||||
|
// Note: There should probably be a fieldset around these fields as they are
|
||||||
|
// clearly grouped. However this causes problems with display. See Mozilla
|
||||||
|
// bug 474415
|
||||||
|
$result.='<label class="accesshide" for="menu'.$day.'">'.get_string('day','form').'</label>';
|
||||||
|
$result.=choose_from_menu($days, $day, $currentdate['mday'], '', '', '0', true);
|
||||||
|
$result.='<label class="accesshide" for="menu'.$month.'">'.get_string('month','form').'</label>';
|
||||||
|
$result.=choose_from_menu($months, $month, $currentdate['mon'], '', '', '0', true);
|
||||||
|
$result.='<label class="accesshide" for="menu'.$year.'">'.get_string('year','form').'</label>';
|
||||||
|
$result.=choose_from_menu($years, $year, $currentdate['year'], '', '', '0', true);
|
||||||
|
|
||||||
|
if ($return) {
|
||||||
|
return $result;
|
||||||
|
} else {
|
||||||
|
echo $result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5495,8 +5509,21 @@ function print_time_selector($hour, $minute, $currenttime=0, $step=5, $return=fa
|
||||||
$minutes[$i] = sprintf("%02d",$i);
|
$minutes[$i] = sprintf("%02d",$i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return choose_from_menu($hours, $hour, $currentdate['hours'], '','','0',$return)
|
// Build or print result
|
||||||
.choose_from_menu($minutes, $minute, $currentdate['minutes'], '','','0',$return);
|
$result='';
|
||||||
|
// Note: There should probably be a fieldset around these fields as they are
|
||||||
|
// clearly grouped. However this causes problems with display. See Mozilla
|
||||||
|
// bug 474415
|
||||||
|
$result.='<label class="accesshide" for="menu'.$hour.'">'.get_string('hour','form').'</label>';
|
||||||
|
$result.=choose_from_menu($hours, $hour, $currentdate['hours'], '','','0',true);
|
||||||
|
$result.='<label class="accesshide" for="menu'.$minute.'">'.get_string('minute','form').'</label>';
|
||||||
|
$result.=choose_from_menu($minutes, $minute, $currentdate['minutes'], '','','0',true);
|
||||||
|
|
||||||
|
if ($return) {
|
||||||
|
return $result;
|
||||||
|
} else {
|
||||||
|
echo $result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue