Permalink
Browse files

MDL-38569 form: No advanced settings in Common module settings

  • Loading branch information...
1 parent 373a8e0 commit 207c737dc05894291d41a17e396b6d829d09fc1f @FMCorz FMCorz committed Mar 22, 2013
Showing with 14 additions and 15 deletions.
  1. +14 −15 course/moodleform_mod.php
View
@@ -457,6 +457,20 @@ function standard_coursemodule_elements(){
//$this->standard_grading_coursemodule_elements();
$mform->addElement('header', 'modstandardelshdr', get_string('modstandardels', 'form'));
+
+ $mform->addElement('modvisible', 'visible', get_string('visible'));
+ if (!empty($this->_cm)) {
+ $context = context_module::instance($this->_cm->id);
+ if (!has_capability('moodle/course:activityvisibility', $context)) {
+ $mform->hardFreeze('visible');
+ }
+ }
+
+ if ($this->_features->idnumber) {
+ $mform->addElement('text', 'cmidnumber', get_string('idnumbermod'));
+ $mform->addHelpButton('cmidnumber', 'idnumbermod');
+ }
+
if ($this->_features->groups) {
$options = array(NOGROUPS => get_string('groupsnone'),
SEPARATEGROUPS => get_string('groupsseparate'),
@@ -476,26 +490,11 @@ function standard_coursemodule_elements(){
}
$mform->addElement('select', 'groupingid', get_string('grouping', 'group'), $options);
$mform->addHelpButton('groupingid', 'grouping', 'group');
- $mform->setAdvanced('groupingid');
}
if ($this->_features->groupmembersonly) {
$mform->addElement('checkbox', 'groupmembersonly', get_string('groupmembersonly', 'group'));
$mform->addHelpButton('groupmembersonly', 'groupmembersonly', 'group');
- $mform->setAdvanced('groupmembersonly');
- }
-
- $mform->addElement('modvisible', 'visible', get_string('visible'));
- if (!empty($this->_cm)) {
- $context = context_module::instance($this->_cm->id);
- if (!has_capability('moodle/course:activityvisibility', $context)) {
- $mform->hardFreeze('visible');
- }
- }
-
- if ($this->_features->idnumber) {
- $mform->addElement('text', 'cmidnumber', get_string('idnumbermod'));
- $mform->addHelpButton('cmidnumber', 'idnumbermod');
}
if (!empty($CFG->enableavailability)) {

0 comments on commit 207c737

Please sign in to comment.