Skip to content

Commit 83de9e8

Browse files
committed
feature is almost completed (testing missing), topic can be moved to another forum. Coding style errors are fixed
1 parent cb221b5 commit 83de9e8

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

locallib.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ function moodleoverflow_print_latest_discussions($moodleoverflow, $cm, $page = -
355355
// build linktopopup to move a topic
356356
$linktopopup = $CFG->wwwroot . '/mod/moodleoverflow/view.php?id=' . $cm->id . '&movetopopup=' . $discussion->discussion;
357357
$preparedarray[$i]['linktopopup'] = $linktopopup;
358-
358+
359359
// Add all created data to an array.
360360
$preparedarray[$i]['statusstarter'] = $statusstarter;
361361
$preparedarray[$i]['statusteacher'] = $statusteacher;
@@ -402,7 +402,7 @@ function moodleoverflow_print_forum_list($course, $cm, $movetopopup) {
402402
$forums = $DB->get_records('moodleoverflow', array('course' => $course->id));
403403
$amountforums = count($forums);
404404

405-
if($amountforums > 1) {
405+
if ($amountforums > 1) {
406406
// write the moodleoverflow-names in an array.
407407
$i = 0;
408408
foreach ($forums as $forum) {
@@ -419,7 +419,6 @@ function moodleoverflow_print_forum_list($course, $cm, $movetopopup) {
419419
} else {
420420
$amountforums = false;
421421
}
422-
423422

424423
// build popup
425424
$renderer = $PAGE->get_renderer('mod_moodleoverflow');

renderer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class mod_moodleoverflow_renderer extends plugin_renderer_base {
4646
public function render_discussion_list($data) {
4747
return $this->render_from_template('mod_moodleoverflow/discussion_list', $data);
4848
}
49-
49+
5050
/**
5151
* Display the forum list in the view.php if a discussion needs to be moved to another forum.
5252
*/

view.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
moodleoverflow_print_forum_list($course, $cm, $movetopopup);
120120
}
121121

122-
if($linktoforum && $movetopopup && has_capability('mod/moodleoverflow:movetopic', $context)) {
122+
if ($linktoforum && $movetopopup && has_capability('mod/moodleoverflow:movetopic', $context)) {
123123
// Take the $movetopopup-id and the $linktoforum-id and move the discussion to the forum
124124
$topic = $DB->get_record('moodleoverflow_discussions', array('id' => $movetopopup));
125125
$topic->moodleoverflow = $linktoforum;

0 commit comments

Comments
 (0)