From d180d19a830c49b2c57460c011a4a737b1ace563 Mon Sep 17 00:00:00 2001 From: Nadav Kavalerchik Date: Tue, 17 Apr 2012 14:00:23 +0300 Subject: [PATCH] MDL-32479 - RTL Theme fixes for Moodle 2 (theme/base) Support for blocks columns switch when in rtl mode: theme/base/layout/frontpage.php theme/base/layout/general.php Right align course completion checkbox to the right side of the activities and resources, when in RTL mode theme/base/style/course.css Right align DOCK bar, when in RTL mode theme/base/style/dock.css First-name and Last-name Initials (filter) bar (on every users list) letters spacing (usability issue, NOT RTL issue) theme/base/style/core.css Conflicts: theme/base/style/core.css theme/base/style/course.css --- theme/base/layout/frontpage.php | 31 +++++++++++++++++++++++++------ theme/base/layout/general.php | 32 ++++++++++++++++++++++++++------ theme/base/style/core.css | 2 ++ theme/base/style/course.css | 5 ++++- theme/base/style/dock.css | 9 ++++++++- 5 files changed, 65 insertions(+), 14 deletions(-) diff --git a/theme/base/layout/frontpage.php b/theme/base/layout/frontpage.php index 8a02304930e..330416942e6 100644 --- a/theme/base/layout/frontpage.php +++ b/theme/base/layout/frontpage.php @@ -10,9 +10,17 @@ $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custom $bodyclasses = array(); if ($showsidepre && !$showsidepost) { - $bodyclasses[] = 'side-pre-only'; + if (!right_to_left()) { + $bodyclasses[] = 'side-pre-only'; + }else{ + $bodyclasses[] = 'side-post-only'; + } } else if ($showsidepost && !$showsidepre) { - $bodyclasses[] = 'side-post-only'; + if (!right_to_left()) { + $bodyclasses[] = 'side-post-only'; + }else{ + $bodyclasses[] = 'side-pre-only'; + } } else if (!$showsidepost && !$showsidepre) { $bodyclasses[] = 'content-only'; } @@ -58,18 +66,29 @@ echo $OUTPUT->doctype() ?> - +
- blocks_for_region('side-pre') ?> + blocks_for_region('side-pre'); + } elseif ($hassidepost) { + echo $OUTPUT->blocks_for_region('side-post'); + } ?> +
- +
- blocks_for_region('side-post') ?> + blocks_for_region('side-post'); + } elseif ($hassidepre) { + echo $OUTPUT->blocks_for_region('side-pre'); + } ?>
diff --git a/theme/base/layout/general.php b/theme/base/layout/general.php index afb9cfca411..9618515e600 100644 --- a/theme/base/layout/general.php +++ b/theme/base/layout/general.php @@ -15,9 +15,17 @@ $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custom $bodyclasses = array(); if ($showsidepre && !$showsidepost) { - $bodyclasses[] = 'side-pre-only'; + if (!right_to_left()) { + $bodyclasses[] = 'side-pre-only'; + }else{ + $bodyclasses[] = 'side-post-only'; + } } else if ($showsidepost && !$showsidepre) { - $bodyclasses[] = 'side-post-only'; + if (!right_to_left()) { + $bodyclasses[] = 'side-post-only'; + }else{ + $bodyclasses[] = 'side-pre-only'; + } } else if (!$showsidepost && !$showsidepre) { $bodyclasses[] = 'content-only'; } @@ -73,21 +81,33 @@ echo $OUTPUT->doctype() ?> - +
- blocks_for_region('side-pre') ?> + blocks_for_region('side-pre'); + } elseif ($hassidepost) { + echo $OUTPUT->blocks_for_region('side-post'); + } ?> +
- +
- blocks_for_region('side-post') ?> + blocks_for_region('side-post'); + } elseif ($hassidepre) { + echo $OUTPUT->blocks_for_region('side-pre'); + } ?>
+ diff --git a/theme/base/style/core.css b/theme/base/style/core.css index 30bef8f19bb..1215fcc5ae9 100644 --- a/theme/base/style/core.css +++ b/theme/base/style/core.css @@ -805,6 +805,7 @@ sup {vertical-align: super;} #page-admin-setting-enrolsettingsflatfile.dir-rtl .informationbox {direction: ltr;text-align: left;} #page-admin-grade-edit-scale-edit.dir-rtl .error input#id_name {margin-right: 170px;} +<<<<<<< HEAD /** * Chooser Dialogue @@ -961,3 +962,4 @@ sup {vertical-align: super;} -moz-box-shadow: 0px 0px 10px 0px #CCCCCC; } +.initialbar a {padding-right: 2px;} diff --git a/theme/base/style/course.css b/theme/base/style/course.css index 5a5fc1a9b1a..278b1d349fa 100644 --- a/theme/base/style/course.css +++ b/theme/base/style/course.css @@ -41,7 +41,8 @@ .path-course-view li.activity form.togglecompletion .ajaxworking {position:absolute;top:0; left:20px;width: 20px; height: 20px;background: url([[pix:i/ajaxloader]]) no-repeat;} .dir-rtl.path-course-view li.activity {margin-right:0px;margin-left:20px;} .dir-rtl.path-course-view li.activity form.togglecompletion, -.dir-rtl.path-course-view li.activity span.autocompletion {right:auto;left:-20px;} +.dir-rtl.path-course-view li.activity span.autocompletion {right:-20px;left:auto;padding:0px;} +.dir-rtl.path-course-view .completionprogress {float: none;} .section img.movetarget {height:16px;width:80px;} @@ -164,3 +165,5 @@ input.titleeditor { .dndupload-progress-outer {width:70px;border:solid black 1px;height:10px;display:inline-block;margin:0;padding:0;overflow:hidden;position:relative;} .dndupload-progress-inner {width:0%;height:100%;background-color:green;display:inline-block;margin:0;padding:0;float:left;} .dndupload-hidden {display:none;} + +.dir-rtl.path-course-view li.activity form.togglecompletion, .dir-rtl.path-course-view li.activity span.autocompletion diff --git a/theme/base/style/dock.css b/theme/base/style/dock.css index 30acfef1b28..97f866016e5 100644 --- a/theme/base/style/dock.css +++ b/theme/base/style/dock.css @@ -32,4 +32,11 @@ body.has_dock {margin-left:30px;} .ie6 #dockeditempanel {position:absolute;} /** Overide for RTL layout **/ -.dir-rtl #dockeditempanel {left:670%;} \ No newline at end of file +.dir-rtl #dockeditempanel {left:670%;} + +/* right align the DOCK panel +------------------------------*/ +.dir-rtl #dockeditempanel {right: 100%;} +.dir-rtl #dock {left:auto;right: 0%; border-left: 1px solid #DDD;} +.dir-rtl #dock .dockedtitle { border-bottom: 1px solid #DDD;border-top: 1px solid #EEE; cursor: pointer;} +body.dir-rtl.has_dock {margin-left: 0px; margin-right: 30px} \ No newline at end of file