MDL-72413 feedback: Use the common module for setting the header

This commit is contained in:
Peter Dias 2021-09-21 12:49:15 +08:00
parent ea76db4cbc
commit 7e5b0f6289
11 changed files with 38 additions and 25 deletions

View File

@ -48,10 +48,11 @@ if (!$feedbackstructure->can_view_analysis()) {
$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
$PAGE->activityheader->set_attrs([
'hidecompletion' => true,
'description' => ''
]);
echo $OUTPUT->header();
if (!$PAGE->has_secondary_navigation()) {
echo $OUTPUT->heading(format_string($feedback->name));
}
//get the groupid
$mygroupid = groups_get_activity_group($cm, true);

View File

@ -85,6 +85,10 @@ $PAGE->set_url($url);
$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
$actionbar = new \mod_feedback\output\edit_action_bar($cm->id, $url, $lastposition);
$PAGE->activityheader->set_attrs([
'hidecompletion' => true,
'description' => ''
]);
//Adding the javascript module for the items dragdrop.
if (count($feedbackitems) > 1) {

View File

@ -99,13 +99,12 @@ if ($item->id) {
}
$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
$PAGE->activityheader->set_attrs([
"hidecompletion" => true,
"description" => ''
]);
echo $OUTPUT->header();
if (!$PAGE->has_secondary_navigation()) {
// Print the main part of the page.
echo $OUTPUT->heading(format_string($feedback->name));
}
/// print the tabs
$current_tab = 'edit';
$id = $cm->id;

View File

@ -95,13 +95,14 @@ $strfeedback = get_string("modulename", "feedback");
$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
$PAGE->activityheader->set_attrs([
"hidecompletion" => true,
"description" => ''
]);
echo $OUTPUT->header();
/** @var \mod_feedback\output\renderer $renderer */
$renderer = $PAGE->get_renderer('mod_feedback');
echo $renderer->main_action_bar($actionbar);
if (!$PAGE->has_secondary_navigation()) {
echo $OUTPUT->heading(format_string($feedback->name));
}
/// Print the main part of the page
///////////////////////////////////////////////////////////////////////////

View File

@ -71,7 +71,10 @@ if ($templateid) {
$successurl = new moodle_url('/mod/feedback/manage_templates.php', ['id' => $id]);
redirect($url, get_string('template_deleted', 'feedback'), null, \core\output\notification::NOTIFY_SUCCESS);
}
$PAGE->activityheader->set_attrs([
"hidecompletion" => true,
"description" => ''
]);
echo $OUTPUT->header();
/** @var \mod_feedback\output\renderer $renderer */
$renderer = $PAGE->get_renderer('mod_feedback');

View File

@ -58,9 +58,7 @@ $strfeedback = get_string("modulename", "feedback");
$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
echo $OUTPUT->header();
if (!$PAGE->has_secondary_navigation()) {
echo $OUTPUT->heading(format_string($feedback->name));
}
echo $OUTPUT->box(get_string('mapcourseinfo', 'feedback'));
$form->display();

View File

@ -48,11 +48,9 @@ $PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title($feedback->name);
$PAGE->set_heading($course->fullname);
$PAGE->activityheader->set_title(format_string($feedback->name));
echo $OUTPUT->header();
// Print the main part of the page.
echo $OUTPUT->heading(format_string($feedback->name));
$continueurl = new moodle_url('/mod/feedback/view.php', array('id' => $id));
if ($courseid) {
$continueurl->param('courseid', $courseid);

View File

@ -86,6 +86,10 @@ if ($data = $courseselectform->get_data()) {
navigation_node::override_active_url($baseurl);
$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
$PAGE->activityheader->set_attrs([
'hidecompletion' => true,
'description' => ''
]);
echo $OUTPUT->header();
/** @var \mod_feedback\output\renderer $renderer */

View File

@ -137,6 +137,10 @@ if ($action == 'sendmessage' AND $canbulkmessaging) {
/// Print the page header
$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
$PAGE->activityheader->set_attrs([
'hidecompletion' => true,
'description' => ''
]);
echo $OUTPUT->header();
/** @var \mod_feedback\output\renderer $renderer */

View File

@ -63,6 +63,10 @@ if ($mode == 'manage') {
$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
$PAGE->activityheader->set_attrs([
"hidecompletion" => true,
"description" => ''
]);
$actionbar = new \mod_feedback\output\edit_template_action_bar($cm->id, $templateid, $mode);
/** @var \mod_feedback\output\renderer $renderer */
$renderer = $PAGE->get_renderer('mod_feedback');

View File

@ -72,9 +72,6 @@ $renderer = $PAGE->get_renderer('mod_feedback');
// Trigger module viewed event.
$feedbackcompletion->trigger_module_viewed();
/// Print the page header
echo $OUTPUT->header();
/// Print the main part of the page
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
@ -87,10 +84,10 @@ if ($courseid) {
}
$preview = html_writer::link($previewlnk, $previewimg);
// Render the activity information.
$completiondetails = \core_completion\cm_completion_details::get_instance($cm, $USER->id);
$activitydates = \core\activity_dates::get_dates_for_module($cm, $USER->id);
echo $OUTPUT->activity_information($cm, $completiondetails, $activitydates);
$PAGE->activityheader->set_description("");
// Print the page header.
echo $OUTPUT->header();
// Show description.
echo $OUTPUT->box_start('generalbox feedback_description');