[LON-CAPA-cvs] cvs: loncom /interface londocs.pm /publisher loncfile.pm

raeburn raeburn at source.lon-capa.org
Tue Aug 18 14:53:27 EDT 2026


raeburn		Tue Aug 18 18:53:27 2026 EDT

  Modified files:              
    /loncom/publisher	loncfile.pm 
    /loncom/interface	londocs.pm 
  Log:
  - Provide advice when "Accessibility" link/icon is used on a LON-CAPA
    host for which the lonAxeUse perlvar in loncapa.conf is not set to 'Y'.
  
  
Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.135 loncom/publisher/loncfile.pm:1.136
--- loncom/publisher/loncfile.pm:1.135	Wed May  6 17:55:19 2026
+++ loncom/publisher/loncfile.pm	Tue Aug 18 18:53:26 2026
@@ -9,7 +9,7 @@
 #  and displays a page showing the results of the action.
 #
 #
-# $Id: loncfile.pm,v 1.135 2026/05/06 17:55:19 raeburn Exp $
+# $Id: loncfile.pm,v 1.136 2026/08/18 18:53:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1027,6 +1027,15 @@
 
 sub Accessibility1 {
     my ($r,$fn) = @_;
+    if ($r->dir_config('lonAxeUse') ne 'Y') {
+        $r->print('<p>'.
+                  &mt('The LON-CAPA home server for this Authoring Space has not been configured to support this functionality.').'<br />'.
+                  &mt('Instead you can use a web browser extension such as [_1]WAVE[_2] from WebAIM or [_3]axe Developer Tools[_2] to test individual pages for accessibility.',
+                      '<a href="https://wave.webaim.org/">','</a>',
+                      '<a href="https://www.deque.com/axe/devtools/extension/">'). 
+                  '</p>');
+        return;
+    }
     my $warning = &lock_warning('Checking Accessibility');
     if ($warning) {
         $r->print($warning);
@@ -1135,6 +1144,15 @@
 
 sub Accessibility2 {
     my ($r,$uname,$udom,$fn,$identifier) = @_;
+    if ($r->dir_config('lonAxeUse') ne 'Y') {
+        $r->print('<p>'.
+                  &mt('The LON-CAPA home server for this Authoring Space has not been configured to support this functionality.').'<br />'.
+                  &mt('Instead you can use a web browser extension such as [_1]WAVE[_2] from WebAIM or [_3]axe Developer Tools[_2] to test individual pages for accessibility.',
+                      '<a href="https://wave.webaim.org/">','</a>',
+                      '<a href="https://www.deque.com/axe/devtools/extension/">').
+                  '</p>');
+        return;
+    }
     my $warning = &lock_warning('Checking Accessibility');
     if ($warning) {
         $r->print($warning);
@@ -2009,9 +2027,18 @@
                      .'<div class="LC_landmark" role="main" id="LC_main_content">'
                      .'<h2 class="LC_heading_2">'.&mt('Unable to determine Authoring Space context').'</h2>');
             if ($env{'form.action'} eq 'accessibility') {
-                $r->print('<p>'.
-                          &mt('Please display a resource or directory, and then click the "Accessibility" link/icon').
-                          '</p>');
+                if ($r->dir_config('lonAxeUse') ne 'Y') {
+                    $r->print('<p>'.
+                              &mt('The LON-CAPA homeserver for this Authoring Space has not been configured to support this functionality.').'<br />'.
+                              &mt('Instead you can use a web browser extension such as [_1]WAVE[_2] from WebAIM or [_3]axe Developer Tools[_2] to test individual pages for accessibility.',
+                                  '<a href="https://wave.webaim.org/">','</a>',
+                                  '<a href="https://www.deque.com/axe/devtools/extension/">').
+                              '</p>');
+                } else {
+                    $r->print('<p>'.
+                              &mt('Please display a resource or directory, and then click the "Accessibility" link/icon').
+                              '</p>');
+                }
             } else {
                 $r->print('<p>'.
                           &mt('Please display a directory, and then click the "Export" link/icon').
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.743 loncom/interface/londocs.pm:1.744
--- loncom/interface/londocs.pm:1.743	Sat Jun 27 21:29:17 2026
+++ loncom/interface/londocs.pm	Tue Aug 18 18:53:27 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.743 2026/06/27 21:29:17 raeburn Exp $
+# $Id: londocs.pm,v 1.744 2026/08/18 18:53:27 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7026,13 +7026,27 @@
       &init_breadcrumbs('exportcourse','IMS Export');
       &Apache::imsexport::exportcourse($r);
   } elsif ($allowed && $env{'form.wcagcheck'}) {
-      &init_breadcrumbs('wcagcheck','Select Resources for Accessibility Check','Docs_Accessibility_Check');
-      my @checkmain = &Apache::loncommon::get_env_multiple('form.wcagmain');
-      my @checksupp = &Apache::loncommon::get_env_multiple('form.wcagsupp');
-      if ((scalar(@checkmain) > 0) || (scalar(@checksupp) > 0)) {
-          &wcag_check_results($r,$canedit,$coursenum,$coursedom,\@checkmain,\@checksupp);
+      if ($r->dir_config('lonAxeUse') eq 'Y') {
+          &init_breadcrumbs('wcagcheck','Select Resources for Accessibility Check','Docs_Accessibility_Check');
+          my @checkmain = &Apache::loncommon::get_env_multiple('form.wcagmain');
+          my @checksupp = &Apache::loncommon::get_env_multiple('form.wcagsupp');
+          if ((scalar(@checkmain) > 0) || (scalar(@checksupp) > 0)) {
+              &wcag_check_results($r,$canedit,$coursenum,$coursedom,\@checkmain,\@checksupp);
+          } else {
+              &wcag_check_form($r,$canedit,$coursenum,$coursedom);
+          }
       } else {
-          &wcag_check_form($r,$canedit,$coursenum,$coursedom);
+          &init_breadcrumbs('wcagcheck','Accessibility Checking');
+          $r->print(&Apache::loncommon::start_page('Accessibility Checking'));
+          $r->print(&Apache::lonhtmlcommon::breadcrumbs('Accessibility'));
+          $r->print(&startContentScreen('tools'));
+          $r->print('<h2 class="LC_heading_2">'.&mt('Accessibility Checking Unavailable').'</h2>'."\n".
+                    '<p>'.
+                    &mt('The LON-CAPA server hosting your current session has not been configured to support this functionality.').'<br />'.
+                    &mt('Instead you can use a web browser extension such as [_1]WAVE[_2] from WebAIM or [_3]axe Developer Tools[_2] to test individual pages for accessibility.',
+                        '<a href="https://wave.webaim.org/">','</a>','<a href="https://www.deque.com/axe/devtools/extension/">'). 
+                    '</p>');
+          $r->print(&endContentScreen());
       }
   } else {
       if ($canedit && $env{'form.authorrole'}) {




More information about the LON-CAPA-cvs mailing list