Skip to content

Commit be4c2b7

Browse files
committed
Limitedwidth page size fixes #148.
1 parent f263d67 commit be4c2b7

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

discussion.php

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
// Set the URL that should be used to return to this page.
3636
$PAGE->set_url('/mod/moodleoverflow/discussion.php', array('d' => $d));
3737

38+
// The page should not be large, only pages containing broad tables are usually.
39+
$PAGE->add_body_class('limitedwidth');
40+
3841
// Check if the discussion is valid.
3942
if (!$discussion = $DB->get_record('moodleoverflow_discussions', array('id' => $d))) {
4043
throw new moodle_exception('invaliddiscussionid', 'moodleoverflow');

post.php

+9
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@
113113
$PAGE->set_title($course->shortname);
114114
$PAGE->set_heading($course->fullname);
115115

116+
// The page should not be large, only pages containing broad tables are usually.
117+
$PAGE->add_body_class('limitedwidth');
118+
116119
// The guest needs to login.
117120
echo $OUTPUT->header();
118121
$strlogin = get_string('noguestpost', 'forum') . '<br /><br />' . get_string('liketologin');
@@ -424,6 +427,9 @@
424427
$PAGE->set_title($course->shortname);
425428
$PAGE->set_heading($course->fullname);
426429

430+
// The page should not be large, only pages containing broad tables are usually.
431+
$PAGE->add_body_class('limitedwidth');
432+
427433
// Check if there are replies for the post.
428434
if ($replycount) {
429435

@@ -773,6 +779,9 @@
773779
$PAGE->set_title("$course->shortname: $moodleoverflow->name " . format_string($toppost->subject));
774780
$PAGE->set_heading($course->fullname);
775781

782+
// The page should not be large, only pages containing broad tables are usually.
783+
$PAGE->add_body_class('limitedwidth');
784+
776785
// Display the header.
777786
echo $OUTPUT->header();
778787

view.php

+3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292

9393
$PAGE->requires->js_call_amd('mod_moodleoverflow/rating', 'init', [$USER->id, $marksetting->allowmultiplemarks]);
9494

95+
// The page should not be large, only pages containing broad tables are usually.
96+
$PAGE->add_body_class('limitedwidth');
97+
9598
// Output starts here.
9699
echo $OUTPUT->header();
97100

0 commit comments

Comments
 (0)