]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14591 - fixed up the ordering of the deferring to plugins in admin_config_form
authormjollnir_ <mjollnir_>
Tue, 16 Sep 2008 13:01:13 +0000 (13:01 +0000)
committermjollnir_ <mjollnir_>
Tue, 16 Sep 2008 13:01:13 +0000 (13:01 +0000)
lib/portfolio/forms.php

index a7fd5cd5ad7b3f1f82315868afc9805e51a0ed78..ab963297a777582e87a5350fbbcb7586ad09f56c 100644 (file)
@@ -134,15 +134,10 @@ final class portfolio_admin_form extends moodleform {
         $mform->addElement('hidden', 'new',   $this->plugin);
         $mform->addElement('hidden', 'plugin', $this->plugin);
 
-        // let the plugin add the fields they want (either statically or not)
-        if (portfolio_static_function($this->plugin, 'has_admin_config')) {
-            if (!$this->instance) {
-                $insane = portfolio_instance_sanity_check($this->instance);
-                portfolio_static_function($this->plugin, 'admin_config_form', $mform);
-            } else {
-                $insane = portfolio_plugin_sanity_check($this->plugin);
-                $this->instance->admin_config_form($mform);
-            }
+        if (!$this->instance) {
+            $insane = portfolio_instance_sanity_check($this->instance);
+        } else {
+            $insane = portfolio_plugin_sanity_check($this->plugin);
         }
 
         if (isset($insane) && is_array($insane)) {
@@ -155,6 +150,14 @@ final class portfolio_admin_form extends moodleform {
         $mform->addElement('text', 'name', get_string('name'), 'maxlength="100" size="30"');
         $mform->addRule('name', $strrequired, 'required', null, 'client');
 
+        // let the plugin add the fields they want (either statically or not)
+        if (portfolio_static_function($this->plugin, 'has_admin_config')) {
+            if (!$this->instance) {
+                portfolio_static_function($this->plugin, 'admin_config_form', $mform);
+            } else {
+                $this->instance->admin_config_form($mform);
+            }
+        }
 
         // and set the data if we have some.
         if ($this->instance) {