Skip to content

Commit 74296d8

Browse files
authored
Merge branch 'master' into 42-ucl-rebase
2 parents 3fce967 + ea98304 commit 74296d8

33 files changed

+393
-280
lines changed

README.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Open Forum Activity
2-
Open forums enhance Moodle Forums by providing teachers and students with quick,
3-
simple views into the forums and their discussions. Allowing users to sort and search
4-
discussions easily and in multiple layouts is key to Advanced Forums increased usability.
5-
Read tracking is a feature in Advanced forums that highlights unread posts,
6-
making it even easier to manage a forum. This saves the student time in viewing and
7-
responding to posts, and saves the teacher time in finding the posts that are most
8-
relevant to the class. Teachers are empowered to create anonymous interactions with
2+
3+
Open forums enhance Moodle Forums by providing teachers and students with quick,
4+
simple views into the forums and their discussions. Allowing users to sort and search
5+
discussions easily and in multiple layouts is key to Advanced Forums increased usability.
6+
Read tracking is a feature in Advanced forums that highlights unread posts,
7+
making it even easier to manage a forum. This saves the student time in viewing and
8+
responding to posts, and saves the teacher time in finding the posts that are most
9+
relevant to the class. Teachers are empowered to create anonymous interactions with
910
students while still being able to provide accurate grading with advanced grading methods.
1011

1112
![local_hsuforum](https://moodle.org/pluginfile.php/50/local_plugins/plugin_description/399/recent%20posts.png)
@@ -16,11 +17,33 @@ schools and organizations by supporting the software that educators use to manag
1617
learners in virtual classrooms.
1718

1819
## Installation
20+
1921
Extract the contents of the plugin into _/wwwroot/mod_ then visit `admin/upgrade.php` or use the CLI script to upgrade your site.
2022

2123
For more information about the configuration and usage, please see http://docs.moodle.org/dev/Advanced_Forum
2224

25+
## Flag
26+
27+
### The `hsuforum_digestmailtime` flag.
28+
29+
### The `hsuforum_allowforcedreadtracking` flag.
30+
31+
### The `hsuforum_enabletimedposts` flag.
32+
33+
### The `hsuforum_digestmailtimelast` flag.
34+
35+
### The `mod_hsuforum_grading_interface` flag.
36+
37+
### The `hsuforum_replytouser` flag.
38+
39+
### The `hsuforum_subscription` flag.
40+
41+
## Task
42+
43+
### `cron_task` scheduled task .
44+
2345
## License
46+
2447
Copyright (c) 2021 Open LMS (https://www.openlms.net)
2548

2649
This program is free software: you can redistribute it and/or modify it under
@@ -33,4 +56,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3356
PARTICULAR PURPOSE. See the GNU General Public License for more details.
3457

3558
You should have received a copy of the GNU General Public License along with
36-
this program. If not, see <http://www.gnu.org/licenses/>.
59+
this program. If not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).

amd/build/accessibility.min.js

Lines changed: 23 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/accessibility.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/src/accessibility.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* You should have received a copy of the GNU General Public License
1515
* along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616
*
17-
* @package mod_hsuforum
1817
* @author Rafael Becerra rafael.becerrarodriguez@openlms.net
1918
* @copyright Copyright (c) 2019 Open LMS (https://www.openlms.net)
2019
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -42,6 +41,6 @@ define(['jquery'],
4241
}
4342
});
4443
}
45-
}
44+
};
4645
}
4746
);

classes/controller/export_controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function export_action() {
7070
$mform = new export_form($this->new_url(), (object) array(
7171
'cm' => $cm,
7272
'forum' => $PAGE->activityrecord,
73-
));
73+
), 'post', '', array('onreset' => ''));
7474

7575
if ($mform->is_cancelled()) {
7676
redirect(new \moodle_url('/mod/hsuforum/view.php', array('id' => $cm->id)));

lang/en/hsuforum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@
736736
$string['inprivatereplyto'] = 'in private reply to';
737737
$string['options'] = 'Options';
738738
$string['articledateformat'] = '%l:%M%P %b %e, %Y';
739+
$string['userdateformat'] = '%l:%M%P %b %e, %Y';
739740
$string['postdeleted'] = 'Post deleted';
740741
$string['postcreated'] = 'Post created';
741742
$string['cannnotdeletesinglediscussion'] = 'Sorry, but you are not allowed to delete that discussion!';

lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4405,7 +4405,7 @@ function hsuforum_add_discussion($discussion, $mform=null, $unused=null, $userid
44054405
$post->mailnow = $discussion->mailnow;
44064406
$post->reveal = $discussion->reveal;
44074407

4408-
if (!is_null($mform) && method_exists((object) $mform, 'get_data')) {
4408+
if (is_object($mform) && method_exists($mform, 'get_data')) {
44094409
$data = $mform->get_data();
44104410
if (!empty($data->reveal)) {
44114411
$post->reveal = 1;

lib/discussion/sort.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function disable($key) {
228228
* @return string the string representation of the object or &null;
229229
*/
230230
public function serialize() {
231-
return serialize(array('key' => $this->get_key(), 'direction' => $this->get_direction()));
231+
return serialize($this->__serialize());
232232
}
233233

234234
/**
@@ -242,11 +242,24 @@ public function serialize() {
242242
* @return void
243243
*/
244244
public function unserialize($serialized) {
245-
$sortinfo = unserialize($serialized);
245+
$serialized = unserialize($serialized);
246+
$this->__unserialize($serialized);
247+
}
246248

249+
/**
250+
* @return array
251+
*/
252+
public function __serialize() {
253+
return array('key' => $this->get_key(), 'direction' => $this->get_direction());
254+
}
255+
256+
/**
257+
* @return void
258+
*/
259+
public function __unserialize($serialized) {
247260
try {
248-
$this->set_key($sortinfo['key'])
249-
->set_direction($sortinfo['direction']);
261+
$this->set_key($serialized['key'])
262+
->set_direction($serialized['direction']);
250263
} catch (Exception $e) {
251264
// Ignore...
252265
}

post.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,16 @@
577577
$formheading = get_string('yournewquestion', 'hsuforum');
578578
} else {
579579
$formheading = get_string('yournewtopic', 'hsuforum');
580+
// Hide duplicated hsuforum description when creating a new discussion topic, see INT-18928.
581+
$hidehtml = '';
582+
$hidehtml .= html_writer::start_tag('style', array('type' => 'text/css')) . "\n";
583+
$hidehtml .= '
584+
#page-mod-hsuforum-post .activity-description,
585+
#page-mod-hsuforum-post [role="main"] h2 {
586+
display: none;
587+
};';
588+
$hidehtml .= html_writer::end_tag('style') . "\n";
589+
echo $hidehtml;
580590
}
581591
}
582592

renderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public function discussion($cm, $discussion, $post, $fullthread, array $posts =
341341
if (!property_exists($discussion, 'unread') or empty($discussion->unread)) {
342342
$discussion->unread = '-';
343343
}
344-
$format = get_string('articledateformat', 'hsuforum');
344+
$format = get_string('userdateformat', 'hsuforum');
345345

346346
$groups = groups_get_all_groups($course->id, 0, $cm->groupingid);
347347
$group = '';
@@ -492,7 +492,7 @@ public function post($cm, $discussion, $post, $canreply = false, $parent = null,
492492
$data->fullname = $postuser->fullname;
493493
$data->subject = property_exists($post, 'breadcrumb') ? $post->breadcrumb : $this->raw_post_subject($post);
494494
$data->message = $this->post_message($post, $cm, $search);
495-
$data->created = userdate($post->created, get_string('articledateformat', 'hsuforum'));
495+
$data->created = userdate($post->created, get_string('userdateformat', 'hsuforum'));
496496
$data->rawcreated = $post->created;
497497
$data->privatereply = $post->privatereply;
498498
$data->imagesrc = $postuser->user_picture->get_url($this->page)->out();

0 commit comments

Comments
 (0)