Skip to content

Commit

Permalink
MDL-72413 core: Disable the default activity header
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Dias committed Dec 13, 2021
1 parent 4c3f5b8 commit 710c04d
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions admin/roles/assign.php
Expand Up @@ -61,6 +61,7 @@
}
$PAGE->set_url($pageurl);
$PAGE->set_context($context);
$PAGE->activityheader->disable();

$contextname = $context->get_context_name();
$courseid = $course->id;
Expand Down
1 change: 1 addition & 0 deletions admin/roles/check.php
Expand Up @@ -87,6 +87,7 @@
$PAGE->blocks->show_only_fake_blocks(true);
}
$PAGE->set_title($title);
$PAGE->activityheader->disable();

switch ($context->contextlevel) {
case CONTEXT_SYSTEM:
Expand Down
1 change: 1 addition & 0 deletions admin/roles/permissions.php
Expand Up @@ -97,6 +97,7 @@
}

$PAGE->set_title($title);
$PAGE->activityheader->disable();
switch ($context->contextlevel) {
case CONTEXT_SYSTEM:
print_error('cannotoverridebaserole', 'error');
Expand Down
1 change: 1 addition & 0 deletions backup/backup.php
Expand Up @@ -107,6 +107,7 @@

$PAGE->set_title($heading);
$PAGE->set_heading($heading);
$PAGE->activityheader->disable();

if (empty($cancel)) {
// Do not print the header if user cancelled the process, as we are going to redirect the user.
Expand Down
1 change: 1 addition & 0 deletions backup/restorefile.php
Expand Up @@ -114,6 +114,7 @@
$PAGE->set_title(get_string('course') . ': ' . $coursefullname);
$PAGE->set_heading($heading);
$PAGE->set_pagelayout('admin');
$PAGE->activityheader->disable();
$PAGE->requires->js_call_amd('core_backup/async_backup', 'asyncBackupAllStatus', array($context->id));

$form = new course_restore_form(null, array('contextid'=>$contextid));
Expand Down
1 change: 1 addition & 0 deletions course/modedit.php
Expand Up @@ -200,6 +200,7 @@
if (isset($navbaraddition)) {
$PAGE->navbar->add($navbaraddition);
}
$PAGE->activityheader->disable();

echo $OUTPUT->header();

Expand Down
1 change: 1 addition & 0 deletions filter/manage.php
Expand Up @@ -123,6 +123,7 @@
$PAGE->set_cacheable(false);
$PAGE->set_title($title);
$PAGE->set_pagelayout('admin');
$PAGE->activityheader->disable();
echo $OUTPUT->header();

/// Print heading.
Expand Down
2 changes: 2 additions & 0 deletions lib/outputrenderers.php
Expand Up @@ -2907,6 +2907,8 @@ public function fatal_error($message, $moreinfourl, $link, $backtrace, $debuginf
//$this->page->set_pagelayout('base'); //TODO: MDL-20676 blocks on error pages are weird, unfortunately it somehow detect the pagelayout from URL :-(
$this->page->set_title(get_string('error'));
$this->page->set_heading($this->page->course->fullname);
// No need to display the activity header when encountering an error.
$this->page->activityheader->disable();
$output .= $this->header();
}

Expand Down
5 changes: 4 additions & 1 deletion lib/portfoliolib.php
Expand Up @@ -1117,7 +1117,10 @@ function portfolio_export_pagesetup($PAGE, $caller) {

// and now we know the course for sure and maybe the cm, call require_login with it
require_login($PAGE->course, false, $cm);

$PAGE->activityheader->set_attrs([
'description' => '',
'hidecompletion' => true
]);
foreach ($extranav as $navitem) {
$PAGE->navbar->add($navitem['name']);
}
Expand Down

0 comments on commit 710c04d

Please sign in to comment.