Skip to content

Commit

Permalink
Merge branch 'MDL-38569-master' of git://github.com/FMCorz/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Mar 26, 2013
2 parents 4e4ef99 + 207c737 commit d21a452
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions course/moodleform_mod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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)) {
Expand Down

0 comments on commit d21a452

Please sign in to comment.