diff --git a/mod/workshop/allocation.php b/mod/workshop/allocation.php index b6e727bc6a8..eb5166d2646 100644 --- a/mod/workshop/allocation.php +++ b/mod/workshop/allocation.php @@ -48,6 +48,10 @@ require_capability('mod/workshop:allocate', $context); $PAGE->set_title($workshop->name); $PAGE->set_heading($course->fullname); $PAGE->navbar->add(get_string('allocation', 'workshop'), $workshop->allocation_url($method)); +$PAGE->activityheader->set_attrs([ + 'hidecompletion' => true, + 'description' => '' +]); $allocator = $workshop->allocator_instance($method); $initresult = $allocator->init(); @@ -59,10 +63,6 @@ $actionbar = new \mod_workshop\output\actionbar($url, $workshop); $output = $PAGE->get_renderer('mod_workshop'); echo $output->header(); -if (!$PAGE->has_secondary_navigation()) { - echo $OUTPUT->heading(format_string($workshop->name)); -} - echo $actionbar->get_allocation_menu(); if (is_null($initresult->get_status()) or $initresult->get_status() == workshop_allocation_result::STATUS_VOID) { diff --git a/mod/workshop/assessment.php b/mod/workshop/assessment.php index dbe56ed4d7b..7ba78456600 100644 --- a/mod/workshop/assessment.php +++ b/mod/workshop/assessment.php @@ -53,6 +53,11 @@ $workshop = new workshop($workshop, $cm, $course); $PAGE->set_url($workshop->assess_url($assessment->id)); $PAGE->set_title($workshop->name); $PAGE->set_heading($course->fullname); +$PAGE->activityheader->set_attrs([ + "hidecompletion" => true, + "description" => "" +]); + $PAGE->navbar->add(get_string('assessingsubmission', 'workshop')); $PAGE->set_secondary_active_tab('modulepage'); @@ -75,9 +80,6 @@ if ($assessmenteditable) { list($assessed, $notice) = $workshop->check_examples_assessed_before_assessment($assessment->reviewerid); if (!$assessed) { echo $output->header(); - if (!$PAGE->has_secondary_navigation()) { - echo $output->heading(format_string($workshop->name)); - } notice(get_string($notice, 'workshop'), new moodle_url('/mod/workshop/view.php', array('id' => $cm->id))); echo $output->footer(); exit; @@ -158,9 +160,6 @@ if ($canoverridegrades or $cansetassessmentweight) { // output starts here $output = $PAGE->get_renderer('mod_workshop'); // workshop renderer echo $output->header(); -if (!$PAGE->has_secondary_navigation()) { - echo $output->heading(format_string($workshop->name)); -} echo $output->heading(get_string('assessedsubmission', 'workshop'), 3); $submission = $workshop->get_submission_by_id($submission->id); // reload so can be passed to the renderer diff --git a/mod/workshop/editform.php b/mod/workshop/editform.php index b799b9adb68..8da5fcb09ea 100644 --- a/mod/workshop/editform.php +++ b/mod/workshop/editform.php @@ -43,6 +43,10 @@ $workshop = new workshop($workshop, $cm, $course); $PAGE->set_url($workshop->editform_url()); $PAGE->set_title($workshop->name); $PAGE->set_heading($course->fullname); +$PAGE->activityheader->set_attrs([ + 'hidecompletion' => true, + 'description' => '' +]); $PAGE->navbar->add(get_string('editingassessmentform', 'workshop')); // load the grading strategy logic @@ -73,9 +77,6 @@ if ($mform->is_cancelled()) { // Output starts here echo $OUTPUT->header(); -if (!$PAGE->has_secondary_navigation()) { - echo $OUTPUT->heading(format_string($workshop->name)); -} echo $OUTPUT->heading(get_string('pluginname', 'workshopform_' . $workshop->strategy), 3); $mform->display(); diff --git a/mod/workshop/editformpreview.php b/mod/workshop/editformpreview.php index 77c50ed3a0b..bb5c42e671b 100644 --- a/mod/workshop/editformpreview.php +++ b/mod/workshop/editformpreview.php @@ -44,6 +44,10 @@ $PAGE->set_heading($course->fullname); $PAGE->navbar->add(get_string('editingassessmentform', 'workshop'), $workshop->editform_url(), navigation_node::TYPE_CUSTOM); $PAGE->navbar->add(get_string('previewassessmentform', 'workshop')); $PAGE->set_secondary_active_tab('workshopassessement'); +$PAGE->activityheader->set_attrs([ + "hidecompletion" => true, + "description" => '' +]); $currenttab = 'editform'; // load the grading strategy logic @@ -54,9 +58,6 @@ $mform = $strategy->get_assessment_form($workshop->editform_url(), 'preview'); // output starts here echo $OUTPUT->header(); -if (!$PAGE->has_secondary_navigation()) { - echo $OUTPUT->heading(format_string($workshop->name)); -} echo $OUTPUT->heading(get_string('assessmentform', 'workshop'), 3); $mform->display(); echo $OUTPUT->footer(); diff --git a/mod/workshop/submission.php b/mod/workshop/submission.php index a179a01cc31..0b92ee326f5 100644 --- a/mod/workshop/submission.php +++ b/mod/workshop/submission.php @@ -175,6 +175,10 @@ if (!$edit and ($canoverride or $canpublish)) { $PAGE->set_title($workshop->name); $PAGE->set_heading($course->fullname); +$PAGE->activityheader->set_attrs([ + 'hidecompletion' => true, + 'description' => '' +]); if ($edit) { $PAGE->navbar->add(get_string('mysubmission', 'workshop'), $workshop->submission_url(), navigation_node::TYPE_CUSTOM); $PAGE->navbar->add(get_string('editingsubmission', 'workshop')); @@ -187,9 +191,6 @@ if ($edit) { // Output starts here $output = $PAGE->get_renderer('mod_workshop'); echo $output->header(); -if (!$PAGE->has_secondary_navigation()) { - echo $output->heading(format_string($workshop->name), 2); -} echo $output->heading(get_string('mysubmission', 'workshop'), 3); // show instructions for submitting as thay may contain some list of questions and we need to know them diff --git a/mod/workshop/switchphase.php b/mod/workshop/switchphase.php index d30d46cf572..60bcef9f781 100644 --- a/mod/workshop/switchphase.php +++ b/mod/workshop/switchphase.php @@ -52,6 +52,10 @@ if ($confirm) { $PAGE->set_title($workshop->name); $PAGE->set_heading($course->fullname); +$PAGE->activityheader->set_attrs([ + 'hidecompletion' => true, + 'description' => '' +]); $PAGE->navbar->add(get_string('switchingphase', 'workshop')); $PAGE->set_secondary_active_tab("modulepage"); @@ -60,10 +64,6 @@ $PAGE->set_secondary_active_tab("modulepage"); // Output starts here // echo $OUTPUT->header(); -if (!$PAGE->has_secondary_navigation()) { - echo $OUTPUT->heading(format_string($workshop->name)); -} - $continuebtn = new single_button( new moodle_url($PAGE->url, array('confirm' => 1)), get_string('continue'), 'post', true); $continuebtn->class .= ' mr-3'; diff --git a/mod/workshop/view.php b/mod/workshop/view.php index 638581b0e85..149ce97ed6e 100644 --- a/mod/workshop/view.php +++ b/mod/workshop/view.php @@ -97,20 +97,18 @@ if ($eval) { redirect($PAGE->url); } +$heading = $OUTPUT->heading_with_help(format_string($workshop->name), 'userplan', 'workshop'); +$heading = preg_replace('/]*>([.\s\S]*)<\/h2>/', '$1', $heading); +$PAGE->activityheader->set_attrs([ + 'title' => $PAGE->activityheader->is_title_allowed() ? $heading : "", + 'description' => '' +]); + $output = $PAGE->get_renderer('mod_workshop'); /// Output starts here echo $output->header(); -if (!$PAGE->has_secondary_navigation()) { - echo $output->heading_with_help(format_string($workshop->name), 'userplan', 'workshop'); -} - -// Display any activity information (eg completion requirements / dates). -$cminfo = cm_info::create($cm); -$completiondetails = \core_completion\cm_completion_details::get_instance($cminfo, $USER->id); -$activitydates = \core\activity_dates::get_dates_for_module($cminfo, $USER->id); -echo $output->activity_information($cminfo, $completiondetails, $activitydates); // Output action buttons here. switch ($workshop->phase) {