]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15402: when has_admin_config is false, do not display an empty admin config page...
authorjerome <jerome>
Thu, 4 Sep 2008 04:58:33 +0000 (04:58 +0000)
committerjerome <jerome>
Thu, 4 Sep 2008 04:58:33 +0000 (04:58 +0000)
admin/repository.php

index 327113683a19c8f0473fdac9fa8cf7ccb7528219..b088d27b581a05549fdd3e6fde3849e887e34d39 100644 (file)
@@ -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');