Skip to content

Commit

Permalink
MDL-32479 theme_base: some RTL fixes for Moodle 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mary Evans committed Jun 15, 2012
1 parent 85c4758 commit 642b1ca
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 27 deletions.
35 changes: 27 additions & 8 deletions theme/base/layout/frontpage.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@


$bodyclasses = array(); $bodyclasses = array();
if ($showsidepre && !$showsidepost) { if ($showsidepre && !$showsidepost) {
$bodyclasses[] = 'side-pre-only'; if (!right_to_left()) {
$bodyclasses[] = 'side-pre-only';
}else{
$bodyclasses[] = 'side-post-only';
}
} else if ($showsidepost && !$showsidepre) { } 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) { } else if (!$showsidepost && !$showsidepre) {
$bodyclasses[] = 'content-only'; $bodyclasses[] = 'content-only';
} }
if ($hascustommenu) { if ($hascustommenu) {
$bodyclasses[] = 'has_custom_menu'; $bodyclasses[] = 'has-custom-menu';
} }


echo $OUTPUT->doctype() ?> echo $OUTPUT->doctype() ?>
Expand Down Expand Up @@ -58,18 +66,29 @@
</div> </div>
</div> </div>


<?php if ($hassidepre) { ?> <?php if ($hassidepre OR (right_to_left() AND $hassidepost)) { ?>
<div id="region-pre" class="block-region"> <div id="region-pre" class="block-region">
<div class="region-content"> <div class="region-content">
<?php echo $OUTPUT->blocks_for_region('side-pre') ?> <?php
if (!right_to_left()) {
echo $OUTPUT->blocks_for_region('side-pre');
} elseif ($hassidepost) {
echo $OUTPUT->blocks_for_region('side-post');
} ?>

</div> </div>
</div> </div>
<?php } ?> <?php } ?>


<?php if ($hassidepost) { ?> <?php if ($hassidepost OR (right_to_left() AND $hassidepre)) { ?>
<div id="region-post" class="block-region"> <div id="region-post" class="block-region">
<div class="region-content"> <div class="region-content">
<?php echo $OUTPUT->blocks_for_region('side-post') ?> <?php
if (!right_to_left()) {
echo $OUTPUT->blocks_for_region('side-post');
} elseif ($hassidepre) {
echo $OUTPUT->blocks_for_region('side-pre');
} ?>
</div> </div>
</div> </div>
<?php } ?> <?php } ?>
Expand All @@ -94,4 +113,4 @@
</div> </div>
<?php echo $OUTPUT->standard_end_of_body_html() ?> <?php echo $OUTPUT->standard_end_of_body_html() ?>
</body> </body>
</html> </html>
36 changes: 28 additions & 8 deletions theme/base/layout/general.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@


$bodyclasses = array(); $bodyclasses = array();
if ($showsidepre && !$showsidepost) { if ($showsidepre && !$showsidepost) {
$bodyclasses[] = 'side-pre-only'; if (!right_to_left()) {
$bodyclasses[] = 'side-pre-only';
}else{
$bodyclasses[] = 'side-post-only';
}
} else if ($showsidepost && !$showsidepre) { } 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) { } else if (!$showsidepost && !$showsidepre) {
$bodyclasses[] = 'content-only'; $bodyclasses[] = 'content-only';
} }
if ($hascustommenu) { if ($hascustommenu) {
$bodyclasses[] = 'has_custom_menu'; $bodyclasses[] = 'has-custom-menu';
} }


echo $OUTPUT->doctype() ?> echo $OUTPUT->doctype() ?>
Expand Down Expand Up @@ -73,21 +81,33 @@
</div> </div>
</div> </div>


<?php if ($hassidepre) { ?> <?php if ($hassidepre OR (right_to_left() AND $hassidepost)) { ?>
<div id="region-pre" class="block-region"> <div id="region-pre" class="block-region">
<div class="region-content"> <div class="region-content">
<?php echo $OUTPUT->blocks_for_region('side-pre') ?> <?php
if (!right_to_left()) {
echo $OUTPUT->blocks_for_region('side-pre');
} elseif ($hassidepost) {
echo $OUTPUT->blocks_for_region('side-post');
} ?>

</div> </div>
</div> </div>
<?php } ?> <?php } ?>


<?php if ($hassidepost) { ?> <?php if ($hassidepost OR (right_to_left() AND $hassidepre)) { ?>
<div id="region-post" class="block-region"> <div id="region-post" class="block-region">
<div class="region-content"> <div class="region-content">
<?php echo $OUTPUT->blocks_for_region('side-post') ?> <?php
if (!right_to_left()) {
echo $OUTPUT->blocks_for_region('side-post');
} elseif ($hassidepre) {
echo $OUTPUT->blocks_for_region('side-pre');
} ?>
</div> </div>
</div> </div>
<?php } ?> <?php } ?>

</div> </div>
</div> </div>
</div> </div>
Expand All @@ -107,4 +127,4 @@
</div> </div>
<?php echo $OUTPUT->standard_end_of_body_html() ?> <?php echo $OUTPUT->standard_end_of_body_html() ?>
</body> </body>
</html> </html>
4 changes: 2 additions & 2 deletions theme/base/layout/report.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$bodyclasses[] = 'content-only'; $bodyclasses[] = 'content-only';
} }
if ($hascustommenu) { if ($hascustommenu) {
$bodyclasses[] = 'has_custom_menu'; $bodyclasses[] = 'has-custom-menu';
} }


echo $OUTPUT->doctype() ?> echo $OUTPUT->doctype() ?>
Expand Down Expand Up @@ -87,4 +87,4 @@
</div> </div>
<?php echo $OUTPUT->standard_end_of_body_html() ?> <?php echo $OUTPUT->standard_end_of_body_html() ?>
</body> </body>
</html> </html>
2 changes: 1 addition & 1 deletion theme/base/style/blocks.css
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
.block {border:1px solid;margin-bottom:1em;} .block {border:1px solid;margin-bottom:1em;}
.block .header h2 {margin:4px;} .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 .block_action input {margin-right:2px;}
.block .header .commands {margin-left:4px;} .block .header .commands {margin-left:4px;}
.block .header .commands .icon img {width:11px;height:11px;margin-right:1px;} .block .header .commands .icon img {width:11px;height:11px;margin-right:1px;}
Expand Down
14 changes: 10 additions & 4 deletions theme/base/style/core.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ a.skip:active {position: static;display: block;}
.mform .fitem .fitemtitle {width:15%;text-align:right;float:left;} .mform .fitem .fitemtitle {width:15%;text-align:right;float:left;}
.mform .fitem .fitemtitle div {display: inline;} .mform .fitem .fitemtitle div {display: inline;}
.mform .fitem .felement {border-width: 0;width:80%;margin-left:16%;} .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 .error,
.mform .required {color:#A00;} .mform .required {color:#A00;}
.mform .required .fgroup span label {color:#000;} .mform .required .fgroup span label {color:#000;}
Expand Down Expand Up @@ -661,7 +661,7 @@ body.tag .managelink {padding: 5px;}
.dir-rtl .mod-indent-huge {margin-right:300px;margin-left:0;} .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 .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) */ /* Audio player size in 'block' mode (can only change width, height is hardcoded in JS) */
.resourcecontent .mediaplugin_mp3 object {height:25px; width: 600px} .resourcecontent .mediaplugin_mp3 object {height:25px; width: 600px}
Expand Down Expand Up @@ -723,8 +723,8 @@ sup {vertical-align: super;}
.dir-rtl .ygtvcancel {background-position: 0 -8822px;} .dir-rtl .ygtvcancel {background-position: 0 -8822px;}
.dir-rtl .ygtvcancel:hover {background-position: 0 -8866px;} .dir-rtl .ygtvcancel:hover {background-position: 0 -8866px;}


.dir-rtl #yui-gen4.yui-layout-unit-left {left:500px !important;} .dir-rtl .file-picker .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-center {left:0px !important;}
.dir-rtl.yui-skin-sam .yui-panel .hd {text-align:left;} .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;} .dir-rtl .yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd {text-align:right;}


Expand Down Expand Up @@ -805,6 +805,11 @@ sup {vertical-align: super;}
#page-admin-setting-enrolsettingsflatfile.dir-rtl .informationbox {direction: ltr;text-align: left;} #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;} #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 * Chooser Dialogue
Expand Down Expand Up @@ -955,3 +960,4 @@ sup {vertical-align: super;}
-moz-box-shadow: 0px 0px 10px 0px #CCCCCC; -moz-box-shadow: 0px 0px 10px 0px #CCCCCC;
} }


#yui-module-debug {display:none;}
11 changes: 8 additions & 3 deletions theme/base/style/course.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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 {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 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;} .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 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;} .section img.movetarget {height:16px;width:80px;}


Expand Down Expand Up @@ -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 .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 {position:relative;}
.course_category_tree .category .course_info {position:absolute;right:0;top:0;} .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 a,
.course_category_tree .category .course_info div {float:left;width:16px;height:16px;} .course_category_tree .category .course_info div {float:left;width:16px;height:16px;}
.jsenabled .course_category_tree .controls {visibility: visible;} .jsenabled .course_category_tree .controls {visibility: visible;}
Expand Down Expand Up @@ -144,7 +148,8 @@
table.category_subcategories {margin-bottom:1em;} table.category_subcategories {margin-bottom:1em;}
table.category_subcategories td {white-space: nowrap;} 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; position: relative;
top: 5px; top: 5px;
left: 19px; left: 19px;
Expand Down
9 changes: 8 additions & 1 deletion theme/base/style/dock.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,4 +32,11 @@ body.has_dock {margin-left:30px;}
.ie6 #dockeditempanel {position:absolute;} .ie6 #dockeditempanel {position:absolute;}


/** Overide for RTL layout **/ /** Overide for RTL layout **/
.dir-rtl #dockeditempanel {left:670%;} .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}
2 changes: 2 additions & 0 deletions theme/base/style/user.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@
.dir-rtl .userlist table#participants td, .dir-rtl .userlist table#participants td,
.dir-rtl .userlist table#participants th {text-align: right;} .dir-rtl .userlist table#participants th {text-align: right;}
.dir-rtl .userlist table#participants {margin: 0 auto;} .dir-rtl .userlist table#participants {margin: 0 auto;}

#page-my-index.dir-rtl .block h3.main { text-align: right;}

0 comments on commit 642b1ca

Please sign in to comment.