mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +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);
|
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) {
|
if (!isteacher($course->id) and !$glossary->allowprintview) {
|
||||||
notice(get_string('printviewnotallowed', 'glossary'));
|
notice(get_string('printviewnotallowed', 'glossary'));
|
||||||
}
|
}
|
||||||
|
@ -150,15 +153,16 @@
|
||||||
// Setting the pivot for the current entry
|
// Setting the pivot for the current entry
|
||||||
$pivot = $entry->pivot;
|
$pivot = $entry->pivot;
|
||||||
if ( !$fullpivot ) {
|
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 there's group break
|
||||||
if ( $currentpivot != strtoupper($pivot) ) {
|
if ( $currentpivot != $upperpivot ) {
|
||||||
|
|
||||||
// print the group break if apply
|
// print the group break if apply
|
||||||
if ( $printpivot ) {
|
if ( $printpivot ) {
|
||||||
$currentpivot = strtoupper($pivot);
|
$currentpivot = $upperpivot;
|
||||||
|
|
||||||
$pivottoshow = $currentpivot;
|
$pivottoshow = $currentpivot;
|
||||||
if ( isset($entry->uid) ) {
|
if ( isset($entry->uid) ) {
|
||||||
|
|
|
@ -320,14 +320,15 @@
|
||||||
$pivot = $entry->pivot;
|
$pivot = $entry->pivot;
|
||||||
if ( !$fullpivot ) {
|
if ( !$fullpivot ) {
|
||||||
$pivot = $textlib->substr($pivot, 0, 1, current_charset());
|
$pivot = $textlib->substr($pivot, 0, 1, current_charset());
|
||||||
|
$upperpivot = $textlib->strtoupper($pivot, current_charset());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// if there's a group break
|
/// if there's a group break
|
||||||
if ( $currentpivot != strtoupper($pivot) ) {
|
if ( $currentpivot != $upperpivot ) {
|
||||||
|
|
||||||
// print the group break if apply
|
// print the group break if apply
|
||||||
if ( $printpivot ) {
|
if ( $printpivot ) {
|
||||||
$currentpivot = strtoupper($pivot);
|
$currentpivot = $upperpivot;
|
||||||
|
|
||||||
echo '<div>';
|
echo '<div>';
|
||||||
echo '<table cellspacing="0" class="categoryheader">';
|
echo '<table cellspacing="0" class="categoryheader">';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue