]> git.mjollnir.org Git - moodle.git/commitdiff
Hide outcomes from mod update when outcomes are not enabled
authormoodler <moodler>
Wed, 1 Aug 2007 04:40:56 +0000 (04:40 +0000)
committermoodler <moodler>
Wed, 1 Aug 2007 04:40:56 +0000 (04:40 +0000)
course/moodleform_mod.php

index f887318f815e42cc69fda5d6ef6be398aa43152e..edffc3bde44e09ba9fb3dfec63c14c38c7a34c6e 100644 (file)
@@ -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
+?>