MDL-73274 theme_boost: add block/activity styling

This commit is contained in:
Bas Brands 2021-12-15 09:46:26 +01:00
parent 508fe3937e
commit a8b6912e44
14 changed files with 63 additions and 86 deletions

View file

@ -92,10 +92,6 @@ $PAGE->set_title($pagetitle);
$PAGE->set_heading($header);
$PAGE->has_secondary_navigation_setter(false);
if ($block = my_page_add_block_center()) {
$PAGE->blocks->add_fake_block($block, 'content');
}
if (!isguestuser()) { // Skip default home page for guests
if (get_home_page() != HOMEPAGE_MY) {
if (optional_param('setdefaulthome', false, PARAM_BOOL)) {
@ -177,6 +173,8 @@ if (core_userfeedback::should_display_reminder()) {
core_userfeedback::print_reminder_block();
}
echo $OUTPUT->addblockbutton('content');
echo $OUTPUT->custom_block_region('content');
echo $OUTPUT->footer();

View file

@ -70,10 +70,6 @@ $PAGE->set_title($header);
$PAGE->set_heading($header);
$PAGE->blocks->add_region('content');
if ($block = my_page_add_block_center()) {
$PAGE->blocks->add_fake_block($block, 'content');
}
// Get the My Moodle page info. Should always return something unless the database is broken.
if (!$currentpage = my_get_page(null, MY_PAGE_PRIVATE)) {
print_error('mymoodlesetup');
@ -88,6 +84,8 @@ $PAGE->set_button($button . $PAGE->button);
echo $OUTPUT->header();
echo $OUTPUT->addblockbutton('content');
echo $OUTPUT->custom_block_region('content');
echo $OUTPUT->footer();

View file

@ -295,38 +295,6 @@ function my_reset_page_for_all_users(
}
}
/**
* Within /my we need to be able to add a block to the center content region directly as well as show
* the standard add a block information.
*
* @return block_contents|null
*/
function my_page_add_block_center(): ?block_contents {
global $PAGE, $OUTPUT;
// Add-a-block in editing mode.
if (isset($PAGE->theme->addblockposition) &&
$PAGE->user_is_editing() &&
$PAGE->user_can_edit_blocks() &&
!defined('BEHAT_SITE_RUNNING')
) {
$url = new moodle_url($PAGE->url, ['bui_addblock' => '', 'bui_blockregion' => 'content', 'sesskey' => sesskey()]);
$block = new block_contents;
$block->content = $OUTPUT->render_from_template('core/add_block_button',
[
'link' => $url->out(false),
'escapedlink' => "?{$url->get_query_string(false)}",
'pageType' => $PAGE->pagetype,
'pageLayout' => $PAGE->pagelayout,
]
);
return $block;
}
return null;
}
class my_syspage_block_manager extends block_manager {
// HACK WARNING!
// TODO: figure out a better way to do this