diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index de95bb8a08a42..5991cef8ef2bd 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -1834,7 +1834,7 @@ function glossary_print_approval_menu($cm, $glossary,$mode, $hook, $sortkey = '' glossary_print_all_links($cm, $glossary, $mode, $hook); - glossary_print_sorting_links($cm, $mode, 'CREATION', 'asc'); + glossary_print_sorting_links($cm, $mode, $sortkey, $sortorder); } /** * @param object $cm @@ -2056,9 +2056,14 @@ function glossary_print_sorting_links($cm, $mode, $sortkey = '',$sortorder = '') $bopen = ''; $bclose = ''; - $neworder = ''; - $currentorder = ''; - $currentsort = ''; + $neworder = ''; + $currentorder = ''; + $currentsort = ''; + + if ($sortkey === '') { + $sortkey = 'CREATION'; + } + if ( $sortorder ) { if ( $sortorder == 'asc' ) { $currentorder = $asc; @@ -2081,20 +2086,18 @@ function glossary_print_sorting_links($cm, $mode, $sortkey = '',$sortorder = '') $icon = " " . $OUTPUT->pix_icon('asc', $newordertitle, 'glossary'); } } - $ficon = ''; - $fneworder = ''; - $fbtag = ''; - $fendbtag = ''; - $sicon = ''; - $sneworder = ''; + $ficon = ''; + $fneworder = ''; + + $sicon = ''; + $sneworder = ''; - $sbtag = ''; - $fbtag = ''; - $fendbtag = ''; - $sendbtag = ''; + $sbtag = ''; + $fbtag = ''; + $fendbtag = ''; - $sendbtag = ''; + $sendbtag = ''; if ( $sortkey == 'CREATION' or $sortkey == 'FIRSTNAME' ) { $ficon = $icon;