From: tjhunt Date: Wed, 15 Jul 2009 08:52:33 +0000 (+0000) Subject: blocks editing ui: MDL-19398 Make block config_global.html files more strongly deprec... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7cf51142ab3c11cd51e39d03c1fdf6f70c63479e;p=moodle.git blocks editing ui: MDL-19398 Make block config_global.html files more strongly deprecated. --- diff --git a/admin/block.php b/admin/block.php index 4d42f742e1..b85efe83a5 100644 --- a/admin/block.php +++ b/admin/block.php @@ -53,7 +53,10 @@ 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 '
'; echo '
'; @@ -62,7 +65,11 @@ echo ''; } echo '

'; - $block->config_print(); + + print_box_start(); + include($CFG->dirroot.'/blocks/'. $block->name() .'/config_global.html'); + print_box_end(); + echo '
'; print_footer(); diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 7436d0d49a..60f4ca6a56 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -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.'); + } } /**