mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Now glossary pivot should be working fine under every charset.
This commit is contained in:
parent
5112f02cbe
commit
7123515431
2 changed files with 10 additions and 5 deletions
|
@ -34,6 +34,9 @@
|
|||
|
||||
require_course_login($course, true, $cm);
|
||||
|
||||
/// Loading the textlib singleton instance. We are going to need it.
|
||||
$textlib = textlib_get_instance();
|
||||
|
||||
if (!isteacher($course->id) and !$glossary->allowprintview) {
|
||||
notice(get_string('printviewnotallowed', 'glossary'));
|
||||
}
|
||||
|
@ -150,15 +153,16 @@
|
|||
// Setting the pivot for the current entry
|
||||
$pivot = $entry->pivot;
|
||||
if ( !$fullpivot ) {
|
||||
$pivot = substr($pivot, 0, 1);
|
||||
$pivot = $textlib->substr($pivot, 0, 1, current_charset());
|
||||
$upperpivot = $textlib->strtoupper($pivot, current_charset());
|
||||
}
|
||||
|
||||
// If there's group break
|
||||
if ( $currentpivot != strtoupper($pivot) ) {
|
||||
if ( $currentpivot != $upperpivot ) {
|
||||
|
||||
// print the group break if apply
|
||||
if ( $printpivot ) {
|
||||
$currentpivot = strtoupper($pivot);
|
||||
$currentpivot = $upperpivot;
|
||||
|
||||
$pivottoshow = $currentpivot;
|
||||
if ( isset($entry->uid) ) {
|
||||
|
|
|
@ -320,14 +320,15 @@
|
|||
$pivot = $entry->pivot;
|
||||
if ( !$fullpivot ) {
|
||||
$pivot = $textlib->substr($pivot, 0, 1, current_charset());
|
||||
$upperpivot = $textlib->strtoupper($pivot, current_charset());
|
||||
}
|
||||
|
||||
/// if there's a group break
|
||||
if ( $currentpivot != strtoupper($pivot) ) {
|
||||
if ( $currentpivot != $upperpivot ) {
|
||||
|
||||
// print the group break if apply
|
||||
if ( $printpivot ) {
|
||||
$currentpivot = strtoupper($pivot);
|
||||
$currentpivot = $upperpivot;
|
||||
|
||||
echo '<div>';
|
||||
echo '<table cellspacing="0" class="categoryheader">';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue