MDL-76367 core: Apply RTL transformations to editors too

This commit is contained in:
Andrew Nicols
2022-11-18 15:13:12 +08:00
parent 899397c0af
commit 44d6b24d28
2 changed files with 18 additions and 7 deletions
+15 -4
View File
@@ -925,6 +925,11 @@ class theme_config {
public function editor_css_url($encoded=true) {
global $CFG;
$rev = theme_get_revision();
$type = 'editor';
if (right_to_left()) {
$type .= '-rtl';
}
if ($rev > -1) {
$themesubrevision = theme_get_sub_revision_for_theme($this->name);
@@ -936,13 +941,19 @@ class theme_config {
$url = new moodle_url("/theme/styles.php");
if (!empty($CFG->slasharguments)) {
$url->set_slashargument('/'.$this->name.'/'.$rev.'/editor', 'noparam', true);
$url->set_slashargument("{$this->name}/{$rev}/{$type}", 'noparam', true);
} else {
$url->params(array('theme'=>$this->name,'rev'=>$rev, 'type'=>'editor'));
$url->params([
'theme' => $this->name,
'rev' => $rev,
'type' => $type,
]);
}
} else {
$params = array('theme'=>$this->name, 'type'=>'editor');
$url = new moodle_url('/theme/styles_debug.php', $params);
$url = new moodle_url('/theme/styles_debug.php', [
'theme' => $this->name,
'type' => $type,
]);
}
return $url;
}