MDL-59460 mod_forum: Ensure CFG->forum_subscription is set
This commit is contained in:
+1
-1
@@ -6813,7 +6813,7 @@ function forum_get_view_actions() {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function forum_get_subscriptionmode_opions() {
|
||||
function forum_get_subscriptionmode_options() {
|
||||
$options = array();
|
||||
$options[FORUM_CHOOSESUBSCRIBE] = get_string('subscriptionoptional', 'forum');
|
||||
$options[FORUM_FORCESUBSCRIBE] = get_string('subscriptionforced', 'forum');
|
||||
|
||||
@@ -90,10 +90,15 @@ class mod_forum_mod_form extends moodleform_mod {
|
||||
// Subscription and tracking.
|
||||
$mform->addElement('header', 'subscriptionandtrackinghdr', get_string('subscriptionandtracking', 'forum'));
|
||||
|
||||
$options = forum_get_subscriptionmode_opions();
|
||||
$options = forum_get_subscriptionmode_options();
|
||||
$mform->addElement('select', 'forcesubscribe', get_string('subscriptionmode', 'forum'), $options);
|
||||
$mform->addHelpButton('forcesubscribe', 'subscriptionmode', 'forum');
|
||||
$mform->setDefault('forcesubscribe', $CFG->forum_subscription);
|
||||
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');
|
||||
|
||||
@@ -55,7 +55,7 @@ if ($ADMIN->fulltree) {
|
||||
get_string('configmaxattachments', 'forum'), 9, PARAM_INT));
|
||||
|
||||
// Default Subscription mode setting.
|
||||
$options = forum_get_subscriptionmode_opions();
|
||||
$options = forum_get_subscriptionmode_options();
|
||||
$settings->add(new admin_setting_configselect('forum_subscription', get_string('subscriptionmode', 'forum'),
|
||||
get_string('configsubscriptiontype', 'forum'), FORUM_CHOOSESUBSCRIBE, $options));
|
||||
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user