Permalink
Browse files

Merge branch 'MDL-59460_master' of git://github.com/dmonllao/moodle

  • Loading branch information...
dmonllao committed Jul 18, 2017
2 parents d2f3823 + 3f6e42b commit 95d8e6116136f7bd6f410301360da9c2e6a2c88a
Showing with 29 additions and 6 deletions.
  1. +1 −0 mod/forum/lang/en/forum.php
  2. +15 −0 mod/forum/lib.php
  3. +7 −5 mod/forum/mod_form.php
  4. +5 −0 mod/forum/settings.php
  5. +1 −1 version.php
@@ -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.';
@@ -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.
@@ -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');
@@ -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');
@@ -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.

0 comments on commit 95d8e61

Please sign in to comment.