From: nfreear Date: Mon, 24 Sep 2007 17:09:37 +0000 (+0000) Subject: Partial fix for reopened MDL-7474, Accessibility: "Provide alt text for ascending... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=468c120ae909f7f9f248010295474eb072f24723;p=moodle.git Partial fix for reopened MDL-7474, Accessibility: "Provide alt text for ascending/ descending icons in glossary" --- diff --git a/lang/en_utf8/glossary.php b/lang/en_utf8/glossary.php index 4fba94447c..3f51155731 100644 --- a/lang/en_utf8/glossary.php +++ b/lang/en_utf8/glossary.php @@ -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'; diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 395b67944c..f84b668ac5 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -1444,15 +1444,19 @@ global $CFG; $bclose = ''; $neworder = ''; + $currentorder = ''; + $currentsort = ''; if ( $sortorder ) { if ( $sortorder == 'asc' ) { + $currentorder = $asc; $neworder = '&sortorder=desc'; - $newordertitle = $desc; + $newordertitle = get_string('changeto', 'glossary', $desc); } else { + $currentorder = $desc; $neworder = '&sortorder=asc'; - $newordertitle = $asc; + $newordertitle = get_string('changeto', 'glossary', $asc); } - $icon = " \""."; + $icon = " \"$newordertitle\""; } else { if ( $sortkey != 'CREATION' and $sortkey != 'UPDATE' and $sortkey != 'FIRSTNAME' and $sortkey != 'LASTNAME' ) { @@ -1461,7 +1465,7 @@ global $CFG; } else { $newordertitle = $desc; $neworder = '&sortorder=desc'; - $icon = ' '; + $icon = ' '.$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 "
$sort: $sbtagwwwroot/mod/glossary/view.php?id=$cm->id&sortkey=$sorder$sneworder&mode=$mode\">$ssort$sicon$sendbtag | ". + $current = ''.get_string('current', 'glossary', "$currentsort $currentorder").''; + echo "
$current $sort: $sbtagwwwroot/mod/glossary/view.php?id=$cm->id&sortkey=$sorder$sneworder&mode=$mode\">$ssort$sicon$sendbtag | ". "$fbtagwwwroot/mod/glossary/view.php?id=$cm->id&sortkey=$forder$fneworder&mode=$mode\">$fsort$ficon$fendbtag
"; }