]> git.mjollnir.org Git - moodle.git/commitdiff
blocks editing ui: MDL-19398 Make block config_global.html files more strongly deprec...
authortjhunt <tjhunt>
Wed, 15 Jul 2009 08:52:33 +0000 (08:52 +0000)
committertjhunt <tjhunt>
Wed, 15 Jul 2009 08:52:33 +0000 (08:52 +0000)
admin/block.php
blocks/moodleblock.class.php

index 4d42f742e13ea234f7e2e1e730d7de6af22ddb77..b85efe83a520a5318792e46e7ce6b55c103294b0 100644 (file)
 
     print_heading($strblockname);
 
-    print_simple_box(get_string('configwarning', 'admin'), 'center', '50%');
+    notify('This block still uses an old-style config_global.html file. ' .
+            'It must be updated by a developer to use a settings.php file.');
+
+    print_box(get_string('configwarning', 'admin'), 'generalbox boxwidthnormal boxaligncenter');
     echo '<br />';
 
     echo '<form method="post" action="block.php">';
         echo '<input type="hidden" name="'. $name .'" value="'. $val .'" />';
     }
     echo '</p>';
-    $block->config_print();
+
+    print_box_start();
+    include($CFG->dirroot.'/blocks/'. $block->name() .'/config_global.html');
+    print_box_end();
+
     echo '</form>';
     print_footer();
 
index 7436d0d49af9c7cfd18bb9786a59468e5d633176..60f4ca6a56fbc4fedb5cb76311aaa659978b1dfd 100644 (file)
@@ -463,25 +463,6 @@ class block_base {
         return false;
     }
 
-    /**
-     * Default behavior: print the config_global.html file
-     * You don't need to override this if you're satisfied with the above
-     *
-     * @return boolean
-     */
-    function config_print() {
-        // Default behavior: print the config_global.html file
-        // You don't need to override this if you're satisfied with the above
-        if (!$this->has_config()) {
-            return false;
-        }
-        global $CFG;
-        print_simple_box_start('center', '', '', 5, 'blockconfigglobal');
-        include($CFG->dirroot.'/blocks/'. $this->name() .'/config_global.html');
-        print_simple_box_end();
-        return true;
-    }
-    
     /**
      * Default behavior: save all variables as $CFG properties
      * You don't need to override this if you 're satisfied with the above
@@ -712,6 +693,10 @@ class block_base {
                 'should not have been calling it anyway.');
     }
 
+    /** @deprecated since Moodle 2.0. */
+    function config_print() {
+        throw new coding_exception('config_print() can no longer be used. Blocks should use a settings.php file.');
+    }
 }
 
 /**