MDL-48160 theme: Improve all block region layouts when coded for RTL.

This commit is contained in:
Mary Evans 2015-02-03 18:19:14 +00:00
parent 4c27f52d91
commit 73b425be07
12 changed files with 148 additions and 69 deletions

View File

@ -163,8 +163,3 @@ if (core_useragent::is_ie() && !core_useragent::check_ie_version('9.0')) {
}
$THEME->hidefromselector = true;
$THEME->blockrtlmanipulations = array(
'side-pre' => 'side-post',
'side-post' => 'side-pre'
);

View File

@ -22,7 +22,15 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$left = (!right_to_left()); // To know if to add 'pull-right' and 'desktop-first-column' classes in the layout for LTR.
// Set default (LTR) layout mark-up for a two column page (side-pre-only).
$regionmain = 'span9 pull-right';
$sidepre = 'span3 desktop-first-column';
// Reset layout mark-up for RTL languages.
if (right_to_left()) {
$regionmain = 'span9';
$sidepre = 'span3 pull-right';
}
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
@ -72,20 +80,14 @@ echo $OUTPUT->doctype() ?>
</header>
<div id="page-content" class="row-fluid">
<section id="region-main" class="span9<?php if ($left) { echo ' pull-right'; } ?>">
<section id="region-main" class="<?php echo $regionmain; ?>">
<?php
echo $OUTPUT->course_content_header();
echo $OUTPUT->main_content();
echo $OUTPUT->course_content_footer();
?>
</section>
<?php
$classextra = '';
if ($left) {
$classextra = ' desktop-first-column';
}
echo $OUTPUT->blocks('side-pre', 'span3'.$classextra);
?>
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
</div>
<footer id="page-footer">

View File

@ -22,12 +22,20 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Set default (LTR) layout mark-up for a three column page.
$regionmainbox = 'span9';
$regionmain = 'span8 pull-right';
$sidepre = 'span4 desktop-first-column';
$sidepost = 'span3 pull-right';
// Reset layout mark-up for RTL languages.
if (right_to_left()) {
$regionbsid = 'region-bs-main-and-post';
} else {
$regionbsid = 'region-bs-main-and-pre';
$regionmainbox = 'span9 pull-right';
$regionmain = 'span8';
$sidepre = 'span4 pull-right';
$sidepost = 'span3 desktop-first-column';
}
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
@ -77,19 +85,19 @@ echo $OUTPUT->doctype() ?>
</header>
<div id="page-content" class="row-fluid">
<div id="<?php echo $regionbsid ?>" class="span9">
<div id="region-main-box" class="<?php echo $regionmainbox; ?>">
<div class="row-fluid">
<section id="region-main" class="span8 pull-right">
<section id="region-main" class="<?php echo $regionmain; ?>">
<?php
echo $OUTPUT->course_content_header();
echo $OUTPUT->main_content();
echo $OUTPUT->course_content_footer();
?>
</section>
<?php echo $OUTPUT->blocks('side-pre', 'span4 desktop-first-column'); ?>
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
</div>
</div>
<?php echo $OUTPUT->blocks('side-post', 'span3'); ?>
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
</div>
<footer id="page-footer">

View File

@ -22,6 +22,19 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Set default (LTR) layout mark-up for a three column page.
$regionmainbox = 'span9';
$regionmain = 'span8 pull-right';
$sidepre = 'span4 desktop-first-column';
$sidepost = 'span3 pull-right';
// Reset layout mark-up for RTL languages.
if (right_to_left()) {
$regionmainbox = 'span9 pull-right';
$regionmain = 'span8';
$sidepre = 'span4 pull-right';
$sidepost = 'span3 desktop-first-column';
}
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
@ -62,15 +75,15 @@ echo $OUTPUT->doctype() ?>
</header>
<div id="page-content" class="row-fluid">
<div id="region-bs-main-and-pre" class="span9">
<div id="region-main-box" class="<?php echo $regionmainbox; ?>">
<div class="row-fluid">
<section id="region-main" class="span8 pull-right">
<section id="region-main" class="<?php echo $regionmain; ?>">
<?php echo $OUTPUT->main_content(); ?>
</section>
<?php echo $OUTPUT->blocks('side-pre', 'span4 desktop-first-column'); ?>
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
</div>
</div>
<?php echo $OUTPUT->blocks('side-post', 'span3'); ?>
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
</div>
<?php echo $OUTPUT->standard_end_of_body_html() ?>

View File

@ -16,6 +16,7 @@
display:none;
}
/** Start Legacy styles **/
.content-only #region-main.span9, // Two column layout with no block or all blocks docked.
.empty-region-side-post #region-bs-main-and-pre.span9, // LTR with no post area.
.empty-region-side-pre #region-bs-main-and-post.span9, // RTL with no pre area.
@ -28,26 +29,71 @@
.empty-region-side-pre #region-bs-main-and-pre.span9 #region-main, // LTR with no pre area.
.jsenabled.docked-region-side-pre #region-bs-main-and-pre.span9 #region-main { // LTR with all pre blocks docked.
float:none;
width:100%;
}
.empty-region-side-post.used-region-side-pre, // Post region is empty and pre region is in use.
.jsenabled.docked-region-side-post.used-region-side-pre { // All post blocks docked and pre region is in use.
#region-main.span8 {
/** Increase the span size by 1 **/
.fluid-span(9);
}
#block-region-side-pre.span4 {
/** Decrease the span size by 1 **/
.fluid-span(3);
}
float: none;
width: 100%;
}
.empty-region-side-pre #region-bs-main-and-post.span9 #region-main.span8, // RTL with no pre area.
.jsenabled.docked-region-side-pre #region-bs-main-and-post.span9 #region-main.span8 { // RTL with all pre blocks docked.
float: right;
}
/** End Legacy styles **/
/* Default Three Columns - All
------------------------------*/
.content-only {
#region-main-box,
#region-main {
width: 100%;
}
}
.empty-region-side-pre {
&.used-region-side-post {
#region-main {
width: 100%;
}
}
}
.empty-region-side-post {
&.used-region-side-pre {
#region-main-box {
width: 100%;
}
}
}
.jsenabled {
&.docked-region-side-pre {
&.empty-region-side-pre {
&.used-region-side-post {
#region-main {
width: 100%;
}
}
}
}
&.docked-region-side-post {
&.empty-region-side-post {
&.used-region-side-pre {
#region-main-box {
width: 100%;
}
}
}
}
}
.empty-region-side-post.used-region-side-pre, // Post region is empty and pre region is in use.
.jsenabled.docked-region-side-post.used-region-side-pre { // All post blocks docked and pre region is in use.
#region-main.span8 {
/** Increase the span size by 1 **/
.fluid-span(9);
}
#block-region-side-pre.span4 {
/** Decrease the span size by 1 **/
.fluid-span(3);
}
}
/** Page layout CSS ends **/

File diff suppressed because one or more lines are too long

View File

@ -46,8 +46,3 @@ $THEME->editor_sheets = array();
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->csspostprocess = 'theme_clean_process_css';
$THEME->blockrtlmanipulations = array(
'side-pre' => 'side-post',
'side-post' => 'side-pre'
);

View File

@ -25,7 +25,15 @@
// Get the HTML for the settings bits.
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);
$left = (!right_to_left()); // To know if to add 'pull-right' and 'desktop-first-column' classes in the layout for LTR.
// Set default (LTR) layout mark-up for a two column page (side-pre-only).
$regionmain = 'span9 pull-right';
$sidepre = 'span3 desktop-first-column';
// Reset layout mark-up for RTL languages.
if (right_to_left()) {
$regionmain = 'span9';
$sidepre = 'span3 pull-right';
}
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
@ -75,19 +83,14 @@ echo $OUTPUT->doctype() ?>
</header>
<div id="page-content" class="row-fluid">
<section id="region-main" class="span9<?php if ($left) { echo ' pull-right'; } ?>">
<section id="region-main" class="<?php echo $regionmain; ?>">
<?php
echo $OUTPUT->course_content_header();
echo $OUTPUT->main_content();
echo $OUTPUT->course_content_footer();
?>
</section>
<?php
$classextra = '';
if ($left) {
$classextra = ' desktop-first-column';
}
echo $OUTPUT->blocks('side-pre', 'span3'.$classextra);
<?php echo $OUTPUT->blocks('side-pre', $sidepre);
?>
</div>

View File

@ -31,10 +31,17 @@
// Get the HTML for the settings bits.
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);
// Set default (LTR) layout mark-up for a three column page.
$regionmainbox = 'span9';
$regionmain = 'span8 pull-right';
$sidepre = 'span4 desktop-first-column';
$sidepost = 'span3 pull-right';
// Reset layout mark-up for RTL languages.
if (right_to_left()) {
$regionbsid = 'region-bs-main-and-post';
} else {
$regionbsid = 'region-bs-main-and-pre';
$regionmainbox = 'span9 pull-right';
$regionmain = 'span8';
$sidepre = 'span4 pull-right';
$sidepost = 'span3 desktop-first-column';
}
echo $OUTPUT->doctype() ?>
@ -86,19 +93,19 @@ echo $OUTPUT->doctype() ?>
</header>
<div id="page-content" class="row-fluid">
<div id="<?php echo $regionbsid ?>" class="span9">
<div id="region-main-box" class="<?php echo $regionmainbox; ?>">
<div class="row-fluid">
<section id="region-main" class="span8 pull-right">
<section id="region-main" class="<?php echo $regionmain; ?>">
<?php
echo $OUTPUT->course_content_header();
echo $OUTPUT->main_content();
echo $OUTPUT->course_content_footer();
?>
</section>
<?php echo $OUTPUT->blocks('side-pre', 'span4 desktop-first-column'); ?>
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
</div>
</div>
<?php echo $OUTPUT->blocks('side-post', 'span3'); ?>
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
</div>
<footer id="page-footer">

View File

@ -25,6 +25,19 @@
// Get the HTML for the settings bits.
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);
// Set default (LTR) layout mark-up for a three column page.
$regionmainbox = 'span9';
$regionmain = 'span8 pull-right';
$sidepre = 'span4 desktop-first-column';
$sidepost = 'span3 pull-right';
// Reset layout mark-up for RTL languages.
if (right_to_left()) {
$regionmainbox = 'span9 pull-right';
$regionmain = 'span8';
$sidepre = 'span4 pull-right';
$sidepost = 'span3 desktop-first-column';
}
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
@ -65,15 +78,15 @@ echo $OUTPUT->doctype() ?>
</header>
<div id="page-content" class="row-fluid">
<div id="region-bs-main-and-pre" class="span9">
<div id="region-main-box" class="<?php echo $regionmainbox; ?>">
<div class="row-fluid">
<section id="region-main" class="span8 pull-right">
<section id="region-main" class="<?php echo $regionmain; ?>">
<?php echo $OUTPUT->main_content(); ?>
</section>
<?php echo $OUTPUT->blocks('side-pre', 'span4 desktop-first-column'); ?>
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
</div>
</div>
<?php echo $OUTPUT->blocks('side-post', 'span3'); ?>
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
</div>
<?php echo $OUTPUT->standard_end_of_body_html() ?>

View File

@ -38,8 +38,3 @@ $THEME->editor_sheets = array();
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->csspostprocess = 'theme_more_process_css';
$THEME->blockrtlmanipulations = array(
'side-pre' => 'side-post',
'side-post' => 'side-pre'
);

View File

@ -3,6 +3,8 @@ information provided here is intended especially for theme designer.
=== 2.9 ===
* Themes Bootstrapbase, Clean and More have undergone some changes for RTL layouts see - MDL-48160.
* Themes Clean amd More page header background logo, if loaded, no longer links to the home page.
=== 2.8 ===