From: jerome Date: Thu, 4 Sep 2008 04:58:33 +0000 (+0000) Subject: MDL-15402: when has_admin_config is false, do not display an empty admin config page... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=01ecb25bc9099c5b4027d7a58b589a3d0f20bc32;p=moodle.git MDL-15402: when has_admin_config is false, do not display an empty admin config page during type creation. --- diff --git a/admin/repository.php b/admin/repository.php index 327113683a..b088d27b58 100644 --- a/admin/repository.php +++ b/admin/repository.php @@ -52,11 +52,10 @@ if (!empty($edit) || !empty($new)) { // display the edit form for this instance $mform = new repository_admin_form('', array('plugin' => $plugin, 'instance' => $repositorytype)); // end setup, begin output - if ($mform->is_cancelled()){ redirect($baseurl); exit; - } else if ($fromform = $mform->get_data()){ + } else if ($fromform = $mform->get_data() || (!empty($new) && !repository_static_function($new,"has_admin_config"))){ if (!confirm_sesskey()) { print_error('confirmsesskeybad', '', $baseurl); } @@ -71,7 +70,6 @@ if (!empty($edit) || !empty($new)) { $type->create(); $success = true; $data = data_submitted(); - } if ($success) { $savedstr = get_string('configsaved', 'repository');