mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-48160 theme: Improve all block region layouts when coded for RTL.
This commit is contained in:
parent
4c27f52d91
commit
73b425be07
@ -163,8 +163,3 @@ if (core_useragent::is_ie() && !core_useragent::check_ie_version('9.0')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$THEME->hidefromselector = true;
|
$THEME->hidefromselector = true;
|
||||||
|
|
||||||
$THEME->blockrtlmanipulations = array(
|
|
||||||
'side-pre' => 'side-post',
|
|
||||||
'side-post' => 'side-pre'
|
|
||||||
);
|
|
||||||
|
@ -22,7 +22,15 @@
|
|||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @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() ?>
|
echo $OUTPUT->doctype() ?>
|
||||||
<html <?php echo $OUTPUT->htmlattributes(); ?>>
|
<html <?php echo $OUTPUT->htmlattributes(); ?>>
|
||||||
<head>
|
<head>
|
||||||
@ -72,20 +80,14 @@ echo $OUTPUT->doctype() ?>
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="page-content" class="row-fluid">
|
<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
|
<?php
|
||||||
echo $OUTPUT->course_content_header();
|
echo $OUTPUT->course_content_header();
|
||||||
echo $OUTPUT->main_content();
|
echo $OUTPUT->main_content();
|
||||||
echo $OUTPUT->course_content_footer();
|
echo $OUTPUT->course_content_footer();
|
||||||
?>
|
?>
|
||||||
</section>
|
</section>
|
||||||
<?php
|
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
|
||||||
$classextra = '';
|
|
||||||
if ($left) {
|
|
||||||
$classextra = ' desktop-first-column';
|
|
||||||
}
|
|
||||||
echo $OUTPUT->blocks('side-pre', 'span3'.$classextra);
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer id="page-footer">
|
<footer id="page-footer">
|
||||||
|
@ -22,12 +22,20 @@
|
|||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @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()) {
|
if (right_to_left()) {
|
||||||
$regionbsid = 'region-bs-main-and-post';
|
$regionmainbox = 'span9 pull-right';
|
||||||
} else {
|
$regionmain = 'span8';
|
||||||
$regionbsid = 'region-bs-main-and-pre';
|
$sidepre = 'span4 pull-right';
|
||||||
|
$sidepost = 'span3 desktop-first-column';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo $OUTPUT->doctype() ?>
|
echo $OUTPUT->doctype() ?>
|
||||||
<html <?php echo $OUTPUT->htmlattributes(); ?>>
|
<html <?php echo $OUTPUT->htmlattributes(); ?>>
|
||||||
<head>
|
<head>
|
||||||
@ -77,19 +85,19 @@ echo $OUTPUT->doctype() ?>
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="page-content" class="row-fluid">
|
<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">
|
<div class="row-fluid">
|
||||||
<section id="region-main" class="span8 pull-right">
|
<section id="region-main" class="<?php echo $regionmain; ?>">
|
||||||
<?php
|
<?php
|
||||||
echo $OUTPUT->course_content_header();
|
echo $OUTPUT->course_content_header();
|
||||||
echo $OUTPUT->main_content();
|
echo $OUTPUT->main_content();
|
||||||
echo $OUTPUT->course_content_footer();
|
echo $OUTPUT->course_content_footer();
|
||||||
?>
|
?>
|
||||||
</section>
|
</section>
|
||||||
<?php echo $OUTPUT->blocks('side-pre', 'span4 desktop-first-column'); ?>
|
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php echo $OUTPUT->blocks('side-post', 'span3'); ?>
|
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer id="page-footer">
|
<footer id="page-footer">
|
||||||
|
@ -22,6 +22,19 @@
|
|||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @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() ?>
|
echo $OUTPUT->doctype() ?>
|
||||||
<html <?php echo $OUTPUT->htmlattributes(); ?>>
|
<html <?php echo $OUTPUT->htmlattributes(); ?>>
|
||||||
<head>
|
<head>
|
||||||
@ -62,15 +75,15 @@ echo $OUTPUT->doctype() ?>
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="page-content" class="row-fluid">
|
<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">
|
<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(); ?>
|
<?php echo $OUTPUT->main_content(); ?>
|
||||||
</section>
|
</section>
|
||||||
<?php echo $OUTPUT->blocks('side-pre', 'span4 desktop-first-column'); ?>
|
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php echo $OUTPUT->blocks('side-post', 'span3'); ?>
|
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php echo $OUTPUT->standard_end_of_body_html() ?>
|
<?php echo $OUTPUT->standard_end_of_body_html() ?>
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Start Legacy styles **/
|
||||||
.content-only #region-main.span9, // Two column layout with no block or all blocks docked.
|
.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-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.
|
.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.
|
.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.
|
.jsenabled.docked-region-side-pre #region-bs-main-and-pre.span9 #region-main { // LTR with all pre blocks docked.
|
||||||
float:none;
|
float: none;
|
||||||
width:100%;
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-region-side-pre #region-bs-main-and-post.span9 #region-main.span8, // RTL with no pre area.
|
.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.
|
.jsenabled.docked-region-side-pre #region-bs-main-and-post.span9 #region-main.span8 { // RTL with all pre blocks docked.
|
||||||
float: right;
|
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 **/
|
/** Page layout CSS ends **/
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -46,8 +46,3 @@ $THEME->editor_sheets = array();
|
|||||||
|
|
||||||
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
|
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
|
||||||
$THEME->csspostprocess = 'theme_clean_process_css';
|
$THEME->csspostprocess = 'theme_clean_process_css';
|
||||||
|
|
||||||
$THEME->blockrtlmanipulations = array(
|
|
||||||
'side-pre' => 'side-post',
|
|
||||||
'side-post' => 'side-pre'
|
|
||||||
);
|
|
||||||
|
@ -25,7 +25,15 @@
|
|||||||
// Get the HTML for the settings bits.
|
// Get the HTML for the settings bits.
|
||||||
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);
|
$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() ?>
|
echo $OUTPUT->doctype() ?>
|
||||||
<html <?php echo $OUTPUT->htmlattributes(); ?>>
|
<html <?php echo $OUTPUT->htmlattributes(); ?>>
|
||||||
<head>
|
<head>
|
||||||
@ -75,19 +83,14 @@ echo $OUTPUT->doctype() ?>
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="page-content" class="row-fluid">
|
<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
|
<?php
|
||||||
echo $OUTPUT->course_content_header();
|
echo $OUTPUT->course_content_header();
|
||||||
echo $OUTPUT->main_content();
|
echo $OUTPUT->main_content();
|
||||||
echo $OUTPUT->course_content_footer();
|
echo $OUTPUT->course_content_footer();
|
||||||
?>
|
?>
|
||||||
</section>
|
</section>
|
||||||
<?php
|
<?php echo $OUTPUT->blocks('side-pre', $sidepre);
|
||||||
$classextra = '';
|
|
||||||
if ($left) {
|
|
||||||
$classextra = ' desktop-first-column';
|
|
||||||
}
|
|
||||||
echo $OUTPUT->blocks('side-pre', 'span3'.$classextra);
|
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -31,10 +31,17 @@
|
|||||||
// Get the HTML for the settings bits.
|
// Get the HTML for the settings bits.
|
||||||
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);
|
$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()) {
|
if (right_to_left()) {
|
||||||
$regionbsid = 'region-bs-main-and-post';
|
$regionmainbox = 'span9 pull-right';
|
||||||
} else {
|
$regionmain = 'span8';
|
||||||
$regionbsid = 'region-bs-main-and-pre';
|
$sidepre = 'span4 pull-right';
|
||||||
|
$sidepost = 'span3 desktop-first-column';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $OUTPUT->doctype() ?>
|
echo $OUTPUT->doctype() ?>
|
||||||
@ -86,19 +93,19 @@ echo $OUTPUT->doctype() ?>
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="page-content" class="row-fluid">
|
<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">
|
<div class="row-fluid">
|
||||||
<section id="region-main" class="span8 pull-right">
|
<section id="region-main" class="<?php echo $regionmain; ?>">
|
||||||
<?php
|
<?php
|
||||||
echo $OUTPUT->course_content_header();
|
echo $OUTPUT->course_content_header();
|
||||||
echo $OUTPUT->main_content();
|
echo $OUTPUT->main_content();
|
||||||
echo $OUTPUT->course_content_footer();
|
echo $OUTPUT->course_content_footer();
|
||||||
?>
|
?>
|
||||||
</section>
|
</section>
|
||||||
<?php echo $OUTPUT->blocks('side-pre', 'span4 desktop-first-column'); ?>
|
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php echo $OUTPUT->blocks('side-post', 'span3'); ?>
|
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer id="page-footer">
|
<footer id="page-footer">
|
||||||
|
@ -25,6 +25,19 @@
|
|||||||
// Get the HTML for the settings bits.
|
// Get the HTML for the settings bits.
|
||||||
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);
|
$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() ?>
|
echo $OUTPUT->doctype() ?>
|
||||||
<html <?php echo $OUTPUT->htmlattributes(); ?>>
|
<html <?php echo $OUTPUT->htmlattributes(); ?>>
|
||||||
<head>
|
<head>
|
||||||
@ -65,15 +78,15 @@ echo $OUTPUT->doctype() ?>
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="page-content" class="row-fluid">
|
<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">
|
<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(); ?>
|
<?php echo $OUTPUT->main_content(); ?>
|
||||||
</section>
|
</section>
|
||||||
<?php echo $OUTPUT->blocks('side-pre', 'span4 desktop-first-column'); ?>
|
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php echo $OUTPUT->blocks('side-post', 'span3'); ?>
|
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php echo $OUTPUT->standard_end_of_body_html() ?>
|
<?php echo $OUTPUT->standard_end_of_body_html() ?>
|
||||||
|
@ -38,8 +38,3 @@ $THEME->editor_sheets = array();
|
|||||||
|
|
||||||
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
|
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
|
||||||
$THEME->csspostprocess = 'theme_more_process_css';
|
$THEME->csspostprocess = 'theme_more_process_css';
|
||||||
|
|
||||||
$THEME->blockrtlmanipulations = array(
|
|
||||||
'side-pre' => 'side-post',
|
|
||||||
'side-post' => 'side-pre'
|
|
||||||
);
|
|
||||||
|
@ -3,6 +3,8 @@ information provided here is intended especially for theme designer.
|
|||||||
|
|
||||||
=== 2.9 ===
|
=== 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.
|
* Themes Clean amd More page header background logo, if loaded, no longer links to the home page.
|
||||||
|
|
||||||
=== 2.8 ===
|
=== 2.8 ===
|
||||||
|
Loading…
x
Reference in New Issue
Block a user