Skip to content

Commit

Permalink
Merge branch 'wip-MDL-48160_master' of git://github.com/lazydaisy/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Feb 4, 2015
2 parents 40582c7 + 73b425b commit 0e642ea
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 64 deletions.
5 changes: 0 additions & 5 deletions theme/bootstrapbase/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,3 @@
}

$THEME->hidefromselector = true;

$THEME->blockrtlmanipulations = array(
'side-pre' => 'side-post',
'side-post' => 'side-pre'
);
20 changes: 11 additions & 9 deletions theme/bootstrapbase/layout/columns2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -72,20 +80,14 @@
</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">
Expand Down
22 changes: 15 additions & 7 deletions theme/bootstrapbase/layout/columns3.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -77,19 +85,19 @@
</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">
Expand Down
21 changes: 17 additions & 4 deletions theme/bootstrapbase/layout/secure.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -62,15 +75,15 @@
</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() ?>
Expand Down
64 changes: 55 additions & 9 deletions theme/bootstrapbase/less/moodle/core.less
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -28,27 +29,72 @@

.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%;
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 **/
/** Increase the span size by 1 **/
.fluid-span(9);
}
#block-region-side-pre.span4 {
/** Decrease the span size by 1 **/
/** 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.
.jsenabled.docked-region-side-pre #region-bs-main-and-post.span9 #region-main.span8 { // RTL with all pre blocks docked.
float: right;
}

/** Page layout CSS ends **/

.dir-ltr,
Expand Down
2 changes: 1 addition & 1 deletion theme/bootstrapbase/style/moodle.css

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions theme/clean/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,3 @@

$THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->csspostprocess = 'theme_clean_process_css';

$THEME->blockrtlmanipulations = array(
'side-pre' => 'side-post',
'side-post' => 'side-pre'
);
19 changes: 11 additions & 8 deletions theme/clean/layout/columns2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -75,19 +83,14 @@
</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>

Expand Down
21 changes: 14 additions & 7 deletions theme/clean/layout/columns3.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() ?>
Expand Down Expand Up @@ -86,19 +93,19 @@
</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">
Expand Down
21 changes: 17 additions & 4 deletions theme/clean/layout/secure.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -65,15 +78,15 @@
</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() ?>
Expand Down
5 changes: 0 additions & 5 deletions theme/more/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,3 @@

$THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->csspostprocess = 'theme_more_process_css';

$THEME->blockrtlmanipulations = array(
'side-pre' => 'side-post',
'side-post' => 'side-pre'
);
2 changes: 2 additions & 0 deletions theme/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===
Expand Down

0 comments on commit 0e642ea

Please sign in to comment.