Skip to content
Permalink
Browse files

MDL-64506 Javascript: Remove docking JS.

Deprecate related lang strings & base functions now return false.
  • Loading branch information...
Chocolate-lightning committed Mar 12, 2019
1 parent 3f2c68f commit 9757c65687e71de50902f4dc6d04415420027647
@@ -462,11 +462,10 @@ function _load_instance($instance, $page) {
* Allows the block to load any JS it requires into the page.
*
* By default this function simply permits the user to dock the block if it is dockable.
*
* Left null as of MDL-64506.
*/
function get_required_javascript() {
if ($this->instance_can_be_docked() && !$this->hide_header()) {
user_preference_allow_ajax_update('docked_block_instance_'.$this->instance->id, PARAM_INT);
}
}
/**
@@ -651,6 +650,8 @@ static function get_extra_capabilities() {
* Can be overridden by the block to prevent the block from being dockable.
*
* @return bool
*
* Return false as per MDL-64506
*/
public function instance_can_be_docked() {
return false;
@@ -643,11 +643,9 @@
// http://yuilibrary.com/yui/docs/api/classes/config.html#property_logInclude
// http://yuilibrary.com/yui/docs/api/classes/config.html#property_logExclude
// $CFG->yuiloginclude = array(
// 'moodle-core-dock-loader' => true,
// 'moodle-course-categoryexpander' => true,
// );
// $CFG->yuilogexclude = array(
// 'moodle-core-dock' => true,
// 'moodle-core-notification' => true,
// );
//
@@ -22,7 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['addtodock'] = 'Move this to the dock';
$string['anypagematchingtheabove'] = 'Any page matching the above';
$string['appearsinsubcontexts'] = 'Appears in sub-contexts';
$string['assignrolesinblock'] = 'Assign roles in {$a} block';
@@ -43,9 +42,7 @@
$string['deleteblock'] = 'Delete {$a} block';
$string['deleteblockcheck'] = 'Are you sure that you want to delete this block titled {$a}?';
$string['deleteblockwarning'] = '<p>You are about to delete a block that appears elsewhere.</p><p>Original block location: {$a->location}<br />Display on page types: {$a->pagetype}</p><p>Are you sure you want to continue?</p>';
$string['dockblock'] = 'Dock {$a} block';
$string['hideblock'] = 'Hide {$a} block';
$string['hidedockpanel'] = 'Hide the dock panel';
$string['hidepanel'] = 'Hide panel';
$string['moveblock'] = 'Move {$a} block';
$string['moveblockafter'] = 'Move block to after {$a} block';
@@ -71,9 +68,14 @@
$string['subpages'] = 'Select pages';
$string['restrictpagetypes'] = 'Display on page types';
$string['thisspecificpage'] = 'This specific page';
$string['undockall'] = 'Undock all';
$string['undockblock'] = 'Undock {$a} block';
$string['undockitem'] = 'Undock this item';
$string['visible'] = 'Visible';
$string['weight'] = 'Weight';
$string['wherethisblockappears'] = 'Where this block appears';
// Deprecated since Moodle 3.7.
$string['addtodock'] = 'Move this to the dock';
$string['dockblock'] = 'Dock {$a} block';
$string['hidedockpanel'] = 'Hide the dock panel';
$string['undockall'] = 'Undock all';
$string['undockblock'] = 'Undock {$a} block';
$string['undockitem'] = 'Undock this item';
@@ -147,3 +147,9 @@ outputdisabled,core_message
outputdoesnotexist,core_message
outputenabled,core_message
outputnotconfigured,core_message
addtodock,core_block
dockblock,core_block
hidedockpanel,core_block
undockall,core_block
undockblock,core_block
undockitem,core_block
@@ -596,36 +596,11 @@ public function add_fake_block($bc, $region) {
* @see region_uses_dock
* @param string $region
* @return bool True if all of the blocks within that region are docked
*
* Return false as from MDL-64506
*/
public function region_completely_docked($region, $output) {
global $CFG;
// If theme doesn't allow docking or allowblockstodock is not set, then return.
if (!$this->page->theme->enable_dock || empty($CFG->allowblockstodock)) {
return false;
}
// Do not dock the region when the user attemps to move a block.
if ($this->movingblock) {
return false;
}
// Block regions should not be docked during editing when all the blocks are hidden.
if ($this->page->user_is_editing() && $this->page->user_can_edit_blocks()) {
return false;
}
$this->check_is_loaded();
$this->ensure_content_created($region, $output);
if (!$this->region_has_content($region, $output)) {
// If the region has no content then nothing is docked at all of course.
return false;
}
foreach ($this->visibleblockcontent[$region] as $instance) {
if (!get_user_preferences('docked_block_instance_'.$instance->blockinstanceid, 0)) {
return false;
}
}
return true;
return false;
}
/**
@@ -634,20 +609,10 @@ public function region_completely_docked($region, $output) {
* @see region_completely_docked
* @param array|string $regions array of regions (or single region)
* @return bool True if any of the blocks within that region are docked
*
* Return false as from MDL-64506
*/
public function region_uses_dock($regions, $output) {
if (!$this->page->theme->enable_dock) {
return false;
}
$this->check_is_loaded();
foreach((array)$regions as $region) {
$this->ensure_content_created($region, $output);
foreach($this->visibleblockcontent[$region] as $instance) {
if(!empty($instance->content) && get_user_preferences('docked_block_instance_'.$instance->blockinstanceid, 0)) {
return true;
}
}
}
return false;
}
@@ -744,7 +744,7 @@ private function __construct($config) {
$configurable = array(
'parents', 'sheets', 'parents_exclude_sheets', 'plugins_exclude_sheets', 'usefallback',
'javascripts', 'javascripts_footer', 'parents_exclude_javascripts',
'layouts', 'enable_dock', 'enablecourseajax', 'requiredblocks',
'layouts', 'enablecourseajax', 'requiredblocks',
'rendererfactory', 'csspostprocess', 'editor_sheets', 'editor_scss', 'rarrow', 'larrow', 'uarrow', 'darrow',
'hidefromselector', 'doctype', 'yuicssmodules', 'blockrtlmanipulations',
'lessfile', 'extralesscallback', 'lessvariablescallback', 'blockrendermethod',

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 9757c65

Please sign in to comment.
You can’t perform that action at this time.