From 2726b4059884e367b8cd06e8ab7a553dfe0a9c21 Mon Sep 17 00:00:00 2001 From: mjollnir_ Date: Tue, 16 Sep 2008 13:01:13 +0000 Subject: [PATCH] MDL-14591 - fixed up the ordering of the deferring to plugins in admin_config_form --- lib/portfolio/forms.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/portfolio/forms.php b/lib/portfolio/forms.php index a7fd5cd5ad..ab963297a7 100644 --- a/lib/portfolio/forms.php +++ b/lib/portfolio/forms.php @@ -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) { -- 2.39.5