Permalink
Browse files

MDL-40065 theme_bootstrapbase theme_clean: Simplify column lyts / fix…

… blocks.
  • Loading branch information...
1 parent e978b66 commit fb42a8c761c859e3903c9101a95ccd286f431fb3 @gjb2048 gjb2048 committed Jun 24, 2013
View
@@ -1852,7 +1852,14 @@ public function set_popup_notification_allowed($allowed) {
*/
public function apply_theme_region_manipulations($region) {
if ($this->blockmanipulations && isset($this->blockmanipulations[$region])) {
- return $this->blockmanipulations[$region];
+ $regionwas = $region;
+ $regionnow = $this->blockmanipulations[$region];
+ if ($this->blocks->is_known_region($regionwas) && $this->blocks->is_known_region($regionnow)) {
+ // Both the before and after regions are known so we can swap them over.
+ return $regionnow;
+ }
+ // We didn't know about both, we won't swap them over.
+ return $regionwas;
}
return $region;
}
@@ -60,16 +60,14 @@
</div>
</header>
- <div id="page-content">
- <div id="region-bs-main-and-pre">
- <section id="region-main">
- <?php
- echo $OUTPUT->course_content_header();
- echo $OUTPUT->main_content();
- echo $OUTPUT->course_content_footer();
- ?>
- </section>
- </div>
+ <div id="page-content" class="row-fluid">
+ <section id="region-main" class="span12">
+ <?php
+ echo $OUTPUT->course_content_header();
+ echo $OUTPUT->main_content();
+ echo $OUTPUT->course_content_footer();
+ ?>
+ </section>
</div>
<footer id="page-footer">
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+$left = (!right_to_left()); // To know if to add 'pull-right' and 'desktop-first-column' classes in the layout for LTR.
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
@@ -61,25 +62,19 @@
</header>
<div id="page-content" class="row-fluid">
- <div id="region-bs-main-and-pre" class="span9">
- <div class="row-fluid">
- <section id="region-main" class="span9 pull-right">
- <?php
- echo $OUTPUT->course_content_header();
- echo $OUTPUT->main_content();
- echo $OUTPUT->course_content_footer();
- ?>
- </section>
- <?php
- if (!right_to_left()) {
- echo $OUTPUT->blocks('side-pre', 'span3 desktop-first-column');
- } ?>
- </div>
- </div>
+ <section id="region-main" class="span9<?php if ($left) { echo ' pull-right'; } ?>">
+ <?php
+ echo $OUTPUT->course_content_header();
+ echo $OUTPUT->main_content();
+ echo $OUTPUT->course_content_footer();
+ ?>
+ </section>
<?php
- if (right_to_left()) {
- echo $OUTPUT->blocks('side-post', 'span3');
+ $classextra = '';
+ if ($left) {
+ $classextra = ' desktop-first-column';
}
+ echo $OUTPUT->blocks('side-pre', 'span3'.$classextra);
?>
</div>
@@ -14,8 +14,6 @@
display:none;
}
-.dir-ltr.two-column #region-bs-main-and-pre.span9,
-.dir-rtl.two-column #region-main.span9,
.empty-region-side-post #region-bs-main-and-pre.span9 {
width:100%;
}
Oops, something went wrong.
@@ -63,16 +63,14 @@
</div>
</header>
- <div id="page-content">
- <div id="region-bs-main-and-pre">
- <section id="region-main">
- <?php
- echo $OUTPUT->course_content_header();
- echo $OUTPUT->main_content();
- echo $OUTPUT->course_content_footer();
- ?>
- </section>
- </div>
+ <div id="page-content" class="row-fluid">
+ <section id="region-main" class="span12">
+ <?php
+ echo $OUTPUT->course_content_header();
+ echo $OUTPUT->main_content();
+ echo $OUTPUT->course_content_footer();
+ ?>
+ </section>
</div>
<footer id="page-footer">
@@ -17,6 +17,7 @@
// 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.
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
@@ -64,25 +65,19 @@
</header>
<div id="page-content" class="row-fluid">
- <div id="region-bs-main-and-pre" class="span9">
- <div class="row-fluid">
- <section id="region-main" class="span9 pull-right">
- <?php
- echo $OUTPUT->course_content_header();
- echo $OUTPUT->main_content();
- echo $OUTPUT->course_content_footer();
- ?>
- </section>
- <?php
- if (!right_to_left()) {
- echo $OUTPUT->blocks('side-pre', 'span3 desktop-first-column');
- } ?>
- </div>
- </div>
+ <section id="region-main" class="span9<?php if ($left) { echo ' pull-right'; } ?>">
+ <?php
+ echo $OUTPUT->course_content_header();
+ echo $OUTPUT->main_content();
+ echo $OUTPUT->course_content_footer();
+ ?>
+ </section>
<?php
- if (right_to_left()) {
- echo $OUTPUT->blocks('side-post', 'span3');
+ $classextra = '';
+ if ($left) {
+ $classextra = ' desktop-first-column';
}
+ echo $OUTPUT->blocks('side-pre', 'span3'.$classextra);
?>
</div>

0 comments on commit fb42a8c

Please sign in to comment.