mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'MDL-19270_master' of https://github.com/nadavkav/moodle
Conflicts: lib/graphlib.php
This commit is contained in:
commit
a77e8b7b7b
@ -1190,11 +1190,26 @@ class graph {
|
|||||||
//ImageColorTransparent($this->image, $this->colour['white']); // colour for transparency
|
//ImageColorTransparent($this->image, $this->colour['white']); // colour for transparency
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepare label's text for GD output.
|
||||||
|
*
|
||||||
|
* @param string $label string to be prepared.
|
||||||
|
* @return string Reversed input string, if we are in RTL mode and has no numbers.
|
||||||
|
* Otherwise, returns the string as is.
|
||||||
|
*/
|
||||||
|
private function prepare_label_text($label) {
|
||||||
|
if (right_to_left() and !preg_match('/[0-9]/i', $label)) {
|
||||||
|
return core_text::strrev($label);
|
||||||
|
} else {
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function print_TTF($message) {
|
function print_TTF($message) {
|
||||||
$points = $message['points'];
|
$points = $message['points'];
|
||||||
$angle = $message['angle'];
|
$angle = $message['angle'];
|
||||||
// We have to manually reverse the label, since php GD cannot handle RTL characters properly in UTF8 strings.
|
// We have to manually reverse the label, since php GD cannot handle RTL characters properly in UTF8 strings.
|
||||||
$text = (right_to_left()) ? core_text::strrev($message['text']) : $message['text'];
|
$text = $this->prepare_label_text($message['text']);
|
||||||
$colour = $this->colour[$message['colour']];
|
$colour = $this->colour[$message['colour']];
|
||||||
$font = $this->parameter['path_to_fonts'].$message['font'];
|
$font = $this->parameter['path_to_fonts'].$message['font'];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user