mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 16:13:28 +02:00
MDL-26953 FIX for side-post-only layout
This commit is contained in:
parent
6731a04d93
commit
d4bb762643
2 changed files with 63 additions and 11 deletions
|
@ -3,28 +3,35 @@
|
||||||
$hasheading = ($PAGE->heading);
|
$hasheading = ($PAGE->heading);
|
||||||
$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
|
$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
|
||||||
$hasfooter = (empty($PAGE->layout_options['nofooter']));
|
$hasfooter = (empty($PAGE->layout_options['nofooter']));
|
||||||
|
|
||||||
$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
|
$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
|
||||||
$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
|
$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
|
||||||
|
|
||||||
|
$showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT));
|
||||||
|
$showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT));
|
||||||
|
|
||||||
$custommenu = $OUTPUT->custom_menu();
|
$custommenu = $OUTPUT->custom_menu();
|
||||||
$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
|
$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
|
||||||
|
|
||||||
$bodyclasses = array();
|
$bodyclasses = array();
|
||||||
if ($hassidepre && !$hassidepost) {
|
if ($showsidepre && !$showsidepost) {
|
||||||
$bodyclasses[] = 'side-pre-only';
|
$bodyclasses[] = 'side-pre-only';
|
||||||
} else if ($hassidepost && !$hassidepre) {
|
} else if ($showsidepost && !$showsidepre) {
|
||||||
$bodyclasses[] = 'side-post-only';
|
$bodyclasses[] = 'side-post-only';
|
||||||
} else if (!$hassidepost && !$hassidepre) {
|
} 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() ?>
|
||||||
<html <?php echo $OUTPUT->htmlattributes() ?>>
|
<html <?php echo $OUTPUT->htmlattributes() ?>>
|
||||||
<head>
|
<head>
|
||||||
<title><?php echo $PAGE->title ?></title>
|
<title><?php echo $PAGE->title ?></title>
|
||||||
<link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
|
<link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
|
||||||
|
<meta name="description" content="<?php p(strip_tags(format_text($SITE->summary, FORMAT_HTML))) ?>" />
|
||||||
<?php echo $OUTPUT->standard_head_html() ?>
|
<?php echo $OUTPUT->standard_head_html() ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ body {margin:auto 0px;width:auto;}
|
||||||
|
|
||||||
#page-content #region-main-box {
|
#page-content #region-main-box {
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: -[[setting:regionpostwidth]];;
|
margin-left: -[[setting:regionpostwidth]];
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 200%;
|
width: 200%;
|
||||||
right: 100%;
|
right: 100%;
|
||||||
|
@ -18,7 +18,7 @@ body {margin:auto 0px;width:auto;}
|
||||||
|
|
||||||
#page-content #region-post-box {
|
#page-content #region-post-box {
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: -[[setting:regionprewidth]];;
|
margin-left: -[[setting:regionprewidth]];
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ body {margin:auto 0px;width:auto;}
|
||||||
|
|
||||||
/** Only side pre **/
|
/** Only side pre **/
|
||||||
.side-pre-only #page-content #region-main-box {
|
.side-pre-only #page-content #region-main-box {
|
||||||
margin-left: 0px;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.side-pre-only #page-content #region-post-box {
|
.side-pre-only #page-content #region-post-box {
|
||||||
|
@ -80,16 +80,17 @@ body {margin:auto 0px;width:auto;}
|
||||||
|
|
||||||
.side-pre-only #page-content #region-pre {
|
.side-pre-only #page-content #region-pre {
|
||||||
left: [[setting:regionprewidth]];
|
left: [[setting:regionprewidth]];
|
||||||
width: [[setting:regionprewidth]];
|
width: [[setting:regionprewidth]];
|
||||||
}
|
}
|
||||||
|
|
||||||
.side-pre-only #page-content #region-post {
|
.side-pre-only #page-content #region-post {
|
||||||
width: 0%;
|
left: 0;
|
||||||
|
width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Only side post **/
|
/** Only side post **/
|
||||||
.side-post-only #page-content #region-main-box {
|
.side-post-only #page-content #region-main-box {
|
||||||
margin-left: 0px;
|
margin-left: 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,11 +100,14 @@ body {margin:auto 0px;width:auto;}
|
||||||
|
|
||||||
.side-post-only #page-content #region-main {
|
.side-post-only #page-content #region-main {
|
||||||
margin-left: [[setting:regionpostwidth]];
|
margin-left: [[setting:regionpostwidth]];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.side-post-only #page-content #region-pre {
|
||||||
|
left: 0;
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
.side-post-only #page-content #region-post {
|
.side-post-only #page-content #region-post {
|
||||||
left: [[setting:regionsumwidth]];
|
left: [[setting:regionpostwidth]];
|
||||||
width: [[setting:regionpostwidth]];
|
width: [[setting:regionpostwidth]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +115,47 @@ body {margin:auto 0px;width:auto;}
|
||||||
margin-left: [[setting:regionprewidth]];
|
margin-left: [[setting:regionprewidth]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.blocks-moving.side-post-only #page-content #region-main-box {
|
||||||
|
float: left;
|
||||||
|
margin-left: -[[setting:regionpostwidth]];
|
||||||
|
position: relative;
|
||||||
|
width: 200%;
|
||||||
|
right: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blocks-moving.side-post-only #page-content #region-main-box #region-post-box {
|
||||||
|
float: left;
|
||||||
|
margin-left:
|
||||||
|
-[[setting:regionprewidth]];
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blocks-moving.side-post-only #page-content #region-main-box #region-post-box #region-main-wrap {
|
||||||
|
float: left;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blocks-moving.side-post-only #page-content #region-main-box #region-post-box #region-main-wrap #region-main {
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
margin-left: [[setting:regionsumwidth]];
|
||||||
|
left: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blocks-moving.side-post-only #page-content #region-main-box #region-post-box #region-pre {
|
||||||
|
float: right;
|
||||||
|
position: relative;
|
||||||
|
left: [[setting:leftregionwidthmargin]];
|
||||||
|
width: [[setting:regionprewidth]];
|
||||||
|
}
|
||||||
|
|
||||||
|
.blocks-moving.side-post-only #page-content #region-main-box #region-post-box #region-post {
|
||||||
|
float: right;
|
||||||
|
position: relative;
|
||||||
|
left: [[setting:regiondoublepresumwidth]];
|
||||||
|
width: [[setting:regionpostwidth]];
|
||||||
|
}
|
||||||
|
|
||||||
/** No blocks whatsoever **/
|
/** No blocks whatsoever **/
|
||||||
.content-only #page-content #region-main-box {
|
.content-only #page-content #region-main-box {
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue