MDL-39573 theme: bootstrap - always show pre and post regions when editing

This commit is contained in:
Damyon Wiese 2013-05-09 16:55:59 +08:00
parent 84bf8a3971
commit 6693089b90
2 changed files with 22 additions and 0 deletions

View file

@ -25,6 +25,17 @@ $hassidepost = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->regio
$showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT)); $showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT));
$showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT)); $showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT));
// If there can be a sidepost region on this page and we are editing, always
// show it so blocks can be dragged into it.
if ($PAGE->user_is_editing()) {
if ($PAGE->blocks->is_known_region('side-pre')) {
$showsidepre = true;
}
if ($PAGE->blocks->is_known_region('side-post')) {
$showsidepost = true;
}
}
$custommenu = $OUTPUT->custom_menu(); $custommenu = $OUTPUT->custom_menu();
$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu)); $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));

View file

@ -39,6 +39,17 @@ $hassidepost = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->regio
$showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT)); $showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT));
$showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT)); $showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT));
// If there can be a sidepost region on this page and we are editing, always
// show it so blocks can be dragged into it.
if ($PAGE->user_is_editing()) {
if ($PAGE->blocks->is_known_region('side-pre')) {
$showsidepre = true;
}
if ($PAGE->blocks->is_known_region('side-post')) {
$showsidepost = true;
}
}
$haslogo = (!empty($PAGE->theme->settings->logo)); $haslogo = (!empty($PAGE->theme->settings->logo));
$hasfootnote = (!empty($PAGE->theme->settings->footnote)); $hasfootnote = (!empty($PAGE->theme->settings->footnote));