Skip to content

Commit edd9c82

Browse files
authored
Merge pull request #69 from catalyst/totara-compatibility
feat: totara compatibility
2 parents 86be024 + 9079821 commit edd9c82

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

db/messages.php

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424

2525
defined('MOODLE_INTERNAL') || die();
2626

27+
// Totara compatibility.
28+
if (!defined('MESSAGE_DEFAULT_ENABLED')) {
29+
define('MESSAGE_DEFAULT_ENABLED', MESSAGE_DEFAULT_LOGGEDIN | MESSAGE_DEFAULT_LOGGEDOFF);
30+
}
31+
2732
$messageproviders = array(
2833
// Notify teacher that a student has submitted an attempt.
2934
'submission' => array(

lib.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
* @return mixed true if the feature is supported, null if unknown
5050
*/
5151
function hvp_supports($feature) {
52+
// Totara compatibility.
53+
if (defined('FEATURE_MOD_PURPOSE') && $feature == FEATURE_MOD_PURPOSE) {
54+
return MOD_PURPOSE_CONTENT;
55+
}
56+
5257
switch($feature) {
5358
case FEATURE_GROUPS:
5459
return true;
@@ -70,8 +75,6 @@ function hvp_supports($feature) {
7075
return true;
7176
case FEATURE_SHOW_DESCRIPTION:
7277
return true;
73-
case FEATURE_MOD_PURPOSE:
74-
return MOD_PURPOSE_CONTENT;
7578

7679
default:
7780
return null;

0 commit comments

Comments
 (0)