MDL-72413 forum: Use the common module for setting the header
This commit is contained in:
+4
-4
@@ -43,7 +43,10 @@ $PAGE->set_title($course->shortname.': '.$folder->name);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->set_activity_record($folder);
|
||||
$PAGE->set_secondary_active_tab('modulepage');
|
||||
|
||||
$PAGE->activityheader->set_attrs([
|
||||
'hidecompletion' => true,
|
||||
'description' => ''
|
||||
]);
|
||||
$data = new stdClass();
|
||||
$data->id = $cm->id;
|
||||
$maxbytes = get_user_max_upload_file_size($context, $CFG->maxbytes);
|
||||
@@ -79,9 +82,6 @@ if ($mform->is_cancelled()) {
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
if (!$PAGE->has_secondary_navigation()) {
|
||||
echo $OUTPUT->heading(format_string($folder->name));
|
||||
}
|
||||
echo $OUTPUT->box_start('generalbox foldertree');
|
||||
$mform->display();
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
@@ -310,6 +310,7 @@ if ($node && $post->get_id() != $discussion->get_first_post_id()) {
|
||||
$isnestedv2displaymode = $displaymode == FORUM_MODE_NESTED_V2;
|
||||
$PAGE->set_title("$course->shortname: " . format_string($discussion->get_name()));
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->activityheader->disable();
|
||||
if ($isnestedv2displaymode) {
|
||||
$PAGE->add_body_class('nested-v2-display-mode reset-style');
|
||||
$settingstrigger = $OUTPUT->render_from_template('mod_forum/settings_drawer_trigger', null);
|
||||
|
||||
@@ -182,6 +182,7 @@ $PAGE->set_url($url);
|
||||
$PAGE->set_title($pagetitle);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->set_heading($pagetitle);
|
||||
$PAGE->activityheader->disable();
|
||||
|
||||
echo $OUTPUT->header();
|
||||
if (!$PAGE->has_secondary_navigation()) {
|
||||
|
||||
+5
-8
@@ -1094,11 +1094,12 @@ if ($edit) {
|
||||
$PAGE->set_title("{$course->shortname}: {$strdiscussionname}{$titlesubject}");
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->set_secondary_active_tab("modulepage");
|
||||
|
||||
echo $OUTPUT->header();
|
||||
if (!$PAGE->has_secondary_navigation()) {
|
||||
echo $OUTPUT->heading(format_string($forum->name), 2);
|
||||
$activityheaderconfig['hidecompletion'] = true;
|
||||
if (!empty($parententity)) {
|
||||
$activityheaderconfig['description'] = '';
|
||||
}
|
||||
$PAGE->activityheader->set_attrs($activityheaderconfig);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Checkup.
|
||||
if (!empty($parententity) && !$capabilitymanager->can_view_post($USER, $discussionentity, $parententity)) {
|
||||
@@ -1141,10 +1142,6 @@ if (!empty($parententity)) {
|
||||
$rendererfactory = mod_forum\local\container::get_renderer_factory();
|
||||
$postsrenderer = $rendererfactory->get_single_discussion_posts_renderer(FORUM_MODE_THREADED, true);
|
||||
echo $postsrenderer->render($USER, [$forumentity], [$discussionentity], $postentities);
|
||||
} else {
|
||||
if (!empty($forum->intro)) {
|
||||
echo $OUTPUT->box(format_module_intro('forum', $forum, $cm->id), 'generalbox', 'intro');
|
||||
}
|
||||
}
|
||||
|
||||
// Call print disclosure for enabled plagiarism plugins.
|
||||
|
||||
@@ -107,6 +107,7 @@ $PAGE->set_url($pageurl);
|
||||
$PAGE->set_pagelayout('report');
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->activityheader->disable();
|
||||
$PAGE->navbar->add(get_string('nodetitle', 'forumreport_summary'));
|
||||
|
||||
// Activate the secondary nav tab.
|
||||
|
||||
@@ -109,13 +109,13 @@ $PAGE->set_secondary_active_tab("forumsubscriptions");
|
||||
|
||||
// Output starts from here.
|
||||
$actionbar = new \mod_forum\output\subscription_actionbar($id, $url, $forum);
|
||||
$PAGE->activityheader->disable();
|
||||
echo $OUTPUT->header();
|
||||
if (!$PAGE->has_secondary_navigation()) {
|
||||
echo $OUTPUT->heading(get_string('forum', 'forum') . ' ' . $strsubscribers);
|
||||
}
|
||||
echo $forumoutput->subscription_actionbar($actionbar);
|
||||
|
||||
|
||||
if ($edit === 0) {
|
||||
$subscribers = \mod_forum\subscriptions::fetch_subscribed_users($forum, $currentgroup, $context);
|
||||
if (\mod_forum\subscriptions::is_forcesubscribed($forum)) {
|
||||
|
||||
+9
-12
@@ -157,24 +157,21 @@ if (!empty($CFG->enablerssfeeds) && !empty($CFG->forum_enablerssfeeds) && $forum
|
||||
]) . ': ' . format_string($forum->get_name());
|
||||
rss_add_http_header($forum->get_context(), 'mod_forum', $forumrecord, $rsstitle);
|
||||
}
|
||||
|
||||
// Output starts from here.
|
||||
echo $OUTPUT->header();
|
||||
if (!$PAGE->has_secondary_navigation()) {
|
||||
echo $OUTPUT->heading(format_string($forum->get_name()), 2);
|
||||
$activityheader = $PAGE->activityheader;
|
||||
$pageheader = [];
|
||||
if ($activityheader->is_title_allowed()) {
|
||||
$pageheader['title'] = format_string($forum->get_name());
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
// Fetch the current groupid.
|
||||
$groupid = groups_get_activity_group($cm, true) ?: null;
|
||||
|
||||
if (!$istypesingle && !empty($forum->get_intro())) {
|
||||
echo $OUTPUT->box(format_module_intro('forum', $forumrecord, $cm->id), 'generalbox', 'intro');
|
||||
if ($istypesingle || empty($forum->get_intro())) {
|
||||
$pageheader['description'] = '';
|
||||
}
|
||||
$activityheader->set_attrs($pageheader);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
$rendererfactory = mod_forum\local\container::get_renderer_factory();
|
||||
// The elements for view action are rendered and added to the page.
|
||||
|
||||
Reference in New Issue
Block a user