From 2c2171bdced5f737387a24c0da5f6d41f9ade257 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Tue, 9 Dec 2014 15:25:35 +0800 Subject: [PATCH] MDL-45295 core_block: Removing obsolete method preferred_width() --- blocks/calendar_month/block_calendar_month.php | 9 --------- blocks/course_summary/block_course_summary.php | 4 ---- blocks/moodleblock.class.php | 16 ---------------- blocks/rss_client/block_rss_client.php | 4 ---- blocks/tag_flickr/block_tag_flickr.php | 4 ---- blocks/tag_youtube/block_tag_youtube.php | 4 ---- blocks/upgrade.txt | 4 ++++ 7 files changed, 4 insertions(+), 41 deletions(-) diff --git a/blocks/calendar_month/block_calendar_month.php b/blocks/calendar_month/block_calendar_month.php index 41cd98e56b578..ace839e7b6698 100644 --- a/blocks/calendar_month/block_calendar_month.php +++ b/blocks/calendar_month/block_calendar_month.php @@ -30,15 +30,6 @@ public function init() { $this->title = get_string('pluginname', 'block_calendar_month'); } - /** - * Return preferred_width. - * - * @return int - */ - public function preferred_width() { - return 210; - } - /** * Return the content of this block. * diff --git a/blocks/course_summary/block_course_summary.php b/blocks/course_summary/block_course_summary.php index 281aba3fad8c7..c2163fca05433 100644 --- a/blocks/course_summary/block_course_summary.php +++ b/blocks/course_summary/block_course_summary.php @@ -74,10 +74,6 @@ function hide_header() { return true; } - function preferred_width() { - return 210; - } - } diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index bbbd72b3d8d02..0061a9bdd6c81 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -326,11 +326,6 @@ function _self_test() { $correct = false; } - $width = $this->preferred_width(); - if (!is_int($width) || $width <= 0) { - $errors[] = 'invalid_width'; - $correct = false; - } return $correct; } @@ -594,17 +589,6 @@ static function get_extra_capabilities() { return array('moodle/block:view', 'moodle/block:edit'); } - // Methods deprecated in Moodle 2.0 ======================================== - - /** - * Default case: the block wants to be 180 pixels wide - * @deprecated since Moodle 2.0. - * @return int - */ - function preferred_width() { - return 180; - } - /** * Can be overridden by the block to prevent the block from being dockable. * diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php index 30b623cb374e6..975673c4da7c2 100644 --- a/blocks/rss_client/block_rss_client.php +++ b/blocks/rss_client/block_rss_client.php @@ -28,10 +28,6 @@ function init() { $this->title = get_string('pluginname', 'block_rss_client'); } - function preferred_width() { - return 210; - } - function applicable_formats() { return array('all' => true, 'tag' => false); // Needs work to make it work on tags MDL-11960 } diff --git a/blocks/tag_flickr/block_tag_flickr.php b/blocks/tag_flickr/block_tag_flickr.php index 46f8c190c0583..06f691d388d5e 100644 --- a/blocks/tag_flickr/block_tag_flickr.php +++ b/blocks/tag_flickr/block_tag_flickr.php @@ -43,10 +43,6 @@ function instance_allow_multiple() { return true; } - function preferred_width() { - return 170; - } - function get_content() { global $CFG, $USER; diff --git a/blocks/tag_youtube/block_tag_youtube.php b/blocks/tag_youtube/block_tag_youtube.php index 3779d42815cd9..a06588e5e98dc 100644 --- a/blocks/tag_youtube/block_tag_youtube.php +++ b/blocks/tag_youtube/block_tag_youtube.php @@ -45,10 +45,6 @@ function instance_allow_multiple() { return true; } - function preferred_width() { - return 140; - } - function get_content() { global $CFG; diff --git a/blocks/upgrade.txt b/blocks/upgrade.txt index abd99d2af9a03..17e78fc07a751 100644 --- a/blocks/upgrade.txt +++ b/blocks/upgrade.txt @@ -1,6 +1,10 @@ This files describes API changes in /blocks/* - activity modules, information provided here is intended especially for developers. +=== 2.9 === + +* The obsolete method preferred_width() was removed. + === 2.8 === * The instance_config_print() function was removed. It was deprecated in