]> git.mjollnir.org Git - moodle.git/commitdiff
Partial fix for reopened MDL-7474, Accessibility: "Provide alt text for ascending...
authornfreear <nfreear>
Mon, 24 Sep 2007 17:09:37 +0000 (17:09 +0000)
committernfreear <nfreear>
Mon, 24 Sep 2007 17:09:37 +0000 (17:09 +0000)
lang/en_utf8/glossary.php
mod/glossary/lib.php

index 4fba94447ce815332db4d76dc09a37b35a9d5dfb..3f5115573150b3546c55df1ba399fa724199c256 100644 (file)
@@ -17,7 +17,7 @@ $string['approve'] = 'Approve';
 $string['areyousuredelete'] = 'Are you sure you want to delete this entry?';
 $string['areyousuredeletecomment'] = 'Are you sure you want to delete this comment?';
 $string['areyousureexport'] = 'Are you sure you want to export this entry to';
-$string['ascending'] = '(ascending)';
+$string['ascending'] = 'ascending';
 $string['attachment'] = 'Attachment';
 $string['authorview'] = 'Browse by Author';
 $string['back'] = 'Back';
@@ -52,6 +52,8 @@ $string['concept'] = 'Concept';
 $string['concepts'] = 'Concepts';
 $string['configenablerssfeeds'] = 'This switch will enable the possibility of RSS feeds for all glosaries.  You will still need to turn feeds on manually in the settings for each glossary.';
 $string['currentglossary'] = 'Current glossary';
+$string['changeto'] = 'change to $a';
+$string['current']= 'Currently sorted $a';
 $string['errconceptalreadyexists'] = 'This concept already exists. No duplicates allowed in this glossary.';
 $string['erredittimeexpired'] = 'The editing time for this entry has expired.';
 $string['errcannoteditothers'] = 'You cannot edit other people\'s entries.';
@@ -62,7 +64,7 @@ $string['definitions'] = 'Definitions';
 $string['deleteentry'] = 'Delete entry';
 $string['deletingcomment'] = 'Deleting comment';
 $string['deletingnoneemptycategory'] = 'Deleting this category will not delete the entries it contains - they will be marked as uncategorised.';
-$string['descending'] = '(descending)';
+$string['descending'] = 'descending';
 $string['destination'] = 'Destination';
 $string['displayformat'] = 'Display format';
 $string['displayformatcontinuous'] = 'Continuous without author';
index 395b67944c0a7c518ea78ed12e1ebe7b39a564b0..f84b668ac5a6a819a5c849b1002aadba3d4aeff7 100644 (file)
@@ -1444,15 +1444,19 @@ global $CFG;
     $bclose = '</b>';
 
      $neworder = '';
+     $currentorder = '';
+     $currentsort = '';
      if ( $sortorder ) {
          if ( $sortorder == 'asc' ) {
+             $currentorder = $asc;
              $neworder = '&amp;sortorder=desc';
-             $newordertitle = $desc;
+             $newordertitle = get_string('changeto', 'glossary', $desc);
          } else {
+             $currentorder = $desc;
              $neworder = '&amp;sortorder=asc';
-             $newordertitle = $asc;
+             $newordertitle = get_string('changeto', 'glossary', $asc);
          }
-         $icon = " <img src=\"$sortorder.gif\" class=\"icon\" alt=\"". get_string($sortorder)."\" />";
+         $icon = " <img src=\"$sortorder.gif\" class=\"icon\" alt=\"$newordertitle\" />";
      } else {
          if ( $sortkey != 'CREATION' and $sortkey != 'UPDATE' and
                $sortkey != 'FIRSTNAME' and $sortkey != 'LASTNAME' ) {
@@ -1461,7 +1465,7 @@ global $CFG;
          } else {
              $newordertitle = $desc;
              $neworder = '&amp;sortorder=desc';
-             $icon = ' <img src="asc.gif" border="0" class="icon" alt="" />';
+             $icon = ' <img src="asc.gif" class="icon" alt="'.$newordertitle.'" />';
          }
      }
      $ficon     = '';
@@ -1504,6 +1508,10 @@ global $CFG;
          $fsort  = get_string("sortbycreation", "glossary");
          $ssort  = get_string("sortbylastupdate", "glossary");
 
+         $currentsort = $fsort;
+         if ($sortkey == 'UPDATE') {
+             $currentsort = $ssort;
+         }
          $sort        = get_string("sortchronogically", "glossary");
      } elseif ( $sortkey == 'FIRSTNAME' or $sortkey == 'LASTNAME') {
          $forder = 'FIRSTNAME';
@@ -1511,10 +1519,14 @@ global $CFG;
          $fsort  = get_string("firstname");
          $ssort  = get_string("lastname");
 
+         $currentsort = $fsort;
+         if ($sortkey == 'LASTNAME') {
+             $currentsort = $ssort;
+         }
          $sort        = get_string("sortby", "glossary");
      }
-
-     echo "<br />$sort: $sbtag<a title=\"$ssort $sordertitle\" href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&amp;sortkey=$sorder$sneworder&amp;mode=$mode\">$ssort$sicon</a>$sendbtag | ".
+     $current = '<span class="accesshide">'.get_string('current', 'glossary', "$currentsort $currentorder").'</span>';
+     echo "<br />$current $sort: $sbtag<a title=\"$ssort $sordertitle\" href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&amp;sortkey=$sorder$sneworder&amp;mode=$mode\">$ssort$sicon</a>$sendbtag | ".
                           "$fbtag<a title=\"$fsort $fordertitle\" href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&amp;sortkey=$forder$fneworder&amp;mode=$mode\">$fsort$ficon</a>$fendbtag<br />";
 }