[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm
raeburn
raeburn at source.lon-capa.org
Mon Dec 15 00:26:26 EST 2025
raeburn Mon Dec 15 05:26:26 2025 EDT
Modified files:
/loncom/interface lonhtmlcommon.pm
Log:
- WCAG 2 compliance.
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.426 loncom/interface/lonhtmlcommon.pm:1.427
--- loncom/interface/lonhtmlcommon.pm:1.426 Sat Dec 13 13:33:33 2025
+++ loncom/interface/lonhtmlcommon.pm Mon Dec 15 05:26:26 2025
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.426 2025/12/13 13:33:33 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.427 2025/12/15 05:26:26 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -322,11 +322,14 @@
}
sub select_recent {
- my ($area,$fieldname,$event)=@_;
+ my ($area,$fieldname,$event,$arialabel)=@_;
+ if ($arialabel ne '') {
+ $arialabel = " aria-label='$arialabel'";
+ }
my %recent=&Apache::lonnet::dump(&recent_filename($area));
my $return="\n<select name='$fieldname'".
($event?" onchange='$event'":'').
- ">\n<option value=''>--- ".&mt('Recent')." ---</option>";
+ "$arialabel>\n<option value=''>--- ".&mt('Recent')." ---</option>";
foreach my $value (sort(keys(%recent))) {
unless ($value =~/^error\:/) {
my $escaped = &Apache::loncommon::escape_url($value);
@@ -971,6 +974,8 @@
$onchange: javascript to use when the value is changed. Enclosed in
double quotes, ""s, not single quotes.
+$id: optional id attribute for selection box.
+
=back
Returns: a perl string as described.
@@ -980,7 +985,7 @@
##############################################
##############################################
sub StatusOptions {
- my ($status, $formName,$size,$onchange,$mult)=@_;
+ my ($status, $formName,$size,$onchange,$mult,$id)=@_;
$size = 1 if (!defined($size));
if (! defined($status)) {
$status = 'Active';
@@ -998,7 +1003,10 @@
if (defined($onchange)) {
$Str .= ' onchange="'.$onchange.'"';
}
- $Str .= ' size="'.$size.'" ';
+ $Str .= ' size="'.$size.'"';
+ if ($id ne '') {
+ $Str .= ' id="'.$id.'"';
+ }
$Str .= '>'."\n";
foreach my $type (['Active', &mt('Currently Has Access')],
['Future', &mt('Will Have Future Access')],
More information about the LON-CAPA-cvs
mailing list