Partial fix for reopened MDL-7474, Accessibility: "Provide alt text for ascending/ descending icons in glossary"

This commit is contained in:
nfreear 2007-09-24 17:09:37 +00:00
parent 9d42692aad
commit 468c120ae9
2 changed files with 22 additions and 8 deletions

View 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';

View 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 />";
}