Skip to content

Commit

Permalink
Limitedwidth page size fixes #148.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Jun 10, 2023
1 parent f263d67 commit be4c2b7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions discussion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
9 changes: 9 additions & 0 deletions post.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') . '<br /><br />' . get_string('liketologin');
Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -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();

Expand Down
3 changes: 3 additions & 0 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit be4c2b7

Please sign in to comment.