Skip to content

Commit

Permalink
Merge branch 'MDL-59460_master' of git://github.com/dmonllao/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonllao committed Jul 18, 2017
2 parents d2f3823 + 3f6e42b commit 95d8e61
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
1 change: 1 addition & 0 deletions mod/forum/lang/en/forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
$string['configreplytouser'] = 'When a forum post is mailed out, should it contain the user\'s email address so that recipients can reply personally rather than via the forum? Even if set to \'Yes\' users can choose in their profile to keep their email address secret.';
$string['configrsstypedefault'] = 'If RSS feeds are enabled, sets the default activity type.';
$string['configrssarticlesdefault'] = 'If RSS feeds are enabled, sets the default number of articles (either discussions or posts).';
$string['configsubscriptiontype'] = 'Default setting for subscription mode.';
$string['configshortpost'] = 'Any post under this length (in characters not including HTML) is considered short (see below).';
$string['configtrackingtype'] = 'Default setting for read tracking.';
$string['configtrackreadposts'] = 'Set to \'yes\' if you want to track read/unread for each user.';
Expand Down
15 changes: 15 additions & 0 deletions mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6807,6 +6807,21 @@ function forum_get_view_actions() {
return array('view discussion', 'search', 'forum', 'forums', 'subscribers', 'view forum');
}

/**
* List the options for forum subscription modes.
* This is used by the settings page and by the mod_form page.
*
* @return array
*/
function forum_get_subscriptionmode_options() {
$options = array();
$options[FORUM_CHOOSESUBSCRIBE] = get_string('subscriptionoptional', 'forum');
$options[FORUM_FORCESUBSCRIBE] = get_string('subscriptionforced', 'forum');
$options[FORUM_INITIALSUBSCRIBE] = get_string('subscriptionauto', 'forum');
$options[FORUM_DISALLOWSUBSCRIBE] = get_string('subscriptiondisabled', 'forum');
return $options;
}

/**
* List the actions that correspond to a post of this module.
* This is used by the participation report.
Expand Down
12 changes: 7 additions & 5 deletions mod/forum/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ function definition() {
// Subscription and tracking.
$mform->addElement('header', 'subscriptionandtrackinghdr', get_string('subscriptionandtracking', 'forum'));

$options = array();
$options[FORUM_CHOOSESUBSCRIBE] = get_string('subscriptionoptional', 'forum');
$options[FORUM_FORCESUBSCRIBE] = get_string('subscriptionforced', 'forum');
$options[FORUM_INITIALSUBSCRIBE] = get_string('subscriptionauto', 'forum');
$options[FORUM_DISALLOWSUBSCRIBE] = get_string('subscriptiondisabled','forum');
$options = forum_get_subscriptionmode_options();
$mform->addElement('select', 'forcesubscribe', get_string('subscriptionmode', 'forum'), $options);
$mform->addHelpButton('forcesubscribe', 'subscriptionmode', 'forum');
if (isset($CFG->forum_subscription)) {
$defaultforumsubscription = $CFG->forum_subscription;
} else {
$defaultforumsubscription = FORUM_CHOOSESUBSCRIBE;
}
$mform->setDefault('forcesubscribe', $defaultforumsubscription);

$options = array();
$options[FORUM_TRACKING_OPTIONAL] = get_string('trackingoptional', 'forum');
Expand Down
5 changes: 5 additions & 0 deletions mod/forum/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
$settings->add(new admin_setting_configtext('forum_maxattachments', get_string('maxattachments', 'forum'),
get_string('configmaxattachments', 'forum'), 9, PARAM_INT));

// Default Subscription mode setting.
$options = forum_get_subscriptionmode_options();
$settings->add(new admin_setting_configselect('forum_subscription', get_string('subscriptionmode', 'forum'),
get_string('configsubscriptiontype', 'forum'), FORUM_CHOOSESUBSCRIBE, $options));

// Default Read Tracking setting.
$options = array();
$options[FORUM_TRACKING_OPTIONAL] = get_string('trackingoptional', 'forum');
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

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

$version = 2017071400.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2017071400.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.

Expand Down

0 comments on commit 95d8e61

Please sign in to comment.