From: moodler Date: Wed, 1 Aug 2007 04:40:56 +0000 (+0000) Subject: Hide outcomes from mod update when outcomes are not enabled X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f3b783f407e1fa63867ccc16588990c455926da6;p=moodle.git Hide outcomes from mod update when outcomes are not enabled --- diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php index f887318f81..edffc3bde4 100644 --- a/course/moodleform_mod.php +++ b/course/moodleform_mod.php @@ -89,6 +89,16 @@ class moodleform_mod extends moodleform { function standard_coursemodule_elements($supportsgroups=true){ global $COURSE; $mform =& $this->_form; + + if (!empty($CFG->enableoutcomes)) { + if ($outcomes = grade_outcome::fetch_all_available($COURSE->id)) { + $mform->addElement('header', 'modoutcomes', get_string('outcomes', 'grades')); + foreach($outcomes as $outcome) { + $mform->addElement('advcheckbox', 'outcome_'.$outcome->id, $outcome->get_name()); + } + } + } + $mform->addElement('header', 'modstandardelshdr', get_string('modstandardels', 'form')); if ($supportsgroups){ // TODO: we must define this as mod property! @@ -97,13 +107,6 @@ class moodleform_mod extends moodleform { $mform->addElement('modvisible', 'visible', get_string('visible')); $mform->addElement('text', 'cmidnumber', get_string('idnumber')); - if ($outcomes = grade_outcome::fetch_all_available($COURSE->id)) { - $mform->addElement('header', 'modoutcomes', get_string('outcomes', 'grades')); - foreach($outcomes as $outcome) { - $mform->addElement('advcheckbox', 'outcome_'.$outcome->id, $outcome->get_name()); - } - - } $this->standard_hidden_coursemodule_elements(); } @@ -186,4 +189,4 @@ class moodleform_mod extends moodleform { } -?> \ No newline at end of file +?>