From d8ef60bd7239ba03b04ee41e1f9dfdbc9e73b8bb Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Tue, 14 Sep 2010 02:12:41 +0000 Subject: [PATCH] blocks MDL-24066 Blocks can now choose to be hideable + navigation and settings are no longer hideable. --- blocks/moodleblock.class.php | 15 +++++ blocks/navigation/block_navigation.php | 10 ++++ blocks/navigation/db/upgrade.php | 19 +++++++ blocks/navigation/version.php | 2 +- blocks/settings/block_settings.php | 10 ++++ blocks/settings/db/upgrade.php | 76 ++++++++++++++++++++++++++ blocks/settings/version.php | 2 +- lib/blocklib.php | 9 ++- 8 files changed, 139 insertions(+), 4 deletions(-) create mode 100644 blocks/settings/db/upgrade.php diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 10e14633ab5..201435443f2 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -725,11 +725,26 @@ class block_base { throw new coding_exception('config_print() can no longer be used. Blocks should use a settings.php file.'); } + /** + * Can be overridden by the block to prevent the block from being dockable. + * + * @return bool + */ public function instance_can_be_docked() { global $CFG; return (!empty($CFG->allowblockstodock) && $this->page->theme->enable_dock); } + /** + * If overridden and set to true by the block it will not be hidable when + * editing is turned on. + * + * @return bool + */ + public function instance_can_be_hidden() { + return true; + } + /** @callback callback functions for comments api */ public static function comment_template($options) { $ret = <<