mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'MDL-39661-master' of git://github.com/FMCorz/moodle
This commit is contained in:
commit
f6652bc750
3 changed files with 13 additions and 3 deletions
|
@ -50,6 +50,7 @@ $string['hidepanel'] = 'Hide panel';
|
||||||
$string['moveblock'] = 'Move {$a} block';
|
$string['moveblock'] = 'Move {$a} block';
|
||||||
$string['moveblockafter'] = 'Move block to after {$a} block';
|
$string['moveblockafter'] = 'Move block to after {$a} block';
|
||||||
$string['moveblockbefore'] = 'Move block to before {$a} block';
|
$string['moveblockbefore'] = 'Move block to before {$a} block';
|
||||||
|
$string['moveblockinregion'] = 'Move block to {$a} region';
|
||||||
$string['movingthisblockcancel'] = 'Moving this block ({$a})';
|
$string['movingthisblockcancel'] = 'Moving this block ({$a})';
|
||||||
$string['onthispage'] = 'On this page';
|
$string['onthispage'] = 'On this page';
|
||||||
$string['pagetypes'] = 'Page types';
|
$string['pagetypes'] = 'Page types';
|
||||||
|
|
|
@ -1413,7 +1413,7 @@ class core_renderer extends renderer_base {
|
||||||
$output .= $this->block($bc, $region);
|
$output .= $this->block($bc, $region);
|
||||||
$lastblock = $bc->title;
|
$lastblock = $bc->title;
|
||||||
} else if ($bc instanceof block_move_target) {
|
} else if ($bc instanceof block_move_target) {
|
||||||
$output .= $this->block_move_target($bc, $zones, $lastblock);
|
$output .= $this->block_move_target($bc, $zones, $lastblock, $region);
|
||||||
} else {
|
} else {
|
||||||
throw new coding_exception('Unexpected type of thing (' . get_class($bc) . ') found in list of block contents.');
|
throw new coding_exception('Unexpected type of thing (' . get_class($bc) . ') found in list of block contents.');
|
||||||
}
|
}
|
||||||
|
@ -1427,11 +1427,18 @@ class core_renderer extends renderer_base {
|
||||||
* @param block_move_target $target with the necessary details.
|
* @param block_move_target $target with the necessary details.
|
||||||
* @param array $zones array of areas where the block can be moved to
|
* @param array $zones array of areas where the block can be moved to
|
||||||
* @param string $previous the block located before the area currently being rendered.
|
* @param string $previous the block located before the area currently being rendered.
|
||||||
|
* @param string $region the name of the region
|
||||||
* @return string the HTML to be output.
|
* @return string the HTML to be output.
|
||||||
*/
|
*/
|
||||||
public function block_move_target($target, $zones, $previous) {
|
public function block_move_target($target, $zones, $previous, $region) {
|
||||||
if ($previous == null) {
|
if ($previous == null) {
|
||||||
|
if (empty($zones)) {
|
||||||
|
// There are no zones, probably because there are no blocks.
|
||||||
|
$regions = $this->page->theme->get_all_block_regions();
|
||||||
|
$position = get_string('moveblockinregion', 'block', $regions[$region]);
|
||||||
|
} else {
|
||||||
$position = get_string('moveblockbefore', 'block', $zones[0]);
|
$position = get_string('moveblockbefore', 'block', $zones[0]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$position = get_string('moveblockafter', 'block', $previous);
|
$position = get_string('moveblockafter', 'block', $previous);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ information provided here is intended especially for developers.
|
||||||
|
|
||||||
=== 2.7 ===
|
=== 2.7 ===
|
||||||
|
|
||||||
|
* $core_renderer->block_move_target() changed to support more verbose move-block-here descriptions.
|
||||||
|
|
||||||
DEPRECATIONS:
|
DEPRECATIONS:
|
||||||
* Abstract class \core\event\course_module_instances_list_viewed is deprecated now, use \core\event\instances_list_viewed instead.
|
* Abstract class \core\event\course_module_instances_list_viewed is deprecated now, use \core\event\instances_list_viewed instead.
|
||||||
* mod_book\event\instances_list_viewed has been deprecated. Please use mod_book\event\course_module_instance_list_viewed instead.
|
* mod_book\event\instances_list_viewed has been deprecated. Please use mod_book\event\course_module_instance_list_viewed instead.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue