diff --git a/discussion.php b/discussion.php index 54014664fa..ed07cff8b5 100644 --- a/discussion.php +++ b/discussion.php @@ -35,6 +35,9 @@ // Set the URL that should be used to return to this page. $PAGE->set_url('/mod/moodleoverflow/discussion.php', array('d' => $d)); +// The page should not be large, only pages containing broad tables are usually. +$PAGE->add_body_class('limitedwidth'); + // Check if the discussion is valid. if (!$discussion = $DB->get_record('moodleoverflow_discussions', array('id' => $d))) { throw new moodle_exception('invaliddiscussionid', 'moodleoverflow'); diff --git a/index.php b/index.php index 4c3ef65567..49e454e495 100644 --- a/index.php +++ b/index.php @@ -356,6 +356,10 @@ $PAGE->navbar->add($string['moodleoverflows']); $PAGE->set_title($course->shortname . ': ' . $string['moodleoverflows']); $PAGE->set_heading($course->fullname); + +// The page should not be large, only pages containing broad tables are usually. +$PAGE->add_body_class('limitedwidth'); + echo $OUTPUT->header(); // Show the subscribe all option only to non-guest and enrolled users. diff --git a/post.php b/post.php index dd3edb4ffd..5baa519ba5 100644 --- a/post.php +++ b/post.php @@ -113,6 +113,9 @@ $PAGE->set_title($course->shortname); $PAGE->set_heading($course->fullname); + // The page should not be large, only pages containing broad tables are usually. + $PAGE->add_body_class('limitedwidth'); + // The guest needs to login. echo $OUTPUT->header(); $strlogin = get_string('noguestpost', 'forum') . '

' . get_string('liketologin'); @@ -424,6 +427,9 @@ $PAGE->set_title($course->shortname); $PAGE->set_heading($course->fullname); + // The page should not be large, only pages containing broad tables are usually. + $PAGE->add_body_class('limitedwidth'); + // Check if there are replies for the post. if ($replycount) { @@ -773,6 +779,9 @@ $PAGE->set_title("$course->shortname: $moodleoverflow->name " . format_string($toppost->subject)); $PAGE->set_heading($course->fullname); +// The page should not be large, only pages containing broad tables are usually. +$PAGE->add_body_class('limitedwidth'); + // Display the header. echo $OUTPUT->header(); diff --git a/view.php b/view.php index f94467617b..8867be8bd8 100644 --- a/view.php +++ b/view.php @@ -92,6 +92,9 @@ $PAGE->requires->js_call_amd('mod_moodleoverflow/rating', 'init', [$USER->id, $marksetting->allowmultiplemarks]); +// The page should not be large, only pages containing broad tables are usually. +$PAGE->add_body_class('limitedwidth'); + // Output starts here. echo $OUTPUT->header();