[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm lonbulletin.pm lonsimplepage.pm lonsyllabus.pm lontemplate.pm

raeburn raeburn at source.lon-capa.org
Tue Jan 28 14:49:20 EST 2025


raeburn		Tue Jan 28 19:49:20 2025 EDT

  Modified files:              
    /loncom/interface	lonaboutme.pm lonbulletin.pm lonsimplepage.pm 
                     	lonsyllabus.pm lontemplate.pm 
  Log:
  - WCAG 2 compliance
  
  
-------------- next part --------------
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.169 loncom/interface/lonaboutme.pm:1.170
--- loncom/interface/lonaboutme.pm:1.169	Thu Dec 28 17:56:01 2023
+++ loncom/interface/lonaboutme.pm	Tue Jan 28 19:49:20 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Personal Information Page
 #
-# $Id: lonaboutme.pm,v 1.169 2023/12/28 17:56:01 raeburn Exp $
+# $Id: lonaboutme.pm,v 1.170 2025/01/28 19:49:20 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -358,12 +358,13 @@
         }
 
         if ($allowed) {
+            my $labeltext = &HTML::Entities::encode(&mt('Choose photo file'),'"&<>');
             $r->print(
                 '<form name="UploadPhoto" method="post" enctype="multipart/form-data" action="">'.
                 '<h3>'.&mt('Upload a Photo').'</h3>'.
                 '<p class="LC_info">'.
                 &mt('LON-CAPA will automatically scale your uploaded file so the image will not exceed a width of 400px and a height of 500px.').'</p>'.
-                '<input type="file" name="uploaddoc" size="50" />'.
+                '<input type="file" name="uploaddoc" size="50" aria-label="'.$labeltext.'" />'.
                 '<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'.
                 '<input type="hidden" name="popup" value="'.$env{'form.popup'}.'" />'.
                 '</form>');
Index: loncom/interface/lonbulletin.pm
diff -u loncom/interface/lonbulletin.pm:1.69 loncom/interface/lonbulletin.pm:1.70
--- loncom/interface/lonbulletin.pm:1.69	Tue Sep  8 23:54:40 2020
+++ loncom/interface/lonbulletin.pm	Tue Jan 28 19:49:20 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Bulletin Board Handler
 #
-# $Id: lonbulletin.pm,v 1.69 2020/09/08 23:54:40 raeburn Exp $
+# $Id: lonbulletin.pm,v 1.70 2025/01/28 19:49:20 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -239,7 +239,8 @@
             $r->print($titletext);
 			$r->print("<br /><div>");
 			&Apache::lontemplate::print_textarea_template($r, $syllabus{'aaa_title'},
-				'aaa_title', Apache::lontemplate->RICH_TEXT_ALWAYS_OFF);
+				'aaa_title', $syllabusfields{'aaa_title'},
+				Apache::lontemplate->RICH_TEXT_ALWAYS_OFF);
 			&Apache::lontemplate::print_saveall_template($r);
 			$r->print("</div>");
 			&Apache::lontemplate::print_end_template($r);
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.107 loncom/interface/lonsimplepage.pm:1.108
--- loncom/interface/lonsimplepage.pm:1.107	Tue Nov 30 15:55:37 2021
+++ loncom/interface/lonsimplepage.pm	Tue Jan 28 19:49:20 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Page Editor
 #
-# $Id: lonsimplepage.pm,v 1.107 2021/11/30 15:55:37 raeburn Exp $
+# $Id: lonsimplepage.pm,v 1.108 2025/01/28 19:49:20 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -298,7 +298,8 @@
 				$r->print($titletext);
 				$r->print("<br /><div>");
 				&Apache::lontemplate::print_textarea_template($r, $syllabus{'aaa_title'},
-					'aaa_title', Apache::lontemplate->RICH_TEXT_ALWAYS_OFF);
+					'aaa_title', $syllabusfields{'aaa_title'},
+					Apache::lontemplate->RICH_TEXT_ALWAYS_OFF);
 				&Apache::lontemplate::print_saveall_template($r);
 				$r->print("</div>");
 				&Apache::lontemplate::print_end_template($r);
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.155 loncom/interface/lonsyllabus.pm:1.156
--- loncom/interface/lonsyllabus.pm:1.155	Thu Jan 25 22:23:32 2024
+++ loncom/interface/lonsyllabus.pm	Tue Jan 28 19:49:20 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.155 2024/01/25 22:23:32 raeburn Exp $
+# $Id: lonsyllabus.pm,v 1.156 2025/01/28 19:49:20 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -521,7 +521,7 @@
 				 $r->print($urls);
 				 $r->print("<br /><div>");
 				 &Apache::lontemplate::print_textarea_template($r, $data{$field},
-					$field, Apache::lontemplate->RICH_TEXT_ALWAYS_OFF);
+					$field, $fields{$field}, Apache::lontemplate->RICH_TEXT_ALWAYS_OFF);
 				 &Apache::lontemplate::print_saveall_template($r);                         
 				 $r->print("</div>");
 				 &Apache::lontemplate::print_end_template($r);
@@ -860,11 +860,12 @@
         $output .= '<label><input type="radio" name="choice" value="'.$item.'" '.$checked{$item}.' onclick="toggleEditor('."'$item'".')" />'.
                    $lt{$item}.'</label><br />';
     }
+    my $urllabeltext = &HTML::Entities::encode(&mt('Enter URL'),'"&<>');
     $output .= '</fieldset></div>'."\n".
                '<div id="url" class="LC_left_float" style="display: '.$display{'url'}.'">'."\n".
                '<fieldset><legend>'.$lt{'chourl'}.'</legend><span class="LC_nobreak">'."\n".
                '<a href="javascript:extUrlPreview('."'syllabusurl','$protocol'".');">'.$lt{'pr'}.'</a></span> '."\n".
-               '<input type="text" id="syllabusurl" name="externalsyllabus" value="'.$external.'" size="55" />'."\n".
+               '<input type="text" id="syllabusurl" name="externalsyllabus" value="'.$external.'" size="55" aria-label="'.$urllabeltext.'" />'."\n".
                ' <input type="submit" name="storeurl" value="'.$lt{'save'}.'" />'."\n".
                '</fieldset></div>'."\n".
                '<div id="minimal" class="LC_left_float" style="display: '.$display{'minimal'}.'">'."\n".
@@ -875,8 +876,8 @@
                    '<input type="hidden" name="minimalfile" value="'.&HTML::Entities::encode($absurl).'?inhibitmenu=yes" id="currminimal" />'.
                    $depbutton;
     } else {
-        $output .= &mt('Title of Syllabus Page:').' '.
-                   '<input type="text" id="minimaltitle" name="syllabustitle" value="'.&mt('Syllabus').'" size="30" />'."\n".
+        $output .= '<label>'.&mt('Title of Syllabus Page:').' '.
+                   '<input type="text" id="minimaltitle" name="syllabustitle" value="'.&mt('Syllabus').'" size="30" /></label>'."\n".
                    ' <input type="submit" name="storeminimal" value="'.$lt{'sved'}.'" />'."\n";
     }
     $output .= '</fieldset></div>'."\n".
@@ -891,9 +892,10 @@
     } else {
         $output .= $lt{'upl'};
     }
+    my $labeltext = &HTML::Entities::encode(&mt('Choose syllabus file'),'"&<>');
     $output .= '<br />'."\n".
                '<span class="LC_nobreak">'.
-               '<input type="file" name="syllabusfile" size="55" />'."\n".
+               '<input type="file" name="syllabusfile" size="55" aria-label="'.$labeltext.'" />'."\n".
                ' <input type="submit" name="storefile" value="'.$lt{'save'}.'" />'.
                '</span><br />'.
                '<label>'.
@@ -1057,7 +1059,7 @@
         if ($allowed) {
             $r->print(&Apache::loncommon::start_data_table().
                       &Apache::loncommon::start_data_table_header_row().
-                      '<th>'.&mt('Role hidden?').'</th><th>'.&mt('Role').'</th>'.
+                      '<th>'.&mt('Role (hidden if checked)').'</th>'.
                       '<th>'.&mt('Personnel (hidden if checked)').'</th>'.
                       &Apache::loncommon::end_data_table_header_row());
         } else {
@@ -1089,10 +1091,9 @@
                     $checked = ' checked="checked"';
                 }
                 $r->print(&Apache::loncommon::start_data_table_row().
-                          '<td>'.
+                          '<td><span class="LC_nobreak"><label>'.
                           '<input type="checkbox" name="hiderole" value="'.$element.'" '.
-                          $checked.' />'.
-                          '</td><td>'.$roletext.'</td><td>');
+                          $checked.' />'.$roletext.'</label></span></td><td>');
             } else {
                 $r->print(&Apache::lonhtmlcommon::row_title($roletext));
             }
Index: loncom/interface/lontemplate.pm
diff -u loncom/interface/lontemplate.pm:1.51 loncom/interface/lontemplate.pm:1.52
--- loncom/interface/lontemplate.pm:1.51	Sun Sep 22 15:56:24 2013
+++ loncom/interface/lontemplate.pm	Tue Jan 28 19:49:20 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "Template" Functions to generate html output
 #
-# $Id: lontemplate.pm,v 1.51 2013/09/22 15:56:24 raeburn Exp $
+# $Id: lontemplate.pm,v 1.52 2025/01/28 19:49:20 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -86,7 +86,7 @@
 			  &print_template($r,$syllabusfields{$field},$message,$allowed,'LC_Box');
 		    }
 			if($allowed) {
-               &print_editbox_template($r,$syllabus{$field},$field);
+               &print_editbox_template($r,$syllabus{$field},$field,$syllabusfields{$field});
 			}
 
               } else {
@@ -130,16 +130,18 @@
 }
 
 sub print_editbox_template {
-	my ($r,$content,$field) = @_;
-	$r->print('<textarea cols="81" rows="6" name="'.$field.'">'.
+	my ($r,$content,$field,$fieldname) = @_;
+	my $labeltext = &HTML::Entities::encode(&mt('Edit [_1]',$fieldname),'"&<>');
+	$r->print('<textarea cols="81" rows="6" name="'.$field.'" aria-label="'.$labeltext.'">'.
                   &HTML::Entities::encode($content,'"&<>').
                   '</textarea><br />'."\n");
 	&print_saveall_template($r);
 }
 
 sub print_textarea_template {
-	my ($r, $content, $field, $wysiwyg) = @_;
-	$r->print('<textarea cols="81" rows="6" class="'.$wysiwyg.'" id="'.$field.'" name="'.$field.'">'.
+	my ($r, $content, $field, $fieldname, $wysiwyg) = @_;
+	my $labeltext = &HTML::Entities::encode(&mt('Edit [_1]',$fieldname),'"&<>');
+	$r->print('<textarea cols="81" rows="6" class="'.$wysiwyg.'" id="'.$field.'" name="'.$field.'" aria-label="'.$labeltext.'">'.
 						  &HTML::Entities::encode($content, '"&<>').
 			'</textarea><br />');
 }
@@ -183,8 +185,8 @@
 					$r->print($message);
 					if ($allowed) {
 						$r->print("<br /><div>");
-						&Apache::lontemplate::print_textarea_template($r, $data{$field},
-							$field, $default_rich_text);
+						&print_textarea_template($r, $data{$field},
+							$field, $fields{$field}, $default_rich_text);
 						&print_saveall_template($r);
 						$r->print("</div>");
 					} 


More information about the LON-CAPA-cvs mailing list