From 642b1ca32509de0226a617ff6af2f913ff8f89ba Mon Sep 17 00:00:00 2001 From: Mary Evans Date: Sat, 2 Jun 2012 02:42:55 +0100 Subject: [PATCH] MDL-32479 theme_base: some RTL fixes for Moodle 2.3 --- theme/base/layout/frontpage.php | 35 ++++++++++++++++++++++++-------- theme/base/layout/general.php | 36 +++++++++++++++++++++++++-------- theme/base/layout/report.php | 4 ++-- theme/base/style/blocks.css | 2 +- theme/base/style/core.css | 14 +++++++++---- theme/base/style/course.css | 11 +++++++--- theme/base/style/dock.css | 9 ++++++++- theme/base/style/user.css | 2 ++ 8 files changed, 86 insertions(+), 27 deletions(-) diff --git a/theme/base/layout/frontpage.php b/theme/base/layout/frontpage.php index 8a02304930e..bae039850f0 100644 --- a/theme/base/layout/frontpage.php +++ b/theme/base/layout/frontpage.php @@ -10,14 +10,22 @@ $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'; } if ($hascustommenu) { - $bodyclasses[] = 'has_custom_menu'; + $bodyclasses[] = 'has-custom-menu'; } echo $OUTPUT->doctype() ?> @@ -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'); + } ?>
@@ -94,4 +113,4 @@ echo $OUTPUT->doctype() ?> standard_end_of_body_html() ?> - \ No newline at end of file + diff --git a/theme/base/layout/general.php b/theme/base/layout/general.php index afb9cfca411..65751412091 100644 --- a/theme/base/layout/general.php +++ b/theme/base/layout/general.php @@ -15,14 +15,22 @@ $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'; } if ($hascustommenu) { - $bodyclasses[] = 'has_custom_menu'; + $bodyclasses[] = 'has-custom-menu'; } echo $OUTPUT->doctype() ?> @@ -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'); + } ?>
+ @@ -107,4 +127,4 @@ echo $OUTPUT->doctype() ?> standard_end_of_body_html() ?> - \ No newline at end of file + diff --git a/theme/base/layout/report.php b/theme/base/layout/report.php index 46929179880..905c1b0d20f 100644 --- a/theme/base/layout/report.php +++ b/theme/base/layout/report.php @@ -16,7 +16,7 @@ if (!$showsidepre) { $bodyclasses[] = 'content-only'; } if ($hascustommenu) { - $bodyclasses[] = 'has_custom_menu'; + $bodyclasses[] = 'has-custom-menu'; } echo $OUTPUT->doctype() ?> @@ -87,4 +87,4 @@ echo $OUTPUT->doctype() ?> standard_end_of_body_html() ?> - \ No newline at end of file + diff --git a/theme/base/style/blocks.css b/theme/base/style/blocks.css index 512f2c06cf8..9fca8f98c9c 100644 --- a/theme/base/style/blocks.css +++ b/theme/base/style/blocks.css @@ -1,6 +1,6 @@ .block {border:1px solid;margin-bottom:1em;} .block .header h2 {margin:4px;} -.block .header .block_action {float:right;margin:0 4px;vertical-align:top;} +.block .header .block_action {float:right;margin:2px 4px 0;vertical-align:top;} .block .header .block_action input {margin-right:2px;} .block .header .commands {margin-left:4px;} .block .header .commands .icon img {width:11px;height:11px;margin-right:1px;} diff --git a/theme/base/style/core.css b/theme/base/style/core.css index 67922dd8ac8..813f353634f 100644 --- a/theme/base/style/core.css +++ b/theme/base/style/core.css @@ -210,7 +210,7 @@ a.skip:active {position: static;display: block;} .mform .fitem .fitemtitle {width:15%;text-align:right;float:left;} .mform .fitem .fitemtitle div {display: inline;} .mform .fitem .felement {border-width: 0;width:80%;margin-left:16%;} -.mform .fitem fieldset.felement {margin-left:15%;padding-left:1%;margin-bottom:0} +.mform .fitem fieldset.felement {margin-left:0;padding-left:1%;margin-bottom:0} .mform .error, .mform .required {color:#A00;} .mform .required .fgroup span label {color:#000;} @@ -661,7 +661,7 @@ body.tag .managelink {padding: 5px;} .dir-rtl .mod-indent-huge {margin-right:300px;margin-left:0;} .dir-rtl .felement.feditor select {margin-right:18.75%;margin-left:auto;} -.dir-rtl .mform .fitem .felement {margin-right: 16%;margin-left:auto;} +.dir-rtl .mform .fitem .felement {margin-right: 16%;margin-left:auto;text-align: right;} /* Audio player size in 'block' mode (can only change width, height is hardcoded in JS) */ .resourcecontent .mediaplugin_mp3 object {height:25px; width: 600px} @@ -723,8 +723,8 @@ sup {vertical-align: super;} .dir-rtl .ygtvcancel {background-position: 0 -8822px;} .dir-rtl .ygtvcancel:hover {background-position: 0 -8866px;} -.dir-rtl #yui-gen4.yui-layout-unit-left {left:500px !important;} -.dir-rtl #yui-gen6.yui-layout-unit-center {left:0px !important;} +.dir-rtl .file-picker .yui-layout-unit-left {left:500px !important;} +.dir-rtl .file-picker .yui-layout-unit-center {left:0px !important;} .dir-rtl.yui-skin-sam .yui-panel .hd {text-align:left;} .dir-rtl .yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd {text-align:right;} @@ -805,6 +805,11 @@ 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;} +.initialbar a {padding-right: 2px;} + +/* Invert alignment of all hard coded table cell internal alignment, when in RTL mode */ +.dir-rtl td[align="left"] {text-align: right;} +.dir-rtl td[align="right"] {text-align: left;} /** * Chooser Dialogue @@ -955,3 +960,4 @@ sup {vertical-align: super;} -moz-box-shadow: 0px 0px 10px 0px #CCCCCC; } +#yui-module-debug {display:none;} diff --git a/theme/base/style/course.css b/theme/base/style/course.css index aeabb0bc635..77ba42f8888 100644 --- a/theme/base/style/course.css +++ b/theme/base/style/course.css @@ -42,9 +42,10 @@ .path-course-view li.activity form.togglecompletion {display:inline;position:absolute;right:-20px;top:0;padding:0.2em 0;} .path-course-view li.activity form.togglecompletion div {display:inline;} .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 {margin-right:20px;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;} @@ -106,6 +107,9 @@ .course_category_tree .category .courses .course_link {display:block;background-image:url([[pix:moodle|i/course]]);background-repeat: no-repeat;padding-left:18px;} .course_category_tree .category .course {position:relative;} .course_category_tree .category .course_info {position:absolute;right:0;top:0;} +.dir-rtl .course_category_tree .category .course_info { position: static; } +.dir-rtl .course_category_tree .category .course_info a, .dir-rtl .course_category_tree .category .course_info div {float: right;} +.dir-rtl .course_category_tree .controls div {padding: 7px;} .course_category_tree .category .course_info a, .course_category_tree .category .course_info div {float:left;width:16px;height:16px;} .jsenabled .course_category_tree .controls {visibility: visible;} @@ -144,7 +148,8 @@ table.category_subcategories {margin-bottom:1em;} table.category_subcategories td {white-space: nowrap;} -span.editinstructions { +.dir-rtl.path-course-view li.activity form.togglecompletion, +.dir-rtl.path-course-view li.activity span.autocompletion span.editinstructions { position: relative; top: 5px; left: 19px; 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 diff --git a/theme/base/style/user.css b/theme/base/style/user.css index 8276b71ffe6..b23d73417b3 100644 --- a/theme/base/style/user.css +++ b/theme/base/style/user.css @@ -54,3 +54,5 @@ .dir-rtl .userlist table#participants td, .dir-rtl .userlist table#participants th {text-align: right;} .dir-rtl .userlist table#participants {margin: 0 auto;} + +#page-my-index.dir-rtl .block h3.main { text-align: right;}